From 28dbd0208bf4e278a9a411d82dcfb55757099d82 Mon Sep 17 00:00:00 2001 From: Hakkyu Kim <43136596+HakkyuKim@users.noreply.github.com> Date: Fri, 23 Apr 2021 09:51:46 +0900 Subject: [PATCH] Fix font breaking issues (#69) * Allow multiple default fonts for localizations * Update fallback fonts from tv profile * Add fonts in wearable and tv emulator + adjust azure pipeline --- azure-pipelines.yml | 2 - third_party/txt/src/txt/font_collection.cc | 1 - third_party/txt/src/txt/platform_linux.cc | 62 +++++++++++++++++++++- 3 files changed, 60 insertions(+), 5 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c4ff87fd66d09..b8ed161045e70 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -66,7 +66,6 @@ jobs: --target-sysroot `pwd`/tizen_tools/sysroot/$(arch) \ --target-triple $(targetTriple) \ --runtime-mode $(mode) \ - --enable-fontconfig \ --embedder-for-target \ --disable-desktop-embeddings \ --build-tizen-shell \ @@ -83,7 +82,6 @@ jobs: --target-sysroot `pwd`/tizen_tools/sysroot/$(arch)_40 \ --target-triple $(targetTriple) \ --runtime-mode $(mode) \ - --enable-fontconfig \ --embedder-for-target \ --disable-desktop-embeddings \ --build-tizen-shell \ diff --git a/third_party/txt/src/txt/font_collection.cc b/third_party/txt/src/txt/font_collection.cc index 353a10e51c08e..62978d03b80eb 100644 --- a/third_party/txt/src/txt/font_collection.cc +++ b/third_party/txt/src/txt/font_collection.cc @@ -187,7 +187,6 @@ FontCollection::GetMinikinFontCollectionForFamilies( FindFontFamilyInManagers(family); if (minikin_family != nullptr) { minikin_families.push_back(minikin_family); - break; } } } diff --git a/third_party/txt/src/txt/platform_linux.cc b/third_party/txt/src/txt/platform_linux.cc index b2c77568d2868..56bdc1a2cac6b 100644 --- a/third_party/txt/src/txt/platform_linux.cc +++ b/third_party/txt/src/txt/platform_linux.cc @@ -13,14 +13,72 @@ namespace txt { std::vector GetDefaultFontFamilies() { - return {"SamsungOneUI", "BreezeSans", "Ubuntu", "Cantarell", "DejaVu Sans", "Liberation Sans", "Arial"}; + return { + "SamsungOneUI", + "SamsungOneUIArabic", + "SamsungOneUIArmenian", + "SamsungOneUIBangla", + "SamsungOneUIDevanagari", + "SamsungOneUIEthiopic", + "SamsungOneUIFallback", + "SamsungOneUIGeorgian", + "SamsungOneUIGujarati", + "SamsungOneUIGurmukhi", + "SamsungOneUIHebrew", + "SamsungOneUIJP", + "SamsungOneUIKannada", + "SamsungOneUIKhmer", + "SamsungOneUIKorean", + "SamsungOneUIKoreanH", + "SamsungOneUILao", + "SamsungOneUIMalayalam", + "SamsungOneUIMyanmar", + "SamsungOneUIOdia", + "SamsungOneUIOlChiki", + "SamsungOneUISCN", + "SamsungOneUISinhala", + "SamsungOneUITCN", + "SamsungOneUITagalog", + "SamsungOneUITamil", + "SamsungOneUITelugu", + "SamsungOneUIThai", + "SamsungOneFallback", + "SECEmoji", + "BreezeSans", + "BreezeSansArabic", + "BreezeSansArmenian", + "BreezeSansBengali", + "BreezeSansChinese", + "BreezeSansEthiopic", + "BreezeSansGeorgian", + "BreezeSansGujarathi", + "BreezeSansHebrew", + "BreezeSansHindi", + "BreezeSansJapanese", + "BreezeSansKannada", + "BreezeSansKhmer", + "BreezeSansKorean", + "BreezeSansLao", + "BreezeSansMalayalam", + "BreezeSansMeeteiMayek", + "BreezeSansMyanmar", + "BreezeSansOriya", + "BreezeSansPunjabi", + "BreezeSansSinhala", + "BreezeSansTamilBreezeSansTamil", + "BreezeSansTelugu", + "BreezeSansThai", + "BreezeSansTibetan", + "BreezeSansFallback", + "BreezeColorEmoji", + }; } sk_sp GetDefaultFontManager() { #ifdef FLUTTER_USE_FONTCONFIG return SkFontMgr_New_FontConfig(nullptr); #else - return SkFontMgr_New_Custom_Directory("/usr/share/fonts/"); + return SkFontMgr_New_Custom_Directory("/usr/share/"); #endif }