From 971a196528a39842a6eabd918c18a260a2048e4c Mon Sep 17 00:00:00 2001 From: Mitchell Goodwin Date: Tue, 12 Dec 2023 10:16:08 -0800 Subject: [PATCH 01/16] Register lightweight --- third_party/txt/src/txt/platform_mac.mm | 47 +++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/third_party/txt/src/txt/platform_mac.mm b/third_party/txt/src/txt/platform_mac.mm index 3a747d3304823..7bd9327e145ae 100644 --- a/third_party/txt/src/txt/platform_mac.mm +++ b/third_party/txt/src/txt/platform_mac.mm @@ -26,9 +26,14 @@ static const std::string kSFProDisplayName = "CupertinoSystemDisplay"; // Font name represents the "SF Pro Text" system font on Apple platforms. static const std::string kSFProTextName = "CupertinoSystemText"; +// Font weight representing Regular +float kNormalWeightValue = 400; + namespace txt { +const FourCharCode kWeightTag = 'wght'; + std::vector GetDefaultFontFamilies() { if (fml::IsPlatformVersionAtLeast(9)) { return {[FONT_CLASS systemFontOfSize:14].familyName.UTF8String}; @@ -42,6 +47,42 @@ return mgr; } +CTFontRef MatchSystemUIFont(float desired_weight, float size) { + CTFontRef ct_font( + CTFontCreateUIFontForLanguage(kCTFontUIFontSystem, size, nullptr)); + + if (desired_weight == kNormalWeightValue) { + return ct_font; + } + + CFMutableDictionaryRef variations(CFDictionaryCreateMutable( + kCFAllocatorDefault, 1, &kCFTypeDictionaryKeyCallBacks, + &kCFTypeDictionaryValueCallBacks)); + + auto add_axis_to_variations = [&variations](const FourCharCode tag, + float desired_value, + float normal_value) { + if (desired_value != normal_value) { + CFNumberRef tag_number( + CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &tag)); + CFNumberRef value_number(CFNumberCreate( + kCFAllocatorDefault, kCFNumberFloatType, &desired_value)); + CFDictionarySetValue(variations, tag_number, value_number); + } + }; + add_axis_to_variations(kWeightTag, desired_weight, kNormalWeightValue); + + CFMutableDictionaryRef attributes(CFDictionaryCreateMutable( + kCFAllocatorDefault, 1, &kCFTypeDictionaryKeyCallBacks, + &kCFTypeDictionaryValueCallBacks)); + CFDictionarySetValue(attributes, kCTFontVariationAttribute, variations); + + CTFontDescriptorRef var_font_desc( + CTFontDescriptorCreateWithAttributes(attributes)); + + return CTFontCreateCopyWithAttributes(ct_font, size, nullptr, var_font_desc); +} + void RegisterSystemFonts(const DynamicFontManager& dynamic_font_manager) { // iOS loads different system fonts when size is greater than 28 or lower // than 17. The "familyName" property returned from CoreText stays the same @@ -63,6 +104,12 @@ void RegisterSystemFonts(const DynamicFontManager& dynamic_font_manager) { dynamic_font_manager.font_provider().RegisterTypeface(large_system_font, kSFProDisplayName); } + sk_sp large_system_font_lightweight = SkMakeTypefaceFromCTFont( + (CTFontRef)CFAutorelease(MatchSystemUIFont(0, kSFProDisplayBreakPoint))); + if (large_system_font_lightweight) { + dynamic_font_manager.font_provider().RegisterTypeface( + large_system_font_lightweight, "CupertinoSystemDisplayw100"); + } sk_sp regular_system_font = SkMakeTypefaceFromCTFont( (CTFontRef)CFAutorelease(CTFontCreateUIFontForLanguage( kCTFontUIFontSystem, kSFProTextBreakPoint, NULL))); From 176ad4c01207ef6e7285d0776e29e6162cc038da Mon Sep 17 00:00:00 2001 From: Mitchell Goodwin Date: Tue, 12 Dec 2023 10:18:28 -0800 Subject: [PATCH 02/16] Formatting --- third_party/txt/src/txt/platform_mac.mm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/third_party/txt/src/txt/platform_mac.mm b/third_party/txt/src/txt/platform_mac.mm index 7bd9327e145ae..257261ab0a5fe 100644 --- a/third_party/txt/src/txt/platform_mac.mm +++ b/third_party/txt/src/txt/platform_mac.mm @@ -29,7 +29,6 @@ // Font weight representing Regular float kNormalWeightValue = 400; - namespace txt { const FourCharCode kWeightTag = 'wght'; @@ -108,7 +107,7 @@ void RegisterSystemFonts(const DynamicFontManager& dynamic_font_manager) { (CTFontRef)CFAutorelease(MatchSystemUIFont(0, kSFProDisplayBreakPoint))); if (large_system_font_lightweight) { dynamic_font_manager.font_provider().RegisterTypeface( - large_system_font_lightweight, "CupertinoSystemDisplayw100"); + large_system_font_lightweight, "CupertinoSystemDisplayw100"); } sk_sp regular_system_font = SkMakeTypefaceFromCTFont( (CTFontRef)CFAutorelease(CTFontCreateUIFontForLanguage( From f4811277d4c43eebf592b99c52228952b83fe865 Mon Sep 17 00:00:00 2001 From: Mitchell Goodwin Date: Tue, 12 Dec 2023 16:38:41 -0800 Subject: [PATCH 03/16] Add loop through font weights --- lib/ui/text.dart | 9 +++++++- lib/ui/text/font_collection.h | 2 ++ third_party/txt/src/txt/asset_font_manager.cc | 22 ++++++++++++++----- third_party/txt/src/txt/font_collection.h | 1 + third_party/txt/src/txt/platform_mac.mm | 22 ++++++++++++++----- 5 files changed, 45 insertions(+), 11 deletions(-) diff --git a/lib/ui/text.dart b/lib/ui/text.dart index 374011ea45c66..0a16be26956d1 100644 --- a/lib/ui/text.dart +++ b/lib/ui/text.dart @@ -19,6 +19,13 @@ enum FontStyle { italic, } +String? _proxySystemFont(String? fontFamily, FontWeight? fontWeight) { + if (fontFamily != null && fontFamily == 'CupertinoSystemText' || fontFamily == 'CupertinoSystemDisplay') { + return fontFamily! + (fontWeight!= null ? fontWeight.toString().substring(11) :''); + } + return fontFamily; +} + /// The thickness of the glyphs used to draw the text. /// /// Fonts are typically weighted on a 9-point scale, which, for historical @@ -1742,7 +1749,7 @@ class TextStyle { fontVariations, ), _leadingDistribution = leadingDistribution, - _fontFamily = fontFamily ?? '', + _fontFamily = _proxySystemFont(fontFamily, fontWeight) ?? '', _fontFamilyFallback = fontFamilyFallback, _fontSize = fontSize, _letterSpacing = letterSpacing, diff --git a/lib/ui/text/font_collection.h b/lib/ui/text/font_collection.h index 9c8d41f3ba773..b268083b64fb9 100644 --- a/lib/ui/text/font_collection.h +++ b/lib/ui/text/font_collection.h @@ -34,6 +34,8 @@ class FontCollection { Dart_Handle callback, const std::string& family_name); + // sk_sp FontCollection::matchTypeface(const SkString& familyName, SkFontStyle fontStyle) override; + private: std::shared_ptr collection_; sk_sp dynamic_font_manager_; diff --git a/third_party/txt/src/txt/asset_font_manager.cc b/third_party/txt/src/txt/asset_font_manager.cc index c9952e85e8dad..ffe42c881d19b 100644 --- a/third_party/txt/src/txt/asset_font_manager.cc +++ b/third_party/txt/src/txt/asset_font_manager.cc @@ -54,11 +54,23 @@ sk_sp AssetFontManager::onMatchFamily( sk_sp AssetFontManager::onMatchFamilyStyle( const char familyName[], const SkFontStyle& style) const { - sk_sp font_style_set = - font_provider_->MatchFamily(std::string(familyName)); - if (font_style_set == nullptr) - return nullptr; - return font_style_set->matchStyle(style); +// #if FML_OS_MACOSX || FML_OS_IOS + // if (strcmp(familyName, "CupertinoSystemText") == 0 || strcmp(familyName, "CupertinoSystemDisplay") == 0) { + // sk_sp font_style_set = + // font_provider_->MatchFamily(std::string(familyName) + "w" + std::to_string(style.weight())); + const std::string local_font_name = std::string(familyName) + "w200"; + sk_sp font_style_set = + font_provider_->MatchFamily(std::string(local_font_name)); + if (font_style_set == nullptr) + return nullptr; + return font_style_set->matchStyle(style); + // } +// #endif + // sk_sp font_style_set = + // font_provider_->MatchFamily(std::string(familyName)); + // if (font_style_set == nullptr) + // return nullptr; + // return font_style_set->matchStyle(style); } sk_sp AssetFontManager::onMatchFamilyStyleCharacter( diff --git a/third_party/txt/src/txt/font_collection.h b/third_party/txt/src/txt/font_collection.h index 08631bef8a142..32078414bf2ee 100644 --- a/third_party/txt/src/txt/font_collection.h +++ b/third_party/txt/src/txt/font_collection.h @@ -56,6 +56,7 @@ class FontCollection : public std::enable_shared_from_this { // Construct a Skia text layout FontCollection based on this collection. sk_sp CreateSktFontCollection(); + private: sk_sp default_font_manager_; sk_sp asset_font_manager_; diff --git a/third_party/txt/src/txt/platform_mac.mm b/third_party/txt/src/txt/platform_mac.mm index 257261ab0a5fe..f76c8a6437a5b 100644 --- a/third_party/txt/src/txt/platform_mac.mm +++ b/third_party/txt/src/txt/platform_mac.mm @@ -103,11 +103,14 @@ void RegisterSystemFonts(const DynamicFontManager& dynamic_font_manager) { dynamic_font_manager.font_provider().RegisterTypeface(large_system_font, kSFProDisplayName); } - sk_sp large_system_font_lightweight = SkMakeTypefaceFromCTFont( - (CTFontRef)CFAutorelease(MatchSystemUIFont(0, kSFProDisplayBreakPoint))); - if (large_system_font_lightweight) { - dynamic_font_manager.font_provider().RegisterTypeface( - large_system_font_lightweight, "CupertinoSystemDisplayw100"); + for (int i = 0; i < 9; i++) { + const int font_weight = i * 100; + sk_sp large_system_font_weighted = SkMakeTypefaceFromCTFont( + (CTFontRef)CFAutorelease(MatchSystemUIFont(font_weight, kSFProDisplayBreakPoint))); + if (large_system_font_weighted) { + dynamic_font_manager.font_provider().RegisterTypeface( + large_system_font_weighted, kSFProDisplayName + "w" + std::to_string(font_weight + 100)); + } } sk_sp regular_system_font = SkMakeTypefaceFromCTFont( (CTFontRef)CFAutorelease(CTFontCreateUIFontForLanguage( @@ -116,6 +119,15 @@ void RegisterSystemFonts(const DynamicFontManager& dynamic_font_manager) { dynamic_font_manager.font_provider().RegisterTypeface(regular_system_font, kSFProTextName); } + for (int i = 0; i < 9; i++) { + const int font_weight = i * 100; + sk_sp large_system_font_weighted = SkMakeTypefaceFromCTFont( + (CTFontRef)CFAutorelease(MatchSystemUIFont(font_weight, kSFProTextBreakPoint))); + if (large_system_font_weighted) { + dynamic_font_manager.font_provider().RegisterTypeface( + large_system_font_weighted, kSFProTextName + "w" + std::to_string(font_weight + 100)); + } + } } } // namespace txt From 2751004d583425c00553a8ba8d9f5c7fbd920126 Mon Sep 17 00:00:00 2001 From: Mitchell Goodwin Date: Tue, 12 Dec 2023 16:41:40 -0800 Subject: [PATCH 04/16] Formatting --- lib/ui/text/font_collection.h | 3 ++- third_party/txt/src/txt/asset_font_manager.cc | 21 ++++++++++--------- third_party/txt/src/txt/font_collection.h | 1 - third_party/txt/src/txt/platform_mac.mm | 16 ++++++++------ 4 files changed, 23 insertions(+), 18 deletions(-) diff --git a/lib/ui/text/font_collection.h b/lib/ui/text/font_collection.h index b268083b64fb9..59df1a0789544 100644 --- a/lib/ui/text/font_collection.h +++ b/lib/ui/text/font_collection.h @@ -34,7 +34,8 @@ class FontCollection { Dart_Handle callback, const std::string& family_name); - // sk_sp FontCollection::matchTypeface(const SkString& familyName, SkFontStyle fontStyle) override; + // sk_sp FontCollection::matchTypeface(const SkString& familyName, + // SkFontStyle fontStyle) override; private: std::shared_ptr collection_; diff --git a/third_party/txt/src/txt/asset_font_manager.cc b/third_party/txt/src/txt/asset_font_manager.cc index ffe42c881d19b..76059138bb53e 100644 --- a/third_party/txt/src/txt/asset_font_manager.cc +++ b/third_party/txt/src/txt/asset_font_manager.cc @@ -54,18 +54,19 @@ sk_sp AssetFontManager::onMatchFamily( sk_sp AssetFontManager::onMatchFamilyStyle( const char familyName[], const SkFontStyle& style) const { -// #if FML_OS_MACOSX || FML_OS_IOS - // if (strcmp(familyName, "CupertinoSystemText") == 0 || strcmp(familyName, "CupertinoSystemDisplay") == 0) { - // sk_sp font_style_set = - // font_provider_->MatchFamily(std::string(familyName) + "w" + std::to_string(style.weight())); - const std::string local_font_name = std::string(familyName) + "w200"; - sk_sp font_style_set = + // #if FML_OS_MACOSX || FML_OS_IOS + // if (strcmp(familyName, "CupertinoSystemText") == 0 || strcmp(familyName, + // "CupertinoSystemDisplay") == 0) { sk_sp font_style_set = + // font_provider_->MatchFamily(std::string(familyName) + "w" + + // std::to_string(style.weight())); + const std::string local_font_name = std::string(familyName) + "w200"; + sk_sp font_style_set = font_provider_->MatchFamily(std::string(local_font_name)); - if (font_style_set == nullptr) - return nullptr; - return font_style_set->matchStyle(style); + if (font_style_set == nullptr) + return nullptr; + return font_style_set->matchStyle(style); // } -// #endif + // #endif // sk_sp font_style_set = // font_provider_->MatchFamily(std::string(familyName)); // if (font_style_set == nullptr) diff --git a/third_party/txt/src/txt/font_collection.h b/third_party/txt/src/txt/font_collection.h index 32078414bf2ee..08631bef8a142 100644 --- a/third_party/txt/src/txt/font_collection.h +++ b/third_party/txt/src/txt/font_collection.h @@ -56,7 +56,6 @@ class FontCollection : public std::enable_shared_from_this { // Construct a Skia text layout FontCollection based on this collection. sk_sp CreateSktFontCollection(); - private: sk_sp default_font_manager_; sk_sp asset_font_manager_; diff --git a/third_party/txt/src/txt/platform_mac.mm b/third_party/txt/src/txt/platform_mac.mm index f76c8a6437a5b..47169b79a782f 100644 --- a/third_party/txt/src/txt/platform_mac.mm +++ b/third_party/txt/src/txt/platform_mac.mm @@ -105,11 +105,13 @@ void RegisterSystemFonts(const DynamicFontManager& dynamic_font_manager) { } for (int i = 0; i < 9; i++) { const int font_weight = i * 100; - sk_sp large_system_font_weighted = SkMakeTypefaceFromCTFont( - (CTFontRef)CFAutorelease(MatchSystemUIFont(font_weight, kSFProDisplayBreakPoint))); + sk_sp large_system_font_weighted = + SkMakeTypefaceFromCTFont((CTFontRef)CFAutorelease( + MatchSystemUIFont(font_weight, kSFProDisplayBreakPoint))); if (large_system_font_weighted) { dynamic_font_manager.font_provider().RegisterTypeface( - large_system_font_weighted, kSFProDisplayName + "w" + std::to_string(font_weight + 100)); + large_system_font_weighted, + kSFProDisplayName + "w" + std::to_string(font_weight + 100)); } } sk_sp regular_system_font = SkMakeTypefaceFromCTFont( @@ -121,11 +123,13 @@ void RegisterSystemFonts(const DynamicFontManager& dynamic_font_manager) { } for (int i = 0; i < 9; i++) { const int font_weight = i * 100; - sk_sp large_system_font_weighted = SkMakeTypefaceFromCTFont( - (CTFontRef)CFAutorelease(MatchSystemUIFont(font_weight, kSFProTextBreakPoint))); + sk_sp large_system_font_weighted = + SkMakeTypefaceFromCTFont((CTFontRef)CFAutorelease( + MatchSystemUIFont(font_weight, kSFProTextBreakPoint))); if (large_system_font_weighted) { dynamic_font_manager.font_provider().RegisterTypeface( - large_system_font_weighted, kSFProTextName + "w" + std::to_string(font_weight + 100)); + large_system_font_weighted, + kSFProTextName + "w" + std::to_string(font_weight + 100)); } } } From 70327ca535382c17f83e76adad52e07f49e070a4 Mon Sep 17 00:00:00 2001 From: Mitchell Goodwin Date: Wed, 3 Jan 2024 10:58:24 -0800 Subject: [PATCH 05/16] Register under one family name, remove extra code --- lib/ui/text.dart | 2 +- lib/ui/text/font_collection.h | 2 -- third_party/txt/src/txt/platform_mac.mm | 29 +------------------------ 3 files changed, 2 insertions(+), 31 deletions(-) diff --git a/lib/ui/text.dart b/lib/ui/text.dart index 0a16be26956d1..255b652526c35 100644 --- a/lib/ui/text.dart +++ b/lib/ui/text.dart @@ -1749,7 +1749,7 @@ class TextStyle { fontVariations, ), _leadingDistribution = leadingDistribution, - _fontFamily = _proxySystemFont(fontFamily, fontWeight) ?? '', + _fontFamily = fontFamily ?? '', _fontFamilyFallback = fontFamilyFallback, _fontSize = fontSize, _letterSpacing = letterSpacing, diff --git a/lib/ui/text/font_collection.h b/lib/ui/text/font_collection.h index 59df1a0789544..0c75f7eeca621 100644 --- a/lib/ui/text/font_collection.h +++ b/lib/ui/text/font_collection.h @@ -34,8 +34,6 @@ class FontCollection { Dart_Handle callback, const std::string& family_name); - // sk_sp FontCollection::matchTypeface(const SkString& familyName, - // SkFontStyle fontStyle) override; private: std::shared_ptr collection_; diff --git a/third_party/txt/src/txt/platform_mac.mm b/third_party/txt/src/txt/platform_mac.mm index 47169b79a782f..7d043e6710efe 100644 --- a/third_party/txt/src/txt/platform_mac.mm +++ b/third_party/txt/src/txt/platform_mac.mm @@ -20,8 +20,6 @@ // Apple system font larger than size 29 returns SFProDisplay typeface. static const CGFloat kSFProDisplayBreakPoint = 29; -// Apple system font smaller than size 16 returns SFProText typeface. -static const CGFloat kSFProTextBreakPoint = 16; // Font name represents the "SF Pro Display" system font on Apple platforms. static const std::string kSFProDisplayName = "CupertinoSystemDisplay"; // Font name represents the "SF Pro Text" system font on Apple platforms. @@ -96,13 +94,6 @@ void RegisterSystemFonts(const DynamicFontManager& dynamic_font_manager) { // // See https://www.wwdcnotes.com/notes/wwdc20/10175/ for Apple's document on // this topic. - sk_sp large_system_font = SkMakeTypefaceFromCTFont( - (CTFontRef)CFAutorelease(CTFontCreateUIFontForLanguage( - kCTFontUIFontSystem, kSFProDisplayBreakPoint, NULL))); - if (large_system_font) { - dynamic_font_manager.font_provider().RegisterTypeface(large_system_font, - kSFProDisplayName); - } for (int i = 0; i < 9; i++) { const int font_weight = i * 100; sk_sp large_system_font_weighted = @@ -111,25 +102,7 @@ void RegisterSystemFonts(const DynamicFontManager& dynamic_font_manager) { if (large_system_font_weighted) { dynamic_font_manager.font_provider().RegisterTypeface( large_system_font_weighted, - kSFProDisplayName + "w" + std::to_string(font_weight + 100)); - } - } - sk_sp regular_system_font = SkMakeTypefaceFromCTFont( - (CTFontRef)CFAutorelease(CTFontCreateUIFontForLanguage( - kCTFontUIFontSystem, kSFProTextBreakPoint, NULL))); - if (regular_system_font) { - dynamic_font_manager.font_provider().RegisterTypeface(regular_system_font, - kSFProTextName); - } - for (int i = 0; i < 9; i++) { - const int font_weight = i * 100; - sk_sp large_system_font_weighted = - SkMakeTypefaceFromCTFont((CTFontRef)CFAutorelease( - MatchSystemUIFont(font_weight, kSFProTextBreakPoint))); - if (large_system_font_weighted) { - dynamic_font_manager.font_provider().RegisterTypeface( - large_system_font_weighted, - kSFProTextName + "w" + std::to_string(font_weight + 100)); + kSFProDisplayName); } } } From ffc14b6846ec9c1778d569e352428fb13a3d4966 Mon Sep 17 00:00:00 2001 From: Mitchell Goodwin Date: Wed, 3 Jan 2024 10:59:25 -0800 Subject: [PATCH 06/16] formatting --- lib/ui/text/font_collection.h | 1 - third_party/txt/src/txt/platform_mac.mm | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/ui/text/font_collection.h b/lib/ui/text/font_collection.h index 0c75f7eeca621..9c8d41f3ba773 100644 --- a/lib/ui/text/font_collection.h +++ b/lib/ui/text/font_collection.h @@ -34,7 +34,6 @@ class FontCollection { Dart_Handle callback, const std::string& family_name); - private: std::shared_ptr collection_; sk_sp dynamic_font_manager_; diff --git a/third_party/txt/src/txt/platform_mac.mm b/third_party/txt/src/txt/platform_mac.mm index 7d043e6710efe..121e5702f0625 100644 --- a/third_party/txt/src/txt/platform_mac.mm +++ b/third_party/txt/src/txt/platform_mac.mm @@ -101,8 +101,7 @@ void RegisterSystemFonts(const DynamicFontManager& dynamic_font_manager) { MatchSystemUIFont(font_weight, kSFProDisplayBreakPoint))); if (large_system_font_weighted) { dynamic_font_manager.font_provider().RegisterTypeface( - large_system_font_weighted, - kSFProDisplayName); + large_system_font_weighted, kSFProDisplayName); } } } From 562afbebfe9d04cf745f5899b108ca8fad686744 Mon Sep 17 00:00:00 2001 From: Mitchell Goodwin Date: Wed, 3 Jan 2024 11:10:59 -0800 Subject: [PATCH 07/16] Remove unneeded code --- lib/ui/text.dart | 7 ------- third_party/txt/src/txt/asset_font_manager.cc | 15 +-------------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/lib/ui/text.dart b/lib/ui/text.dart index 255b652526c35..374011ea45c66 100644 --- a/lib/ui/text.dart +++ b/lib/ui/text.dart @@ -19,13 +19,6 @@ enum FontStyle { italic, } -String? _proxySystemFont(String? fontFamily, FontWeight? fontWeight) { - if (fontFamily != null && fontFamily == 'CupertinoSystemText' || fontFamily == 'CupertinoSystemDisplay') { - return fontFamily! + (fontWeight!= null ? fontWeight.toString().substring(11) :''); - } - return fontFamily; -} - /// The thickness of the glyphs used to draw the text. /// /// Fonts are typically weighted on a 9-point scale, which, for historical diff --git a/third_party/txt/src/txt/asset_font_manager.cc b/third_party/txt/src/txt/asset_font_manager.cc index 76059138bb53e..c9952e85e8dad 100644 --- a/third_party/txt/src/txt/asset_font_manager.cc +++ b/third_party/txt/src/txt/asset_font_manager.cc @@ -54,24 +54,11 @@ sk_sp AssetFontManager::onMatchFamily( sk_sp AssetFontManager::onMatchFamilyStyle( const char familyName[], const SkFontStyle& style) const { - // #if FML_OS_MACOSX || FML_OS_IOS - // if (strcmp(familyName, "CupertinoSystemText") == 0 || strcmp(familyName, - // "CupertinoSystemDisplay") == 0) { sk_sp font_style_set = - // font_provider_->MatchFamily(std::string(familyName) + "w" + - // std::to_string(style.weight())); - const std::string local_font_name = std::string(familyName) + "w200"; sk_sp font_style_set = - font_provider_->MatchFamily(std::string(local_font_name)); + font_provider_->MatchFamily(std::string(familyName)); if (font_style_set == nullptr) return nullptr; return font_style_set->matchStyle(style); - // } - // #endif - // sk_sp font_style_set = - // font_provider_->MatchFamily(std::string(familyName)); - // if (font_style_set == nullptr) - // return nullptr; - // return font_style_set->matchStyle(style); } sk_sp AssetFontManager::onMatchFamilyStyleCharacter( From 18c7e6d040a762d895243d3803b4cd2119bb88c8 Mon Sep 17 00:00:00 2001 From: Mitchell Goodwin Date: Wed, 3 Jan 2024 15:19:59 -0800 Subject: [PATCH 08/16] Adjust font weight --- third_party/txt/src/txt/platform_mac.mm | 28 ++++++++++++++++----- third_party/txt/tests/platform_mac_tests.cc | 5 +--- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/third_party/txt/src/txt/platform_mac.mm b/third_party/txt/src/txt/platform_mac.mm index 121e5702f0625..6fc14dda4fff1 100644 --- a/third_party/txt/src/txt/platform_mac.mm +++ b/third_party/txt/src/txt/platform_mac.mm @@ -22,8 +22,6 @@ static const CGFloat kSFProDisplayBreakPoint = 29; // Font name represents the "SF Pro Display" system font on Apple platforms. static const std::string kSFProDisplayName = "CupertinoSystemDisplay"; -// Font name represents the "SF Pro Text" system font on Apple platforms. -static const std::string kSFProTextName = "CupertinoSystemText"; // Font weight representing Regular float kNormalWeightValue = 400; @@ -85,8 +83,10 @@ void RegisterSystemFonts(const DynamicFontManager& dynamic_font_manager) { // than 17. The "familyName" property returned from CoreText stays the same // despite the typeface is different. // - // Below code manually loads and registers them as two different fonts - // so Flutter app can access them on macOS and iOS. + // Below code manually loads and registers the larger font. The existing fallback + // correctly loads the smaller font. The code also iterates through the possible + // font weights from 100 - 900 to correctly load all of them, as a CTFont object + // for the large system font does not include all of the font weights by default. // // Darwin system fonts from 17 to 28 also have dynamic spacing based on sizes. // These two fonts do not match the spacings when sizes are from 17 to 28. @@ -94,7 +94,7 @@ void RegisterSystemFonts(const DynamicFontManager& dynamic_font_manager) { // // See https://www.wwdcnotes.com/notes/wwdc20/10175/ for Apple's document on // this topic. - for (int i = 0; i < 9; i++) { + for (int i = 0; i < 8; i++) { const int font_weight = i * 100; sk_sp large_system_font_weighted = SkMakeTypefaceFromCTFont((CTFontRef)CFAutorelease( @@ -104,6 +104,22 @@ void RegisterSystemFonts(const DynamicFontManager& dynamic_font_manager) { large_system_font_weighted, kSFProDisplayName); } } -} + // The value 780 returns a font weight of 800. + sk_sp large_system_font_weighted_800 = + SkMakeTypefaceFromCTFont((CTFontRef)CFAutorelease( + MatchSystemUIFont(780, kSFProDisplayBreakPoint))); + if (large_system_font_weighted_800) { + dynamic_font_manager.font_provider().RegisterTypeface( + large_system_font_weighted_800, kSFProDisplayName); + } + // The value of 810 returns a font weight of 900. + sk_sp large_system_font_weighted_900 = + SkMakeTypefaceFromCTFont((CTFontRef)CFAutorelease( + MatchSystemUIFont(810, kSFProDisplayBreakPoint))); + if (large_system_font_weighted_900) { + dynamic_font_manager.font_provider().RegisterTypeface( + large_system_font_weighted_900, kSFProDisplayName); + } + } } // namespace txt diff --git a/third_party/txt/tests/platform_mac_tests.cc b/third_party/txt/tests/platform_mac_tests.cc index 54cea1c1324a1..ffb9edadd99f6 100644 --- a/third_party/txt/tests/platform_mac_tests.cc +++ b/third_party/txt/tests/platform_mac_tests.cc @@ -21,13 +21,10 @@ class PlatformMacTests : public ::testing::Test { TEST_F(PlatformMacTests, RegisterSystemFonts) { DynamicFontManager dynamic_font_manager; RegisterSystemFonts(dynamic_font_manager); - ASSERT_EQ(dynamic_font_manager.font_provider().GetFamilyCount(), 2ul); + ASSERT_EQ(dynamic_font_manager.font_provider().GetFamilyCount(), 1ul); ASSERT_NE(dynamic_font_manager.font_provider().MatchFamily( "CupertinoSystemDisplay"), nullptr); - ASSERT_NE( - dynamic_font_manager.font_provider().MatchFamily("CupertinoSystemText"), - nullptr); } } // namespace testing From bab6f200db6c9662d184a0121bcdc3b9f2dd7729 Mon Sep 17 00:00:00 2001 From: Mitchell Goodwin Date: Wed, 3 Jan 2024 15:20:50 -0800 Subject: [PATCH 09/16] Formatting --- third_party/txt/src/txt/platform_mac.mm | 35 ++++++++++++------------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/third_party/txt/src/txt/platform_mac.mm b/third_party/txt/src/txt/platform_mac.mm index 6fc14dda4fff1..3a0e3f0010dc2 100644 --- a/third_party/txt/src/txt/platform_mac.mm +++ b/third_party/txt/src/txt/platform_mac.mm @@ -83,10 +83,11 @@ void RegisterSystemFonts(const DynamicFontManager& dynamic_font_manager) { // than 17. The "familyName" property returned from CoreText stays the same // despite the typeface is different. // - // Below code manually loads and registers the larger font. The existing fallback - // correctly loads the smaller font. The code also iterates through the possible - // font weights from 100 - 900 to correctly load all of them, as a CTFont object - // for the large system font does not include all of the font weights by default. + // Below code manually loads and registers the larger font. The existing + // fallback correctly loads the smaller font. The code also iterates through + // the possible font weights from 100 - 900 to correctly load all of them, as + // a CTFont object for the large system font does not include all of the font + // weights by default. // // Darwin system fonts from 17 to 28 also have dynamic spacing based on sizes. // These two fonts do not match the spacings when sizes are from 17 to 28. @@ -105,21 +106,19 @@ void RegisterSystemFonts(const DynamicFontManager& dynamic_font_manager) { } } // The value 780 returns a font weight of 800. - sk_sp large_system_font_weighted_800 = - SkMakeTypefaceFromCTFont((CTFontRef)CFAutorelease( - MatchSystemUIFont(780, kSFProDisplayBreakPoint))); - if (large_system_font_weighted_800) { - dynamic_font_manager.font_provider().RegisterTypeface( - large_system_font_weighted_800, kSFProDisplayName); - } + sk_sp large_system_font_weighted_800 = SkMakeTypefaceFromCTFont(( + CTFontRef)CFAutorelease(MatchSystemUIFont(780, kSFProDisplayBreakPoint))); + if (large_system_font_weighted_800) { + dynamic_font_manager.font_provider().RegisterTypeface( + large_system_font_weighted_800, kSFProDisplayName); + } // The value of 810 returns a font weight of 900. - sk_sp large_system_font_weighted_900 = - SkMakeTypefaceFromCTFont((CTFontRef)CFAutorelease( - MatchSystemUIFont(810, kSFProDisplayBreakPoint))); - if (large_system_font_weighted_900) { - dynamic_font_manager.font_provider().RegisterTypeface( - large_system_font_weighted_900, kSFProDisplayName); - } + sk_sp large_system_font_weighted_900 = SkMakeTypefaceFromCTFont(( + CTFontRef)CFAutorelease(MatchSystemUIFont(810, kSFProDisplayBreakPoint))); + if (large_system_font_weighted_900) { + dynamic_font_manager.font_provider().RegisterTypeface( + large_system_font_weighted_900, kSFProDisplayName); } +} } // namespace txt From c163e5e04c82de6be8b57dacac947e9f29fde963 Mon Sep 17 00:00:00 2001 From: Mitchell Goodwin Date: Wed, 3 Jan 2024 15:53:49 -0800 Subject: [PATCH 10/16] Add check for 9 font counts --- third_party/txt/tests/platform_mac_tests.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/third_party/txt/tests/platform_mac_tests.cc b/third_party/txt/tests/platform_mac_tests.cc index ffb9edadd99f6..76e5de7032faf 100644 --- a/third_party/txt/tests/platform_mac_tests.cc +++ b/third_party/txt/tests/platform_mac_tests.cc @@ -25,6 +25,8 @@ TEST_F(PlatformMacTests, RegisterSystemFonts) { ASSERT_NE(dynamic_font_manager.font_provider().MatchFamily( "CupertinoSystemDisplay"), nullptr); + ASSERT_EQ(dynamic_font_manager.font_provider().MatchFamily( + "CupertinoSystemDisplay")->count(), 9ul); } } // namespace testing From 41de08dbd14c89732c26f5b16930655236fd9ed8 Mon Sep 17 00:00:00 2001 From: Mitchell Goodwin Date: Wed, 3 Jan 2024 15:58:41 -0800 Subject: [PATCH 11/16] Formatting --- third_party/txt/tests/platform_mac_tests.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/third_party/txt/tests/platform_mac_tests.cc b/third_party/txt/tests/platform_mac_tests.cc index 76e5de7032faf..780533e9b225a 100644 --- a/third_party/txt/tests/platform_mac_tests.cc +++ b/third_party/txt/tests/platform_mac_tests.cc @@ -25,8 +25,10 @@ TEST_F(PlatformMacTests, RegisterSystemFonts) { ASSERT_NE(dynamic_font_manager.font_provider().MatchFamily( "CupertinoSystemDisplay"), nullptr); - ASSERT_EQ(dynamic_font_manager.font_provider().MatchFamily( - "CupertinoSystemDisplay")->count(), 9ul); + ASSERT_EQ(dynamic_font_manager.font_provider() + .MatchFamily("CupertinoSystemDisplay") + ->count(), + 9ul); } } // namespace testing From 47caba541bc24431e84ae9a31a39cb67e9bf437f Mon Sep 17 00:00:00 2001 From: Mitchell Goodwin Date: Wed, 3 Jan 2024 16:10:55 -0800 Subject: [PATCH 12/16] Convert to int --- tools/font-subset/gen/1.ttf | Bin 0 -> 1024 bytes tools/font-subset/gen/1variable.ttf | Bin 0 -> 5172 bytes tools/font-subset/gen/2.ttf | Bin 0 -> 1132 bytes tools/font-subset/gen/2variable.ttf | Bin 0 -> 7856 bytes tools/font-subset/gen/3.ttf | Bin 0 -> 1224 bytes tools/font-subset/gen/3variable.ttf | Bin 0 -> 10320 bytes 6 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 tools/font-subset/gen/1.ttf create mode 100644 tools/font-subset/gen/1variable.ttf create mode 100644 tools/font-subset/gen/2.ttf create mode 100644 tools/font-subset/gen/2variable.ttf create mode 100644 tools/font-subset/gen/3.ttf create mode 100644 tools/font-subset/gen/3variable.ttf diff --git a/tools/font-subset/gen/1.ttf b/tools/font-subset/gen/1.ttf new file mode 100644 index 0000000000000000000000000000000000000000..afeb7c4051d87864742ebdb6a3988b9137b06741 GIT binary patch literal 1024 zcmaJ0bjhtaHT1L=>Ce$0bvGIslF|h6HdQG)^;)~lN}xrJ70X*IeHRz+0rElm zt0m7_jz_<`tZ&jUlo(JXS*Cx2{?SsUu_@a~5`UmZ%T?EbMFe~ie#P0W;U>Njf2V3| zPQ@GgY29c4hwO2;R;@SMk6;qVL|$-X^CWC~LV{irIm!@w%6JXIOduBdv2mR8BVr3m z`+?~94`ID1>ae0?rvww=zek!@_-QE6cq;tpw-j>m?V&$@Ua+7>K0kgn^yXIL!VcoW zl#jo*Cz%1yX|mdtAuDuaAqjTmN>9+m;yG!BnW^yHK^A-+8C~H{#{rB0$3~7@`E+#5I-(9x^8@N(Ys?xg2sJaRn#rgVQrU$; zMc4JG#_kIvpGys=a(N@0OlCjXwyo=isv4{2Y5L3GYHI zVHnRtER(~t5JxbNi4ZFtce*eLJ&Z?*fU9uOfQNP5CMshFE~;2V9Xa;!P{bWZ9p)GO zTXo(Oc@1azU!0+}aK(=_{BxZZ9-?6Y~^8e~Db9N0| zKK~+0+(pa|cxjkown|22ayrS(44J!Rrr{D}WuEigC#b9Yp2y9_Yi!Uii$DJ_Luipt literal 0 HcmV?d00001 diff --git a/tools/font-subset/gen/1variable.ttf b/tools/font-subset/gen/1variable.ttf new file mode 100644 index 0000000000000000000000000000000000000000..0efa2a0315b0ebb6a3207abedf06f9b72d7deee6 GIT binary patch literal 5172 zcma)9U2I&{5uS7Z@9ui-wRi2cW0Q?-(w2}P5+~3STE_`7l?=Ax7*I(ACJsrcL#)Km zzyr#6TORy*UsXRbit%9{C!Hw76^?HBq?(H|{uGeW%QNN^AxxVU1bRT(22976BI~1h4nMwdtSi& z<>J{tVzbA<&z%~*FoCfF^F0`?Q{%6`@YI2(B9RVW>^KGeKfLwc14K6V^!@(y$#yKMMVQry($>)IUM@GWhP(XD2Ue&xzCE_p`n6b0tTz(V!_k%az74DnwXg>!_!gZ-$ zou-fIDjsgU59d-9SE*A@3-P@D5ieLegtN zikxkf?|>Hx&Xt>j&bx>4W(#3HZ;Toq@Cgm^$oJ-woaY#^>UWLD$L4lCTfcwFQasNR zksBXkh7v9BZ-b9-sUNE!fHmX}Ji+VOF4U(b*-O1Lth;h1YyM;8lfT}2d-i!=5*ev~ z;=Z@Lx6759IxT)lI?HP{-6vF`aN}8&QnmFD4)%-bgqDB>7J6^bKXqDiG1>-R(0A!+ zLIqH;;yuUEiQXW2FQNc=rnnpY{@$@(Wa!Z0fuj^0ADw&&t7Wc{NvU`K#P}px(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a=r+;4~H=JF5)GRb83+zns$MmG3aCY4MiKK<~+PZNn`D)U(; z95%@ef0m(OkTS9WV06t9sgrgu@L%{}-XTd}E}3Ykj1#Fc&KS`{qn&?izko!{sS*QGFsVNpasAtUD3nU2^1=>*_Ae~>n>so=nywi7R_V6h zmP}>>ZF({pK;)WwFZTI~db_FV_L}OJne<*<-YOnN*`$_*;+6}=VyTSAKcZE`B)5$J zBSgGI)$zYTxvZ*&W%>MmpJf?1n|!gDM`o0cc3E%UVJRBlAe<9sus!Hd!7LTXM4+~1 zmhuQ}Ic^yRos;P}?Wy@vI+Ya};T8(%LctZ8Qk`jMP)NEWr0LZ|!3BlYRkxc|=_&zq*Hl9NXT6)dZeU0htuUb&_T{2%Ma zh09f`WV5&h@E&v~69@!gIRo0Qt8??|beh-NHX{9{|=L2G$<});|(cTBGodp#j-NtDqaoLWpQBkd_!7t%c7Lp1BabThFJp&ZMHW z-3^j~$ZdCnVn*T?_HhFQ!{=Jit0sWFEj1w*h}+U!jhEe9fm)%|g4j6zLj<-qY{1qj zzDjEfekE28p2Kdx3zU*X()PPRsE436Qn&)0s?v5h+yrd4-3>JXnrn_(o{IP4>nWl& z(Tc$;S`(=ls3Ku`BI`j)Rl*y=iHt&cBPaor9Wl>Y)~tZsq; literal 0 HcmV?d00001 diff --git a/tools/font-subset/gen/2.ttf b/tools/font-subset/gen/2.ttf new file mode 100644 index 0000000000000000000000000000000000000000..21a46926ee704c753231e60b1b3a8b823cf8bf4d GIT binary patch literal 1132 zcmaJ=&rj1}7=GH7F&r=lD|3^CI)s?ksjPHF4nXh<}k zz35-yNiQC~m~b?agNYKkn9Q5uWTM>6=JRzWSq$;(-tT?h-_Q58g9M-xoAAJ%xp6kJ zH~uFNNbl%f$Q09Mbk=Uso~AvTS*>aaO5?=a6eX9glp76J0-q?pTw#6b%LYA=kI~-E zXVZ%v-ftP!Z_-ZY=};tDrhSU`$$YW8Cfisd-lg~orA!)QC=l0#T}-c)aR=Xte^9jL zbTNDUm-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W-Vm-#9M4txva;HMPFdO)d1)W&*1s7Kbigs=sjsxsOOH$mD)d!c5F zxNR<*x0i2|N8Gxhl_YLmk*ZDHwu2NCw+?V(;?@aDAZ~I~H&04{ybX85AtrFc-7u&{ z;sU$j!4Hl{veJn>OyatLPK(5~W7NVMCUG4&!z6Ai!1yF?Fun~}m;zmmZ3Pvkaq(@C J!aR=X{{VSop^r^3Vd)*oZOxI zJpA((pq^1XnVZQLt7Fw+%6BObg>e?{mZxv=2^Gp({-y+=(E+*!wTuRib4n}>hGkfGBw}>iX?yRW zP^#T9+S?7k6>jY5R~aYnIPvSrwMx<%2zQ1DoF@~}p6KU<IxoLbCo*QlT|^szZ;*3n2s~A3E0B+Ko?2YVmGYciwz0tbocwct0XJv7EC2ui literal 0 HcmV?d00001 diff --git a/tools/font-subset/gen/3variable.ttf b/tools/font-subset/gen/3variable.ttf new file mode 100644 index 0000000000000000000000000000000000000000..214cf3997a56c057ba1ad08c56c078c90f34a289 GIT binary patch literal 10320 zcmbtaYiu0Xbv}1yc4l{Hx!fnYq$qnyDH3JLwqlY}9NQ@+J5pRImSRb6&^U@2OO~wY z1xrqtpa{66gxIJX6j9K$Kz^_(^NWR$Ux9xV0aGNde+U6;xUpcX#lkj7N!dzEa^H{H ze&^2Ya!Kym4m!l0xsP+soO|xM-~DDK5=0cjO{4h!!$;iPX*LeeEmH?Rl1V z(s3eDK>P87haY}q^vC;uNu>M^?H3Lo*>mJa=~sUN`F}D}moWZD`Rp~k>;l@UlVcb88GwBrcb`1-{g=cvGEJ^fcR&$pGP}>ZtU!dXCAn6m&k>-I&k6q#Y?1Ogv8(Q_=Q(aTsWn_ zaRu!iXd7>e+Ld2ve}^WCT8%o@IeME8;cwdcW7TJAoPJL=aYXzB2QGE4mZ@db>+5X56AUZ=61w~I?{$5v^YN@(u{Dy>58qZEWlF4iO3f)bH6zJ3Bjv zsU`anAxf(D^Zq1yb&Ru?OKPwsxH>00M`=_}wQb8_$^Sa~hu`0sUHCSuM2~h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9ME(VGBp0iWiOu}WsFtWL z|4QGhE~j&C_?M)1D~sabWy9^TDybq4gr)+fP<0EJk6_-_R!^Oy*a2sB=4Hsj;cFE{sa|5R8WNab? zcou8fSkw}ga&;XYn`xqBGfi}CriqTtG|{n{COS6LM8{^D=-5mX9h+&QV>3;3Y^I5h zLAOE28f@$+&VU0r1NMWBeFJB}(Iz%_poxt=;jl3~$h^9B+QT^=YX#Ca8*7Enl8s4H zzLH|iCKaW(9VCO5^|pgz{?_eo3Bg#lR?sWiS$9jw1wWHisF73+s1-^ph)v-CgaBIu z>#%i_w^CEW*D(%$%4%O5D7A@NUmFOu$y$pL)}d2XdfVY9NLz0^)T|S?m1*5O{-zU57HxA zSdTnR;#z=Coy0X_RL2`8aqDn~N!)6HaY$S^v<6q00!;*0g9_8Q&>Bc#9!K Date: Wed, 3 Jan 2024 16:11:05 -0800 Subject: [PATCH 13/16] Convert to int --- third_party/txt/tests/platform_mac_tests.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/txt/tests/platform_mac_tests.cc b/third_party/txt/tests/platform_mac_tests.cc index 780533e9b225a..8e3ed174b55a4 100644 --- a/third_party/txt/tests/platform_mac_tests.cc +++ b/third_party/txt/tests/platform_mac_tests.cc @@ -28,7 +28,7 @@ TEST_F(PlatformMacTests, RegisterSystemFonts) { ASSERT_EQ(dynamic_font_manager.font_provider() .MatchFamily("CupertinoSystemDisplay") ->count(), - 9ul); + 9); } } // namespace testing From a3f3346d2ee8584a4c12b5c3f23dbe6e70a45bda Mon Sep 17 00:00:00 2001 From: Mitchell Goodwin Date: Wed, 3 Jan 2024 16:17:51 -0800 Subject: [PATCH 14/16] Revert "Convert to int" This reverts commit 47caba541bc24431e84ae9a31a39cb67e9bf437f. --- tools/font-subset/gen/1.ttf | Bin 1024 -> 0 bytes tools/font-subset/gen/1variable.ttf | Bin 5172 -> 0 bytes tools/font-subset/gen/2.ttf | Bin 1132 -> 0 bytes tools/font-subset/gen/2variable.ttf | Bin 7856 -> 0 bytes tools/font-subset/gen/3.ttf | Bin 1224 -> 0 bytes tools/font-subset/gen/3variable.ttf | Bin 10320 -> 0 bytes 6 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 tools/font-subset/gen/1.ttf delete mode 100644 tools/font-subset/gen/1variable.ttf delete mode 100644 tools/font-subset/gen/2.ttf delete mode 100644 tools/font-subset/gen/2variable.ttf delete mode 100644 tools/font-subset/gen/3.ttf delete mode 100644 tools/font-subset/gen/3variable.ttf diff --git a/tools/font-subset/gen/1.ttf b/tools/font-subset/gen/1.ttf deleted file mode 100644 index afeb7c4051d87864742ebdb6a3988b9137b06741..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1024 zcmaJ0bjhtaHT1L=>Ce$0bvGIslF|h6HdQG)^;)~lN}xrJ70X*IeHRz+0rElm zt0m7_jz_<`tZ&jUlo(JXS*Cx2{?SsUu_@a~5`UmZ%T?EbMFe~ie#P0W;U>Njf2V3| zPQ@GgY29c4hwO2;R;@SMk6;qVL|$-X^CWC~LV{irIm!@w%6JXIOduBdv2mR8BVr3m z`+?~94`ID1>ae0?rvww=zek!@_-QE6cq;tpw-j>m?V&$@Ua+7>K0kgn^yXIL!VcoW zl#jo*Cz%1yX|mdtAuDuaAqjTmN>9+m;yG!BnW^yHK^A-+8C~H{#{rB0$3~7@`E+#5I-(9x^8@N(Ys?xg2sJaRn#rgVQrU$; zMc4JG#_kIvpGys=a(N@0OlCjXwyo=isv4{2Y5L3GYHI zVHnRtER(~t5JxbNi4ZFtce*eLJ&Z?*fU9uOfQNP5CMshFE~;2V9Xa;!P{bWZ9p)GO zTXo(Oc@1azU!0+}aK(=_{BxZZ9-?6Y~^8e~Db9N0| zKK~+0+(pa|cxjkown|22ayrS(44J!Rrr{D}WuEigC#b9Yp2y9_Yi!Uii$DJ_Luipt diff --git a/tools/font-subset/gen/1variable.ttf b/tools/font-subset/gen/1variable.ttf deleted file mode 100644 index 0efa2a0315b0ebb6a3207abed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-NHX{9{|=L2G$<});|(cTBGodp#j-NtDqaoLWpQBkd_!7t%c7Lp1BabThFJp&ZMHW z-3^j~$ZdCnVn*T?_HhFQ!{=Jit0sWFEj1w*h}+U!jhEe9fm)%|g4j6zLj<-qY{1qj zzDjEfekE28p2Kdx3zU*X()PPRsE436Qn&)0s?v5h+yrd4-3>JXnrn_(o{IP4>nWl& z(Tc$;S`(=ls3Ku`BI`j)Rl*y=iHt&cBPaor9Wl>Y)~tZsq; diff --git a/tools/font-subset/gen/2.ttf b/tools/font-subset/gen/2.ttf deleted file mode 100644 index 21a46926ee704c753231e60b1b3a8b823cf8bf4d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1132 zcmaJ=&rj1}7=GH7F&r=lD|3^CI)s?ksjPHF4nXh<}k zz35-yNiQC~m~b?agNYKkn9Q5uWTM>6=JRzWSq$;(-tT?h-_Q58g9M-xoAAJ%xp6kJ zH~uFNNbl%f$Q09Mbk=Uso~AvTS*>aaO5?=a6eX9glp76J0-q?pTw#6b%LYA=kI~-E zXVZ%v-ftP!Z_-ZY=};tDrhSU`$$YW8Cfisd-lg~orA!)QC=l0#T}-c)aR=Xte^9jL zbTNDUm-UGKf3nBJa;Z{nJVS!mC*m$Qi44S$AZ(=QhtpG>(}TAV%-Db;@d0zr2#0eD zs>T!1?~uh@QPi@F>eeM}ks|IR#9i1SDA1@CKD29!xSg7((HN*ZalwM(`RbkjFmpF> zaUUJcDW89DUtt8)*T||aLsn?|ToUXkLwb%j7Eep!1}9v-j|iR$B5i_)yN(`!1HD=E z)Yw6+=I*j-#x)q^Z$p)~q#gJ%fFWSW8ng!0LDf`ED;!o&SYy^`Qb?jtRr~tXb~EIS z4NECow{87#yuKN?M?(Ff5&QkkNG!5v*fxK&@o+f4Vb1yk-Jwu-z&~s51fx-LKPec} z8|fpwID&4(I4?GAvE>+thAHMDBPH}i=A(+P>o1J@Yr~B9^!LO~BN7Zoc2cR7t{bXq z+)qsT16{qnT><};^J?31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gen/3variable.ttf b/tools/font-subset/gen/3variable.ttf deleted file mode 100644 index 214cf3997a56c057ba1ad08c56c078c90f34a289..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10320 zcmbtaYiu0Xbv}1yc4l{Hx!fnYq$qnyDH3JLwqlY}9NQ@+J5pRImSRb6&^U@2OO~wY z1xrqtpa{66gxIJX6j9K$Kz^_(^NWR$Ux9xV0aGNde+U6;xUpcX#lkj7N!dzEa^H{H ze&^2Ya!Kym4m!l0xsP+soO|xM-~DDK5=0cjO{4h!!$;iPX*LeeEmH?Rl1V z(s3eDK>P87haY}q^vC;uNu>M^?H3Lo*>mJa=~sUN`F}D}moWZD`Rp~k>;l@UlVcb88GwBrcb`1-{g=cvGEJ^fcR&$pGP}>ZtU!dXCAn6m&k>-I&k6q#Y?1Ogv8(Q_=Q(aTsWn_ zaRu!iXd7>e+Ld2ve}^WCT8%o@IeME8;cwdcW7TJAoPJL=aYXzB2QGE4mZ@db>+5X56AUZ=61w~I?{$5v^YN@(u{Dy>58qZEWlF4iO3f)bH6zJ3Bjv zsU`anAxf(D^Zq1yb&Ru?OKPwsxH>00M`=_}wQb8_$^Sa~hu`0sUHCSuM2~hp^T6!p z2c@Q_&WXQ=-8PrYD^#KI#R5pT#Tp93lUiu}kNmE#rsSNV!*DJadWMkY*jtiM|_k z9_1%n5i-Vh+yr{rLWHnOX_%CKPainI!uy}y^OS(>`3o0+AQV!*ckeq`xWwwNvE#T5%G{y*Jv-LoVts8=^dx8BNKmW*AXr^ zz2VdaGQzQg^^ehMr(Z=@9&_p%SqE{K4FP$Q|h?<{Y3tr|yLv zx$`v-GRKFOEyFdUN065n=n_3c=jjzXOJm5oy{MnTS{WwIBNUQa|VB3g~TPa zUqPGwIZWTj8^0~Rx=07{{!8d(`|QtyK=BjsoNF!5P$pWv2}J=Tm3YDS9`y9?w{`ClbGiP%!8w4uL#e1rz{UT zwIRe|Kjh9s;tb*w$66hrClQ%A{`R2n44%(6EL@bW6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*0g9_8Q&>Bc#9!K Date: Thu, 4 Jan 2024 09:19:31 -0800 Subject: [PATCH 15/16] Update test, move logic to lambda --- third_party/txt/src/txt/platform_mac.mm | 32 ++++++++------------- third_party/txt/tests/platform_mac_tests.cc | 2 +- 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/third_party/txt/src/txt/platform_mac.mm b/third_party/txt/src/txt/platform_mac.mm index 3a0e3f0010dc2..bfe59f429929d 100644 --- a/third_party/txt/src/txt/platform_mac.mm +++ b/third_party/txt/src/txt/platform_mac.mm @@ -83,11 +83,10 @@ void RegisterSystemFonts(const DynamicFontManager& dynamic_font_manager) { // than 17. The "familyName" property returned from CoreText stays the same // despite the typeface is different. // - // Below code manually loads and registers the larger font. The existing - // fallback correctly loads the smaller font. The code also iterates through - // the possible font weights from 100 - 900 to correctly load all of them, as - // a CTFont object for the large system font does not include all of the font - // weights by default. + // Below code manually loads and registers the larger font. The existing fallback + // correctly loads the smaller font. The code also iterates through the possible + // font weights from 100 - 900 to correctly load all of them, as a CTFont object + // for the large system font does not include all of the font weights by default. // // Darwin system fonts from 17 to 28 also have dynamic spacing based on sizes. // These two fonts do not match the spacings when sizes are from 17 to 28. @@ -95,30 +94,23 @@ void RegisterSystemFonts(const DynamicFontManager& dynamic_font_manager) { // // See https://www.wwdcnotes.com/notes/wwdc20/10175/ for Apple's document on // this topic. - for (int i = 0; i < 8; i++) { - const int font_weight = i * 100; + auto register_weighted_font = [&dynamic_font_manager](const int weight) { sk_sp large_system_font_weighted = SkMakeTypefaceFromCTFont((CTFontRef)CFAutorelease( - MatchSystemUIFont(font_weight, kSFProDisplayBreakPoint))); + MatchSystemUIFont(weight, kSFProDisplayBreakPoint))); if (large_system_font_weighted) { dynamic_font_manager.font_provider().RegisterTypeface( large_system_font_weighted, kSFProDisplayName); } + }; + for (int i = 0; i < 8; i++) { + const int font_weight = i * 100; + register_weighted_font(font_weight); } // The value 780 returns a font weight of 800. - sk_sp large_system_font_weighted_800 = SkMakeTypefaceFromCTFont(( - CTFontRef)CFAutorelease(MatchSystemUIFont(780, kSFProDisplayBreakPoint))); - if (large_system_font_weighted_800) { - dynamic_font_manager.font_provider().RegisterTypeface( - large_system_font_weighted_800, kSFProDisplayName); - } + register_weighted_font(780); // The value of 810 returns a font weight of 900. - sk_sp large_system_font_weighted_900 = SkMakeTypefaceFromCTFont(( - CTFontRef)CFAutorelease(MatchSystemUIFont(810, kSFProDisplayBreakPoint))); - if (large_system_font_weighted_900) { - dynamic_font_manager.font_provider().RegisterTypeface( - large_system_font_weighted_900, kSFProDisplayName); - } + register_weighted_font(810); } } // namespace txt diff --git a/third_party/txt/tests/platform_mac_tests.cc b/third_party/txt/tests/platform_mac_tests.cc index 8e3ed174b55a4..5ede81394ecdc 100644 --- a/third_party/txt/tests/platform_mac_tests.cc +++ b/third_party/txt/tests/platform_mac_tests.cc @@ -28,7 +28,7 @@ TEST_F(PlatformMacTests, RegisterSystemFonts) { ASSERT_EQ(dynamic_font_manager.font_provider() .MatchFamily("CupertinoSystemDisplay") ->count(), - 9); + 10); } } // namespace testing From 0b6fc08b989614938b2bd4ec061240b7897be1a4 Mon Sep 17 00:00:00 2001 From: Mitchell Goodwin Date: Thu, 4 Jan 2024 09:24:17 -0800 Subject: [PATCH 16/16] Formatting --- third_party/txt/src/txt/platform_mac.mm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/third_party/txt/src/txt/platform_mac.mm b/third_party/txt/src/txt/platform_mac.mm index bfe59f429929d..6cec1dcf68838 100644 --- a/third_party/txt/src/txt/platform_mac.mm +++ b/third_party/txt/src/txt/platform_mac.mm @@ -83,10 +83,11 @@ void RegisterSystemFonts(const DynamicFontManager& dynamic_font_manager) { // than 17. The "familyName" property returned from CoreText stays the same // despite the typeface is different. // - // Below code manually loads and registers the larger font. The existing fallback - // correctly loads the smaller font. The code also iterates through the possible - // font weights from 100 - 900 to correctly load all of them, as a CTFont object - // for the large system font does not include all of the font weights by default. + // Below code manually loads and registers the larger font. The existing + // fallback correctly loads the smaller font. The code also iterates through + // the possible font weights from 100 - 900 to correctly load all of them, as + // a CTFont object for the large system font does not include all of the font + // weights by default. // // Darwin system fonts from 17 to 28 also have dynamic spacing based on sizes. // These two fonts do not match the spacings when sizes are from 17 to 28.