Skip to content

Commit

Permalink
Revert #78 #69 (#122)
Browse files Browse the repository at this point in the history
* Revert "Create fallback font manager to solve performance drops (#78)"

This reverts commit c761164.

* Revert "Fix font breaking issues (#69)"

This reverts commit 5552dd5.

* Add SamsungOneUI to DefaultFontFamilies

Signed-off-by: Boram Bae <[email protected]>
  • Loading branch information
bbrto21 authored and swift-kim committed Dec 9, 2021
1 parent a83229e commit 2b19cd1
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 82 deletions.
1 change: 1 addition & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ jobs:
--target-sysroot $HOME/tizen_tools/sysroot/$(arch) \
--target-triple $(targetTriple) \
--runtime-mode $(mode) \
--enable-fontconfig \
--embedder-for-target \
--disable-desktop-embeddings \
--build-tizen-shell
Expand Down
4 changes: 1 addition & 3 deletions third_party/txt/src/txt/font_collection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ size_t FontCollection::GetFontManagersCount() const {
void FontCollection::SetupDefaultFontManager(
uint32_t font_initialization_data) {
default_font_manager_ = GetDefaultFontManager(font_initialization_data);
fallback_font_manager_ = GetFallbackFontManager(font_initialization_data);
}

void FontCollection::SetDefaultFontManager(sk_sp<SkFontMgr> font_manager) {
Expand Down Expand Up @@ -146,8 +145,6 @@ std::vector<sk_sp<SkFontMgr>> FontCollection::GetFontManagerOrder() const {
order.push_back(test_font_manager_);
if (default_font_manager_)
order.push_back(default_font_manager_);
if (fallback_font_manager_)
order.push_back(fallback_font_manager_);
return order;
}

Expand Down Expand Up @@ -191,6 +188,7 @@ FontCollection::GetMinikinFontCollectionForFamilies(
FindFontFamilyInManagers(family);
if (minikin_family != nullptr) {
minikin_families.push_back(minikin_family);
break;
}
}
}
Expand Down
1 change: 0 additions & 1 deletion third_party/txt/src/txt/font_collection.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ class FontCollection : public std::enable_shared_from_this<FontCollection> {
};

sk_sp<SkFontMgr> default_font_manager_;
sk_sp<SkFontMgr> fallback_font_manager_;
sk_sp<SkFontMgr> asset_font_manager_;
sk_sp<SkFontMgr> dynamic_font_manager_;
sk_sp<SkFontMgr> test_font_manager_;
Expand Down
4 changes: 0 additions & 4 deletions third_party/txt/src/txt/platform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,4 @@ sk_sp<SkFontMgr> GetDefaultFontManager(uint32_t font_initialization_data) {
return SkFontMgr::RefDefault();
}

sk_sp<SkFontMgr> GetFallbackFontManager(uint32_t font_initialization_data) {
return nullptr;
}

} // namespace txt
2 changes: 0 additions & 2 deletions third_party/txt/src/txt/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ std::vector<std::string> GetDefaultFontFamilies();

sk_sp<SkFontMgr> GetDefaultFontManager(uint32_t font_initialization_data);

sk_sp<SkFontMgr> GetFallbackFontManager(uint32_t font_initialization_data);

} // namespace txt

#endif // TXT_PLATFORM_H_
74 changes: 2 additions & 72 deletions third_party/txt/src/txt/platform_linux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,84 +13,14 @@
namespace txt {

std::vector<std::string> GetDefaultFontFamilies() {
#ifdef FLUTTER_USE_FONTCONFIG
return {"TizenDefaultFont"};
#else
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",
};
#endif
return {"TizenDefaultFont", "SamsungOneUI"};
}

sk_sp<SkFontMgr> GetDefaultFontManager(uint32_t font_initialization_data) {
#ifdef FLUTTER_USE_FONTCONFIG
return SkFontMgr::RefDefault();
#else
return SkFontMgr_New_Custom_Directory("/usr/share/fonts");
#endif
}

sk_sp<SkFontMgr> GetFallbackFontManager(uint32_t font_initialization_data) {
#ifdef FLUTTER_USE_FONTCONFIG
return nullptr;
#else
return SkFontMgr_New_Custom_Directory("/usr/share/fallback_fonts");
return SkFontMgr_New_Custom_Directory("/usr/share/fonts/");
#endif
}

Expand Down

0 comments on commit 2b19cd1

Please sign in to comment.