5#include <TargetConditionals.h>
7#include "flutter/fml/platform/darwin/cf_utils.h"
8#include "flutter/fml/platform/darwin/platform_version.h"
14#if TARGET_OS_EMBEDDED || TARGET_OS_SIMULATOR
15#include <UIKit/UIKit.h>
16#define FONT_CLASS UIFont
18#include <AppKit/AppKit.h>
19#define FONT_CLASS NSFont
35 return {[
FONT_CLASS systemFontOfSize:14].familyName.UTF8String};
48 CTFontCreateUIFontForLanguage(kCTFontUIFontSystem,
size,
nullptr));
55 kCFAllocatorDefault, 1, &kCFTypeDictionaryKeyCallBacks,
56 &kCFTypeDictionaryValueCallBacks));
58 auto add_axis_to_variations = [&variations](
const FourCharCode tag,
61 if (desired_value != normal_value) {
63 CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &tag));
65 kCFAllocatorDefault, kCFNumberFloatType, &desired_value));
66 CFDictionarySetValue(variations, tag_number, value_number);
72 kCFAllocatorDefault, 1, &kCFTypeDictionaryKeyCallBacks,
73 &kCFTypeDictionaryValueCallBacks));
74 CFDictionarySetValue(attributes, kCTFontVariationAttribute, variations);
77 CTFontDescriptorCreateWithAttributes(attributes));
80 CTFontCreateCopyWithAttributes(ct_font,
size,
nullptr, var_font_desc));
100 auto register_weighted_font = [&dynamic_font_manager](
const int weight) {
103 if (large_system_font_weighted) {
108 for (
int i = 0;
i < 8;
i++) {
109 const int font_weight =
i * 100;
110 register_weighted_font(font_weight);
113 register_weighted_font(780);
115 register_weighted_font(810);
SK_API sk_sp< SkFontMgr > SkFontMgr_New_CoreText(CTFontCollectionRef)
TypefaceFontAssetProvider & font_provider() const
void RegisterTypeface(sk_sp< SkTypeface > typeface)
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
bool IsPlatformVersionAtLeast(size_t major, size_t minor=0, size_t patch=0)
const FourCharCode kWeightTag
std::vector< std::string > GetDefaultFontFamilies()
sk_sp< SkFontMgr > GetDefaultFontManager(uint32_t font_initialization_data)
void RegisterSystemFonts(const DynamicFontManager &dynamic_font_manager)
fml::CFRef< CTFontRef > MatchSystemUIFont(float desired_weight, float size)