Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
TestEmptyTypeface.h
Go to the documentation of this file.
1/*
2 * Copyright 2018 The Android Open Source Project
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 TestEmptyTypeface_DEFINED
9#define TestEmptyTypeface_DEFINED
10
15
17public:
19
20protected:
22
23 std::unique_ptr<SkStreamAsset> onOpenStream(int* ttcIndex) const override { return nullptr; }
25 return sk_ref_sp(this);
26 }
27 std::unique_ptr<SkScalerContext> onCreateScalerContext(
28 const SkScalerContextEffects& effects, const SkDescriptor* desc) const override
29 {
31 sk_ref_sp(const_cast<TestEmptyTypeface*>(this)), effects, desc);
32 }
33 void onFilterRec(SkScalerContextRec*) const override {}
34 std::unique_ptr<SkAdvancedTypefaceMetrics> onGetAdvancedMetrics() const override {
35 return nullptr;
36 }
37 void onGetFontDescriptor(SkFontDescriptor*, bool*) const override {}
38 void onCharsToGlyphs(const SkUnichar* chars, int count, SkGlyphID glyphs[]) const override {
39 sk_bzero(glyphs, count * sizeof(glyphs[0]));
40 }
41 int onCountGlyphs() const override { return 0; }
42 void getPostScriptGlyphNames(SkString*) const override {}
43 void getGlyphToUnicodeMap(SkUnichar*) const override {}
44 int onGetUPEM() const override { return 0; }
46 public:
47 bool next(SkTypeface::LocalizedString*) override { return false; }
48 };
49 void onGetFamilyName(SkString* familyName) const override { familyName->reset(); }
50 bool onGetPostScriptName(SkString*) const override { return false; }
54 bool onGlyphMaskNeedsCurrentColor() const override { return false; }
56 int coordinateCount) const override {
57 return 0;
58 }
60 int parameterCount) const override {
61 return 0;
62 }
63 int onGetTableTags(SkFontTableTag tags[]) const override { return 0; }
64 size_t onGetTableData(SkFontTableTag, size_t, size_t, void*) const override { return 0; }
65};
66
67#endif // TestEmptyTypeface_DEFINED
uint16_t glyphs[5]
int count
static void sk_bzero(void *buffer, size_t size)
Definition SkMalloc.h:105
sk_sp< T > sk_ref_sp(T *obj)
Definition SkRefCnt.h:381
uint32_t SkFontTableTag
Definition SkTypeface.h:41
int32_t SkUnichar
Definition SkTypes.h:175
uint16_t SkGlyphID
Definition SkTypes.h:179
static std::unique_ptr< SkScalerContext > MakeEmpty(sk_sp< SkTypeface > typeface, const SkScalerContextEffects &effects, const SkDescriptor *desc)
void reset()
Definition SkString.cpp:358
bool next(SkTypeface::LocalizedString *) override
sk_sp< SkTypeface > onMakeClone(const SkFontArguments &args) const override
size_t onGetTableData(SkFontTableTag, size_t, size_t, void *) const override
void onGetFontDescriptor(SkFontDescriptor *, bool *) const override
static sk_sp< SkTypeface > Make()
std::unique_ptr< SkStreamAsset > onOpenStream(int *ttcIndex) const override
int onGetTableTags(SkFontTableTag tags[]) const override
void getPostScriptGlyphNames(SkString *) const override
std::unique_ptr< SkAdvancedTypefaceMetrics > onGetAdvancedMetrics() const override
int onGetVariationDesignPosition(SkFontArguments::VariationPosition::Coordinate coordinates[], int coordinateCount) const override
std::unique_ptr< SkScalerContext > onCreateScalerContext(const SkScalerContextEffects &effects, const SkDescriptor *desc) const override
bool onGetPostScriptName(SkString *) const override
int onGetVariationDesignParameters(SkFontParameters::Variation::Axis parameters[], int parameterCount) const override
int onCountGlyphs() const override
void onGetFamilyName(SkString *familyName) const override
int onGetUPEM() const override
void getGlyphToUnicodeMap(SkUnichar *) const override
bool onGlyphMaskNeedsCurrentColor() const override
SkTypeface::LocalizedStrings * onCreateFamilyNameIterator() const override
void onCharsToGlyphs(const SkUnichar *chars, int count, SkGlyphID glyphs[]) const override
void onFilterRec(SkScalerContextRec *) const override
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args