Skip to content

Commit

Permalink
Harfbuzz libraries update (#2191)
Browse files Browse the repository at this point in the history
* Update harfbuzz-icu-freetype with latest library versions

* Add more location presets for checking text in GlfwApp

* Revise and document Apple fallback font list

* Store iOS CMake log on CI

* Store iOS CMake errors on CI

* Update harfbuzz-icu-freetype submodule with build fixes

* Revert "Store iOS CMake errors on CI" and "Store iOS CMake log on CI"

More practical to debug these issues by accessing the build container with SSH

* Remove references to UCDN

No longer needed separately from harfbuzz
  • Loading branch information
matteblair authored Oct 21, 2020
1 parent e98cd09 commit 8f75660
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 7 deletions.
5 changes: 2 additions & 3 deletions core/deps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@ target_include_directories(miniz


if(NOT TANGRAM_USE_SYSTEM_FONT_LIBS)
## Harfbuzz - ICU-Common - UCDN - Freetype2 ##
##############################################
## Harfbuzz - ICU-Common - Freetype2 ##
#######################################
set(HARFBUZZ_BUILD_ICU ON CACHE BOOL "Enable building of ICU")
set(HARFBUZZ_BUILD_UCDN ON CACHE BOOL "Enable building of UCDN")
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/harfbuzz-icu-freetype)

message(STATUS "harfbuzz" ${HARFBUZZ_LIBRARIES})
Expand Down
2 changes: 1 addition & 1 deletion core/deps/harfbuzz-icu-freetype
26 changes: 23 additions & 3 deletions platforms/common/appleAllowedFonts.mm
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,29 @@
namespace Tangram {

bool allowedFamily(NSString* familyName) {
const NSArray<NSString *> *allowedFamilyList = @[ @"Hebrew", @"Kohinoor", @"Gumurki", @"Thonburi", @"Tamil",
@"Gurmukhi", @"Kailasa", @"Sangam", @"PingFang", @"Geeza",
@"Mishafi", @"Farah", @"Hiragino", @"Gothic", @"Nastaliq" ];
// macOS and iOS have many pre-installed fonts, supporting many scripts.
// Evaluating all fonts to find glyphs is slow, so limit the set of fonts loaded to one family per script.
// Apple provides a list of pre-installed fonts on the latest versions of macOS and iOS. These lists may not
// reflect the fonts available on earlier OS versions, so check multiple versions when possible.
// https://developer.apple.com/fonts/system-fonts/#preinstalled
const NSArray<NSString *> *allowedFamilyList =
@[ @"Apple SD Gothic Neo", // Hangul
@"Arial Hebrew", // Hebrew
@"Geeza Pro", // Arabic
@"Gurmukhi", // Gurmukhi
@"Hiragino", // Hiragana, Katakana
@"Kailasa", // Tibetan
@"Kannada Sangam", // Kannada
@"Kohinoor", // Bangla, Devanagari, Telugu
@"Malayalam Sangam", // Malayalam
@"Mishafi", // Arabic, Najdi Arabic
@"Myanmar Sangam", // Myanmar
@"Noto Nastaliq Urdu", // Arabic, Urdu
@"Oriya Sangam", // Odia
@"PingFang", // Hiragana, Katakana, Simplified Han, Traditional Han
@"Tamil", // Tamil
@"Thonburi", // Cyrillic, Thai
];

for (NSString* allowedFamily in allowedFamilyList) {
if ( [familyName containsString:allowedFamily] ) { return true; }
Expand Down
12 changes: 12 additions & 0 deletions platforms/common/glfwApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,18 @@ void keyCallback(GLFWwindow* window, int key, int scancode, int action, int mods
camera.zoom = 16.f;
map->flyTo(camera, -1.f, 1.0);
break;
case GLFW_KEY_F8: // Beijing
map->setCameraPosition({116.39703, 39.91006, 12.5});
break;
case GLFW_KEY_F9: // Bangkok
map->setCameraPosition({100.49216, 13.7556, 12.5});
break;
case GLFW_KEY_F10: // Dhaka
map->setCameraPosition({90.40166, 23.72909, 14.5});
break;
case GLFW_KEY_F11: // Tehran
map->setCameraPosition({51.42086, 35.7409, 13.5});
break;
case GLFW_KEY_W:
map->onMemoryWarning();
break;
Expand Down

0 comments on commit 8f75660

Please sign in to comment.