Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
SkFontMgr_fuchsia.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2018 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
9
10#include <fuchsia/fonts/cpp/fidl.h>
11#include <lib/zx/vmar.h>
12#include <strings.h>
13#include <memory>
14#include <unordered_map>
15
18
24
25using namespace skia_private;
26
27// SkFuchsiaFontDataCache keep track of SkData created from `fuchsia::mem::Buffer` where each buffer
28// is identified with a unique identifier. It allows to share the same SkData instances between all
29// SkTypeface instances created from the same buffer.
31public:
33 ~SkFuchsiaFontDataCache() { SkASSERT(fBuffers.empty()); }
34
35 sk_sp<SkData> GetOrCreateSkData(int bufferId, const fuchsia::mem::Buffer& buffer);
36
37private:
38 struct ReleaseSkDataContext {
40 int fBufferId;
41 };
42
43 static void ReleaseSkData(const void* buffer, void* context);
44 void OnBufferDeleted(int bufferId);
45
46 SkMutex fMutex;
47 std::unordered_map<int, SkData*> fBuffers SK_GUARDED_BY(fMutex);
48};
49
51 const fuchsia::mem::Buffer& buffer) {
52 SkAutoMutexExclusive mutexLock(fMutex);
53
54 auto iter = fBuffers.find(bufferId);
55 if (iter != fBuffers.end()) {
56 return sk_ref_sp(iter->second);
57 }
58 auto font_mgr = sk_ref_sp(this);
59
60 uint64_t size = buffer.size;
61 uintptr_t mapped_addr = 0;
62 zx_status_t status =
63 zx::vmar::root_self()->map(ZX_VM_PERM_READ, 0, buffer.vmo, 0, size, &mapped_addr);
64 if (status != ZX_OK) return nullptr;
65
66 auto context = new ReleaseSkDataContext{sk_ref_sp(this), bufferId};
67 auto data = SkData::MakeWithProc(
68 reinterpret_cast<void*>(mapped_addr), size, ReleaseSkData, context);
69 SkASSERT(data);
70
71 fBuffers[bufferId] = data.get();
72 return data;
73}
74
75void SkFuchsiaFontDataCache::OnBufferDeleted(int bufferId) {
76 zx_vaddr_t unmap_addr;
77 size_t unmap_size;
78 {
79 SkAutoMutexExclusive mutexLock(fMutex);
80 auto it = fBuffers.find(bufferId);
81 SkASSERT(it != fBuffers.end());
82 unmap_addr = reinterpret_cast<zx_vaddr_t>(it->second->data());
83 unmap_size = it->second->size();
84 fBuffers.erase(it);
85 }
86
87 zx::vmar::root_self()->unmap(unmap_addr, unmap_size);
88}
89
90// static
91void SkFuchsiaFontDataCache::ReleaseSkData(const void* buffer, void* context) {
92 auto releaseSkDataContext = reinterpret_cast<ReleaseSkDataContext*>(context);
93 releaseSkDataContext->fCache->OnBufferDeleted(releaseSkDataContext->fBufferId);
94 delete releaseSkDataContext;
95}
96
97fuchsia::fonts::Slant SkToFuchsiaSlant(SkFontStyle::Slant slant) {
98 switch (slant) {
100 return fuchsia::fonts::Slant::OBLIQUE;
102 return fuchsia::fonts::Slant::ITALIC;
104 default:
105 return fuchsia::fonts::Slant::UPRIGHT;
106 }
107}
108
109SkFontStyle::Slant FuchsiaToSkSlant(fuchsia::fonts::Slant slant) {
110 switch (slant) {
111 case fuchsia::fonts::Slant::OBLIQUE:
113 case fuchsia::fonts::Slant::ITALIC:
115 case fuchsia::fonts::Slant::UPRIGHT:
116 default:
118 }
119}
120
122 switch (width) {
124 return fuchsia::fonts::Width::ULTRA_CONDENSED;
126 return fuchsia::fonts::Width::EXTRA_CONDENSED;
128 return fuchsia::fonts::Width::CONDENSED;
130 return fuchsia::fonts::Width::SEMI_CONDENSED;
132 return fuchsia::fonts::Width::NORMAL;
134 return fuchsia::fonts::Width::SEMI_EXPANDED;
136 return fuchsia::fonts::Width::EXPANDED;
138 return fuchsia::fonts::Width::EXTRA_EXPANDED;
140 return fuchsia::fonts::Width::ULTRA_EXPANDED;
141 }
142}
143
144// Tries to convert the given integer Skia style width value to the Fuchsia equivalent.
145//
146// On success, returns true. On failure, returns false, and `outFuchsiaWidth` is left untouched.
147bool SkToFuchsiaWidth(int skWidth, fuchsia::fonts::Width* outFuchsiaWidth) {
150 return false;
151 }
152 auto typedSkWidth = static_cast<SkFontStyle::Width>(skWidth);
153 *outFuchsiaWidth = SkToFuchsiaWidth(typedSkWidth);
154 return true;
155}
156
158 switch (width) {
159 case fuchsia::fonts::Width::ULTRA_CONDENSED:
161 case fuchsia::fonts::Width::EXTRA_CONDENSED:
163 case fuchsia::fonts::Width::CONDENSED:
165 case fuchsia::fonts::Width::SEMI_CONDENSED:
167 case fuchsia::fonts::Width::NORMAL:
169 case fuchsia::fonts::Width::SEMI_EXPANDED:
171 case fuchsia::fonts::Width::EXPANDED:
173 case fuchsia::fonts::Width::EXTRA_EXPANDED:
175 case fuchsia::fonts::Width::ULTRA_EXPANDED:
177 }
178}
179
180fuchsia::fonts::Style2 SkToFuchsiaStyle(const SkFontStyle& style) {
181 fuchsia::fonts::Style2 fuchsiaStyle;
182 fuchsiaStyle.set_slant(SkToFuchsiaSlant(style.slant())).set_weight(style.weight());
183
184 fuchsia::fonts::Width fuchsiaWidth = fuchsia::fonts::Width::NORMAL;
185 if (SkToFuchsiaWidth(style.width(), &fuchsiaWidth)) {
186 fuchsiaStyle.set_width(fuchsiaWidth);
187 }
188
189 return fuchsiaStyle;
190}
191
192constexpr struct {
193 const char* fName;
194 fuchsia::fonts::GenericFontFamily fGenericFontFamily;
195} kGenericFontFamiliesByName[] = {{"serif", fuchsia::fonts::GenericFontFamily::SERIF},
196 {"sans", fuchsia::fonts::GenericFontFamily::SANS_SERIF},
197 {"sans-serif", fuchsia::fonts::GenericFontFamily::SANS_SERIF},
198 {"mono", fuchsia::fonts::GenericFontFamily::MONOSPACE},
199 {"monospace", fuchsia::fonts::GenericFontFamily::MONOSPACE},
200 {"cursive", fuchsia::fonts::GenericFontFamily::CURSIVE},
201 {"fantasy", fuchsia::fonts::GenericFontFamily::FANTASY},
202 {"system-ui", fuchsia::fonts::GenericFontFamily::SYSTEM_UI},
203 {"emoji", fuchsia::fonts::GenericFontFamily::EMOJI},
204 {"math", fuchsia::fonts::GenericFontFamily::MATH},
205 {"fangsong", fuchsia::fonts::GenericFontFamily::FANGSONG}};
206
207// Tries to find a generic font family with the given name. If none is found, returns false.
209 fuchsia::fonts::GenericFontFamily* outGenericFamily) {
210 if (!name) return false;
211 for (auto& genericFamily : kGenericFontFamiliesByName) {
212 if (strcasecmp(genericFamily.fName, name) == 0) {
213 *outGenericFamily = genericFamily.fGenericFontFamily;
214 return true;
215 }
216 }
217 return false;
218}
219
221 uint32_t bufferId;
222 uint32_t ttcIndex;
223
224 bool operator==(TypefaceId& other) const {
225 return std::tie(bufferId, ttcIndex) == std::tie(other.bufferId, other.ttcIndex);
226 }
227}
228
229constexpr kNullTypefaceId = {0xFFFFFFFF, 0xFFFFFFFF};
230
232public:
233 SkTypeface_Fuchsia(std::unique_ptr<SkFontData> fontData, const SkFontStyle& style,
234 bool isFixedPitch, const SkString familyName, TypefaceId id)
235 : SkTypeface_FreeTypeStream(std::move(fontData), familyName, style, isFixedPitch)
236 , fId(id) {}
237
238 TypefaceId id() { return fId; }
239
240private:
241 TypefaceId fId;
242};
243
244sk_sp<SkTypeface> CreateTypefaceFromSkStream(std::unique_ptr<SkStreamAsset> stream,
245 const SkFontArguments& args, TypefaceId id) {
246 SkFontScanner_FreeType fontScanner;
247 int numInstances;
248 if (!fontScanner.scanFace(stream.get(), args.getCollectionIndex(), &numInstances)) {
249 return nullptr;
250 }
251 bool isFixedPitch;
252 SkFontStyle style;
254 SkFontScanner::AxisDefinitions axisDefinitions;
255 if (!fontScanner.scanInstance(stream.get(),
256 args.getCollectionIndex(),
257 0,
258 &name,
259 &style,
260 &isFixedPitch,
261 &axisDefinitions)) {
262 return nullptr;
263 }
264
265 const SkFontArguments::VariationPosition position = args.getVariationDesignPosition();
266 AutoSTMalloc<4, SkFixed> axisValues(axisDefinitions.size());
267 SkFontScanner_FreeType::computeAxisValues(axisDefinitions, position, axisValues, name, &style);
268
269 auto fontData = std::make_unique<SkFontData>(
270 std::move(stream), args.getCollectionIndex(), args.getPalette().index,
271 axisValues.get(), axisDefinitions.size(),
272 args.getPalette().overrides, args.getPalette().overrideCount);
273 return sk_make_sp<SkTypeface_Fuchsia>(std::move(fontData), style, isFixedPitch, name, id);
274}
275
277 return CreateTypefaceFromSkStream(std::make_unique<SkMemoryStream>(std::move(data)),
278 SkFontArguments().setCollectionIndex(id.ttcIndex), id);
279}
280
281class SkFontMgr_Fuchsia final : public SkFontMgr {
282public:
283 SkFontMgr_Fuchsia(fuchsia::fonts::ProviderSyncPtr provider);
285
286protected:
287 // SkFontMgr overrides.
288 int onCountFamilies() const override;
289 void onGetFamilyName(int index, SkString* familyName) const override;
290 sk_sp<SkFontStyleSet> onMatchFamily(const char familyName[]) const override;
291 sk_sp<SkFontStyleSet> onCreateStyleSet(int index) const override;
292 sk_sp<SkTypeface> onMatchFamilyStyle(const char familyName[], const SkFontStyle&) const override;
293 sk_sp<SkTypeface> onMatchFamilyStyleCharacter(const char familyName[], const SkFontStyle&,
294 const char* bcp47[], int bcp47Count,
295 SkUnichar character) const override;
296 sk_sp<SkTypeface> onMakeFromData(sk_sp<SkData>, int ttcIndex) const override;
297 sk_sp<SkTypeface> onMakeFromStreamIndex(std::unique_ptr<SkStreamAsset>,
298 int ttcIndex) const override;
299 sk_sp<SkTypeface> onMakeFromStreamArgs(std::unique_ptr<SkStreamAsset>,
300 const SkFontArguments&) const override;
301 sk_sp<SkTypeface> onMakeFromFile(const char path[], int ttcIndex) const override;
302 sk_sp<SkTypeface> onLegacyMakeTypeface(const char familyName[], SkFontStyle) const override;
303
304private:
306
307 sk_sp<SkTypeface> FetchTypeface(const char familyName[], const SkFontStyle& style,
308 const char* bcp47[], int bcp47Count, SkUnichar character,
309 bool allow_fallback, bool exact_style_match) const;
310
311 sk_sp<SkTypeface> GetOrCreateTypeface(TypefaceId id, const fuchsia::mem::Buffer& buffer) const;
312
313 mutable fuchsia::fonts::ProviderSyncPtr fFontProvider;
314
316
317 mutable SkMutex fCacheMutex;
318 mutable SkTypefaceCache fTypefaceCache SK_GUARDED_BY(fCacheMutex);
319};
320
322public:
323 SkFontStyleSet_Fuchsia(sk_sp<SkFontMgr_Fuchsia> font_manager, std::string familyName,
324 std::vector<SkFontStyle> styles)
325 : fFontManager(font_manager), fFamilyName(familyName), fStyles(styles) {}
326
327 ~SkFontStyleSet_Fuchsia() override = default;
328
329 int count() override { return fStyles.size(); }
330
331 void getStyle(int index, SkFontStyle* style, SkString* styleName) override {
332 SkASSERT(index >= 0 && index < static_cast<int>(fStyles.size()));
333 if (style) *style = fStyles[index];
334
335 // We don't have style names. Return an empty name.
336 if (styleName) styleName->reset();
337 }
338
339 sk_sp<SkTypeface> createTypeface(int index) override {
340 SkASSERT(index >= 0 && index < static_cast<int>(fStyles.size()));
341
342 if (fTypefaces.empty()) fTypefaces.resize(fStyles.size());
343
344 if (!fTypefaces[index]) {
345 fTypefaces[index] = fFontManager->FetchTypeface(
346 fFamilyName.c_str(), fStyles[index], /*bcp47=*/nullptr,
347 /*bcp47Count=*/0, /*character=*/0,
348 /*allow_fallback=*/false, /*exact_style_match=*/true);
349 }
350
351 return fTypefaces[index];
352 }
353
354 sk_sp<SkTypeface> matchStyle(const SkFontStyle& pattern) override {
355 return matchStyleCSS3(pattern);
356 }
357
358private:
359 sk_sp<SkFontMgr_Fuchsia> fFontManager;
360 std::string fFamilyName;
361 std::vector<SkFontStyle> fStyles;
362 std::vector<sk_sp<SkTypeface>> fTypefaces;
363};
364
365SkFontMgr_Fuchsia::SkFontMgr_Fuchsia(fuchsia::fonts::ProviderSyncPtr provider)
366 : fFontProvider(std::move(provider)), fBufferCache(sk_make_sp<SkFuchsiaFontDataCache>()) {}
367
369
371 // Family enumeration is not supported.
372 return 0;
373}
374
375void SkFontMgr_Fuchsia::onGetFamilyName(int index, SkString* familyName) const {
376 // Family enumeration is not supported.
377 familyName->reset();
378}
379
381 // Family enumeration is not supported.
382 return nullptr;
383}
384
386 fuchsia::fonts::FamilyName typedFamilyName;
387 typedFamilyName.name = familyName;
388
389 fuchsia::fonts::FontFamilyInfo familyInfo;
390 int result = fFontProvider->GetFontFamilyInfo(typedFamilyName, &familyInfo);
391 if (result != ZX_OK || !familyInfo.has_styles() || familyInfo.styles().empty()) return nullptr;
392
393 std::vector<SkFontStyle> styles;
394 for (auto& style : familyInfo.styles()) {
395 styles.push_back(SkFontStyle(style.weight(), FuchsiaToSkWidth(style.width()),
396 FuchsiaToSkSlant(style.slant())));
397 }
398
400 new SkFontStyleSet_Fuchsia(sk_ref_sp(this), familyInfo.name().name, std::move(styles)));
401}
402
404 const SkFontStyle& style) const {
405 return FetchTypeface(familyName, style, /*bcp47=*/nullptr, /*bcp47Count=*/0, /*character=*/0,
406 /*allow_fallback=*/false, /*exact_style_match=*/false);
407}
408
410 const char familyName[], const SkFontStyle& style,
411 const char* bcp47[], int bcp47Count,
412 SkUnichar character) const
413{
414 return FetchTypeface(familyName, style, bcp47, bcp47Count, character,
415 /*allow_fallback=*/true, /*exact_style_match=*/false);
416}
417
419 return makeFromStream(std::make_unique<SkMemoryStream>(std::move(data)), ttcIndex);
420}
421
423 int ttcIndex) const {
424 return makeFromStream(std::move(asset), SkFontArguments().setCollectionIndex(ttcIndex));
425}
426
428 const SkFontArguments& args) const {
429 return CreateTypefaceFromSkStream(std::move(asset), args, kNullTypefaceId);
430}
431
432sk_sp<SkTypeface> SkFontMgr_Fuchsia::onMakeFromFile(const char path[], int ttcIndex) const {
433 return makeFromStream(std::make_unique<SkFILEStream>(path), ttcIndex);
434}
435
437 SkFontStyle style) const {
438 return sk_sp<SkTypeface>(matchFamilyStyle(familyName, style));
439}
440
441sk_sp<SkTypeface> SkFontMgr_Fuchsia::FetchTypeface(const char familyName[],
442 const SkFontStyle& style, const char* bcp47[],
443 int bcp47Count, SkUnichar character,
444 bool allow_fallback,
445 bool exact_style_match) const {
446 fuchsia::fonts::TypefaceQuery query;
447 query.set_style(SkToFuchsiaStyle(style));
448
449 if (bcp47Count > 0) {
450 std::vector<fuchsia::intl::LocaleId> languages{};
451 for (int i = 0; i < bcp47Count; i++) {
452 fuchsia::intl::LocaleId localeId;
453 localeId.id = bcp47[i];
454 languages.push_back(localeId);
455 }
456 query.set_languages(std::move(languages));
457 }
458
459 if (character) {
460 query.set_code_points({static_cast<uint32_t>(character)});
461 }
462
463 // If family name is not specified or is a generic family name (e.g. "serif"), then enable
464 // fallback; otherwise, pass the family name as is.
465 fuchsia::fonts::GenericFontFamily genericFontFamily =
466 fuchsia::fonts::GenericFontFamily::SANS_SERIF;
467 bool isGenericFontFamily = GetGenericFontFamilyByName(familyName, &genericFontFamily);
468 if (!familyName || *familyName == '\0' || isGenericFontFamily) {
469 if (isGenericFontFamily) {
470 query.set_fallback_family(genericFontFamily);
471 }
472 allow_fallback = true;
473 } else {
474 fuchsia::fonts::FamilyName typedFamilyName{};
475 typedFamilyName.name = familyName;
476 query.set_family(typedFamilyName);
477 }
478
479 fuchsia::fonts::TypefaceRequestFlags flags{};
480 if (!allow_fallback) flags |= fuchsia::fonts::TypefaceRequestFlags::EXACT_FAMILY;
481 if (exact_style_match) flags |= fuchsia::fonts::TypefaceRequestFlags::EXACT_STYLE;
482
483 fuchsia::fonts::TypefaceRequest request;
484 request.set_query(std::move(query));
485 request.set_flags(flags);
486
487 fuchsia::fonts::TypefaceResponse response;
488 int result = fFontProvider->GetTypeface(std::move(request), &response);
489 if (result != ZX_OK) return nullptr;
490
491 // The service may return an empty response if there is no font matching the request.
492 if (response.IsEmpty()) return nullptr;
493
494 return GetOrCreateTypeface(TypefaceId{response.buffer_id(), response.font_index()},
495 response.buffer());
496}
497
498static bool FindByTypefaceId(SkTypeface* cachedTypeface, void* ctx) {
499 SkTypeface_Fuchsia* cachedFuchsiaTypeface = static_cast<SkTypeface_Fuchsia*>(cachedTypeface);
500 TypefaceId* id = static_cast<TypefaceId*>(ctx);
501
502 return cachedFuchsiaTypeface->id() == *id;
503}
504
505sk_sp<SkTypeface> SkFontMgr_Fuchsia::GetOrCreateTypeface(TypefaceId id,
506 const fuchsia::mem::Buffer& buffer) const {
507 SkAutoMutexExclusive mutexLock(fCacheMutex);
508
509 sk_sp<SkTypeface> cached = fTypefaceCache.findByProcAndRef(FindByTypefaceId, &id);
510 if (cached) return cached;
511
512 sk_sp<SkData> data = fBufferCache->GetOrCreateSkData(id.bufferId, buffer);
513 if (!data) return nullptr;
514
515 auto result = CreateTypefaceFromSkData(std::move(data), id);
516 fTypefaceCache.add(result);
517 return result;
518}
519
520sk_sp<SkFontMgr> SkFontMgr_New_Fuchsia(fuchsia::fonts::ProviderSyncPtr provider) {
521 return sk_make_sp<SkFontMgr_Fuchsia>(std::move(provider));
522}
#define SkASSERT(cond)
Definition SkAssert.h:116
static bool FindByTypefaceId(SkTypeface *cachedTypeface, void *ctx)
constexpr struct @426 kGenericFontFamiliesByName[]
struct TypefaceId kNullTypefaceId
sk_sp< SkFontMgr > SkFontMgr_New_Fuchsia(fuchsia::fonts::ProviderSyncPtr provider)
SkFontStyle::Slant FuchsiaToSkSlant(fuchsia::fonts::Slant slant)
sk_sp< SkTypeface > CreateTypefaceFromSkStream(std::unique_ptr< SkStreamAsset > stream, const SkFontArguments &args, TypefaceId id)
fuchsia::fonts::GenericFontFamily fGenericFontFamily
bool GetGenericFontFamilyByName(const char *name, fuchsia::fonts::GenericFontFamily *outGenericFamily)
fuchsia::fonts::Slant SkToFuchsiaSlant(SkFontStyle::Slant slant)
sk_sp< SkTypeface > CreateTypefaceFromSkData(sk_sp< SkData > data, TypefaceId id)
fuchsia::fonts::Style2 SkToFuchsiaStyle(const SkFontStyle &style)
const char * fName
SkFontStyle::Width FuchsiaToSkWidth(fuchsia::fonts::Width width)
fuchsia::fonts::Width SkToFuchsiaWidth(SkFontStyle::Width width)
sk_sp< T > sk_make_sp(Args &&... args)
Definition SkRefCnt.h:371
sk_sp< T > sk_ref_sp(T *obj)
Definition SkRefCnt.h:381
#define SK_GUARDED_BY(x)
int32_t SkUnichar
Definition SkTypes.h:175
static sk_sp< SkData > MakeWithProc(const void *ptr, size_t length, ReleaseProc proc, void *ctx)
Definition SkData.cpp:128
~SkFontMgr_Fuchsia() override
friend class SkFontStyleSet_Fuchsia
sk_sp< SkFontStyleSet > onMatchFamily(const char familyName[]) const override
sk_sp< SkTypeface > onMakeFromStreamArgs(std::unique_ptr< SkStreamAsset >, const SkFontArguments &) const override
void onGetFamilyName(int index, SkString *familyName) const override
SkFontMgr_Fuchsia(fuchsia::fonts::ProviderSyncPtr provider)
sk_sp< SkTypeface > onMatchFamilyStyle(const char familyName[], const SkFontStyle &) const override
int onCountFamilies() const override
sk_sp< SkFontStyleSet > onCreateStyleSet(int index) const override
sk_sp< SkTypeface > onMakeFromStreamIndex(std::unique_ptr< SkStreamAsset >, int ttcIndex) const override
sk_sp< SkTypeface > onMakeFromData(sk_sp< SkData >, int ttcIndex) const override
sk_sp< SkTypeface > onMatchFamilyStyleCharacter(const char familyName[], const SkFontStyle &, const char *bcp47[], int bcp47Count, SkUnichar character) const override
sk_sp< SkTypeface > onLegacyMakeTypeface(const char familyName[], SkFontStyle) const override
sk_sp< SkTypeface > onMakeFromFile(const char path[], int ttcIndex) const override
sk_sp< SkTypeface > makeFromStream(std::unique_ptr< SkStreamAsset >, int ttcIndex=0) const
sk_sp< SkTypeface > matchFamilyStyle(const char familyName[], const SkFontStyle &) const
bool scanFace(SkStreamAsset *stream, int faceIndex, int *numInstances) const override
static void computeAxisValues(AxisDefinitions axisDefinitions, const SkFontArguments::VariationPosition position, SkFixed *axisValues, const SkString &name, SkFontStyle *style, const SkFontArguments::VariationPosition::Coordinate *currentPosition=nullptr)
bool scanInstance(SkStreamAsset *stream, int faceIndex, int instanceIndex, SkString *name, SkFontStyle *style, bool *isFixedPitch, AxisDefinitions *axes) const override
void getStyle(int index, SkFontStyle *style, SkString *styleName) override
SkFontStyleSet_Fuchsia(sk_sp< SkFontMgr_Fuchsia > font_manager, std::string familyName, std::vector< SkFontStyle > styles)
sk_sp< SkTypeface > matchStyle(const SkFontStyle &pattern) override
~SkFontStyleSet_Fuchsia() override=default
sk_sp< SkTypeface > createTypeface(int index) override
sk_sp< SkTypeface > matchStyleCSS3(const SkFontStyle &pattern)
Slant slant() const
Definition SkFontStyle.h:64
int width() const
Definition SkFontStyle.h:63
int weight() const
Definition SkFontStyle.h:62
@ kExtraExpanded_Width
Definition SkFontStyle.h:40
@ kExtraCondensed_Width
Definition SkFontStyle.h:34
@ kSemiCondensed_Width
Definition SkFontStyle.h:36
@ kUltraExpanded_Width
Definition SkFontStyle.h:41
@ kSemiExpanded_Width
Definition SkFontStyle.h:38
@ kUltraCondensed_Width
Definition SkFontStyle.h:33
sk_sp< SkData > GetOrCreateSkData(int bufferId, const fuchsia::mem::Buffer &buffer)
SkFuchsiaFontDataCache()=default
void reset()
Definition SkString.cpp:358
SkTypeface_Fuchsia(std::unique_ptr< SkFontData > fontData, const SkFontStyle &style, bool isFixedPitch, const SkString familyName, TypefaceId id)
bool isFixedPitch() const
Definition SkTypeface.h:68
int size() const
Definition SkTArray.h:416
FlutterSemanticsFlag flags
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
static const uint8_t buffer[]
GAsyncResult * result
const char * name
Definition fuchsia.cc:50
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition switches.h:41
Definition ref_ptr.h:256
int32_t width
bool operator==(TypefaceId &other) const
const uintptr_t id