Flutter Engine
The Flutter Engine
SkFontConfigTypeface.h
Go to the documentation of this file.
1/*
2 * Copyright 2013 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
8#ifndef SkFontConfigTypeface_DEFINED
9#define SkFontConfigTypeface_DEFINED
10
17
19
23 SkString fFamilyName;
24
25public:
28 SkString familyName,
29 const SkFontStyle& style)
30 {
31 return new SkTypeface_FCI(std::move(fci), fi, std::move(familyName), style);
32 }
33
35 return fIdentity;
36 }
37
39 SkFontStyle style = this->fontStyle();
40 std::unique_ptr<SkFontData> data = this->cloneFontData(args, &style);
41 if (!data) {
42 return nullptr;
43 }
45 std::move(data), fFamilyName, style, this->isFixedPitch()));
46 }
47
48protected:
51 SkString familyName,
52 const SkFontStyle& style)
53 : INHERITED(style, false)
54 , fFCI(std::move(fci))
55 , fIdentity(fi)
56 , fFamilyName(std::move(familyName)) {}
57
58 void onGetFamilyName(SkString* familyName) const override { *familyName = fFamilyName; }
59 void onGetFontDescriptor(SkFontDescriptor*, bool*) const override;
60 std::unique_ptr<SkStreamAsset> onOpenStream(int* ttcIndex) const override;
61 std::unique_ptr<SkFontData> onMakeFontData() const override;
62
63private:
64 using INHERITED = SkTypeface_FreeType;
65};
66
67#endif // SkFontConfigTypeface_DEFINED
const SkFontConfigInterface::FontIdentity & getIdentity() const
void onGetFamilyName(SkString *familyName) const override
void onGetFontDescriptor(SkFontDescriptor *, bool *) const override
std::unique_ptr< SkStreamAsset > onOpenStream(int *ttcIndex) const override
sk_sp< SkTypeface > onMakeClone(const SkFontArguments &args) const override
std::unique_ptr< SkFontData > onMakeFontData() const override
static SkTypeface_FCI * Create(sk_sp< SkFontConfigInterface > fci, const SkFontConfigInterface::FontIdentity &fi, SkString familyName, const SkFontStyle &style)
SkTypeface_FCI(sk_sp< SkFontConfigInterface > fci, const SkFontConfigInterface::FontIdentity &fi, SkString familyName, const SkFontStyle &style)
std::unique_ptr< SkFontData > cloneFontData(const SkFontArguments &, SkFontStyle *style) const
SkTypeface_FreeType(const SkFontStyle &style, bool isFixedPitch)
SkFontStyle fontStyle() const
Definition: SkTypeface.h:55
bool isFixedPitch() const
Definition: SkTypeface.h:68
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
Definition: ref_ptr.h:256
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63