From d343737210a1758baf5f24ce340ce7a36246ffd2 Mon Sep 17 00:00:00 2001 From: Hakkyu Kim Date: Tue, 20 Apr 2021 13:26:37 +0900 Subject: [PATCH 1/3] Allow multiple default fonts for localizations --- third_party/txt/src/txt/font_collection.cc | 1 - third_party/txt/src/txt/platform_linux.cc | 14 ++++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) 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..d1e04305b36e4 100644 --- a/third_party/txt/src/txt/platform_linux.cc +++ b/third_party/txt/src/txt/platform_linux.cc @@ -13,14 +13,24 @@ namespace txt { std::vector GetDefaultFontFamilies() { - return {"SamsungOneUI", "BreezeSans", "Ubuntu", "Cantarell", "DejaVu Sans", "Liberation Sans", "Arial"}; + return { + "SamsungOneUI", "BreezeColorEmoji", "SECEmoji", + "SamsungOneUIKorean", "SamsungOneUISCN", "SamsungOneUITCN", + "BreezeSansJapanese", "BreezeSansHindi", "BreezeSansBengali", + "SamsungOneUIEthiopic", "BreezeSansGeorgian", "BreezeSansGujarathi", + "BreezeSansKannada", "BreezeSansKhmer", "BreezeSansMalayalam", + "BreezeSansMyanmar", "BreezeSansOriya", "BreezeSansPunjabi", + "BreezeSansSinhala", "BreezeSansTamil", "BreezeSansTelugu", + "BreezeSansMeeteiMayek", "BreezeSansTibetan", "SamsungOneUIOlChiki", + "BreezeSansArmenian", "SamsungOneUILao", "BreezeSansThai", + "SamsungOneUIArabic", "SamsungOneUIHebrew", "SamsungOneUIFallback"}; } 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 } From e84aaa84803097eaf1dfc4e6ca34d7fa9fe4f59c Mon Sep 17 00:00:00 2001 From: Hakkyu Kim Date: Wed, 21 Apr 2021 17:06:02 +0900 Subject: [PATCH 2/3] Update fallback fonts from tv profile --- third_party/txt/src/txt/platform_linux.cc | 36 ++++++++++++++++------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/third_party/txt/src/txt/platform_linux.cc b/third_party/txt/src/txt/platform_linux.cc index d1e04305b36e4..55b089d3cc1ec 100644 --- a/third_party/txt/src/txt/platform_linux.cc +++ b/third_party/txt/src/txt/platform_linux.cc @@ -14,16 +14,32 @@ namespace txt { std::vector GetDefaultFontFamilies() { return { - "SamsungOneUI", "BreezeColorEmoji", "SECEmoji", - "SamsungOneUIKorean", "SamsungOneUISCN", "SamsungOneUITCN", - "BreezeSansJapanese", "BreezeSansHindi", "BreezeSansBengali", - "SamsungOneUIEthiopic", "BreezeSansGeorgian", "BreezeSansGujarathi", - "BreezeSansKannada", "BreezeSansKhmer", "BreezeSansMalayalam", - "BreezeSansMyanmar", "BreezeSansOriya", "BreezeSansPunjabi", - "BreezeSansSinhala", "BreezeSansTamil", "BreezeSansTelugu", - "BreezeSansMeeteiMayek", "BreezeSansTibetan", "SamsungOneUIOlChiki", - "BreezeSansArmenian", "SamsungOneUILao", "BreezeSansThai", - "SamsungOneUIArabic", "SamsungOneUIHebrew", "SamsungOneUIFallback"}; + "SamsungOneUI", "SamsungOneUIArabic", + "SamsungOneUIArmenian", "SamsungOneUIBangla", + "SamsungOneUIDevanagari", "SamsungOneUIEthiopic", + "SamsungOneUIGeorgian", "SamsungOneUIGujarati", + "SamsungOneUIGurmukhi", "SamsungOneUIHebrew", + "SamsungOneUIJP", "SamsungOneUIKannada", + "SamsungOneUIKhmer", "SamsungOneUIKorean", + "SamsungOneUIKoreanH", "SamsungOneUILao", + "SamsungOneUIMalayalam", "SamsungOneUIMyanmar", + "SamsungOneUIOdia", "SamsungOneUIOlChiki", + "SamsungOneUISCN", "SamsungOneUISinhala", + "SamsungOneUITCN", "SamsungOneUITagalog", + "SamsungOneUITamil", "SamsungOneUITelugu", + "SamsungOneUIThai", "SECEmoji", + "BreezeColorEmoji", "BreezeSansArmenian", + "BreezeSansBengali", "BreezeSansGeorgian", + "BreezeSansGujarathi", "BreezeSansHindi", + "BreezeSansJapanese", "BreezeSansKannada", + "BreezeSansKhmer", "BreezeSansMalayalam", + "BreezeSansMeeteiMayek", "BreezeSansMyanmar", + "BreezeSansOriya", "BreezeSansPunjabi", + "BreezeSansSinhala", "BreezeSansTamil", + "BreezeSansTelugu", "BreezeSansThai", + "BreezeSansTibetan", "SamsungOneUIFallback", + "SamsungOneFallback", + }; } sk_sp GetDefaultFontManager() { From a4bdaeda83197686403d13005f0bb201b8209459 Mon Sep 17 00:00:00 2001 From: Hakkyu Kim Date: Thu, 22 Apr 2021 15:16:08 +0900 Subject: [PATCH 3/3] Add fonts in wearable and tv emulator + adjust azure pipeline --- azure-pipelines.yml | 2 - third_party/txt/src/txt/platform_linux.cc | 80 ++++++++++++++++------- 2 files changed, 56 insertions(+), 26 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 875420e0d0006..c12cab288ffbe 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -54,7 +54,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 \ @@ -71,7 +70,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/platform_linux.cc b/third_party/txt/src/txt/platform_linux.cc index 55b089d3cc1ec..56bdc1a2cac6b 100644 --- a/third_party/txt/src/txt/platform_linux.cc +++ b/third_party/txt/src/txt/platform_linux.cc @@ -14,31 +14,63 @@ namespace txt { std::vector GetDefaultFontFamilies() { return { - "SamsungOneUI", "SamsungOneUIArabic", - "SamsungOneUIArmenian", "SamsungOneUIBangla", - "SamsungOneUIDevanagari", "SamsungOneUIEthiopic", - "SamsungOneUIGeorgian", "SamsungOneUIGujarati", - "SamsungOneUIGurmukhi", "SamsungOneUIHebrew", - "SamsungOneUIJP", "SamsungOneUIKannada", - "SamsungOneUIKhmer", "SamsungOneUIKorean", - "SamsungOneUIKoreanH", "SamsungOneUILao", - "SamsungOneUIMalayalam", "SamsungOneUIMyanmar", - "SamsungOneUIOdia", "SamsungOneUIOlChiki", - "SamsungOneUISCN", "SamsungOneUISinhala", - "SamsungOneUITCN", "SamsungOneUITagalog", - "SamsungOneUITamil", "SamsungOneUITelugu", - "SamsungOneUIThai", "SECEmoji", - "BreezeColorEmoji", "BreezeSansArmenian", - "BreezeSansBengali", "BreezeSansGeorgian", - "BreezeSansGujarathi", "BreezeSansHindi", - "BreezeSansJapanese", "BreezeSansKannada", - "BreezeSansKhmer", "BreezeSansMalayalam", - "BreezeSansMeeteiMayek", "BreezeSansMyanmar", - "BreezeSansOriya", "BreezeSansPunjabi", - "BreezeSansSinhala", "BreezeSansTamil", - "BreezeSansTelugu", "BreezeSansThai", - "BreezeSansTibetan", "SamsungOneUIFallback", + "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", }; }