Flutter Engine
The Flutter Engine
third_party
skia
tools
fonts
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
11
#include "
include/core/SkStream.h
"
12
#include "
include/core/SkTypeface.h
"
13
#include "
src/core/SkAdvancedTypefaceMetrics.h
"
14
#include "
src/core/SkScalerContext.h
"
15
16
class
TestEmptyTypeface
:
public
SkTypeface
{
17
public
:
18
static
sk_sp<SkTypeface>
Make
() {
return
sk_sp<SkTypeface>
(
new
TestEmptyTypeface
); }
19
20
protected
:
21
TestEmptyTypeface
() :
SkTypeface
(
SkFontStyle
(),
true
) {}
22
23
std::unique_ptr<SkStreamAsset>
onOpenStream
(
int
* ttcIndex)
const override
{
return
nullptr
; }
24
sk_sp<SkTypeface>
onMakeClone
(
const
SkFontArguments
&
args
)
const override
{
25
return
sk_ref_sp
(
this
);
26
}
27
std::unique_ptr<SkScalerContext>
onCreateScalerContext
(
28
const
SkScalerContextEffects
& effects,
const
SkDescriptor
*
desc
)
const override
29
{
30
return
SkScalerContext::MakeEmpty
(
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; }
45
class
EmptyLocalizedStrings
:
public
SkTypeface::LocalizedStrings
{
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
; }
51
SkTypeface::LocalizedStrings
*
onCreateFamilyNameIterator
()
const override
{
52
return
new
EmptyLocalizedStrings
;
53
}
54
bool
onGlyphMaskNeedsCurrentColor
()
const override
{
return
false
; }
55
int
onGetVariationDesignPosition
(
SkFontArguments::VariationPosition::Coordinate
coordinates[],
56
int
coordinateCount)
const override
{
57
return
0;
58
}
59
int
onGetVariationDesignParameters
(
SkFontParameters::Variation::Axis
parameters[],
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
sk_bzero
sk_bzero(glyphs, sizeof(glyphs))
glyphs
uint16_t glyphs[5]
Definition:
FontMgrTest.cpp:46
count
int count
Definition:
FontMgrTest.cpp:50
SkAdvancedTypefaceMetrics.h
sk_ref_sp
sk_sp< T > sk_ref_sp(T *obj)
Definition:
SkRefCnt.h:381
SkScalerContext.h
SkStream.h
SkTypeface.h
SkFontTableTag
uint32_t SkFontTableTag
Definition:
SkTypeface.h:41
SkUnichar
int32_t SkUnichar
Definition:
SkTypes.h:175
SkGlyphID
uint16_t SkGlyphID
Definition:
SkTypes.h:179
SkDescriptor
Definition:
SkDescriptor.h:25
SkFontDescriptor
Definition:
SkFontDescriptor.h:85
SkFontStyle
Definition:
SkFontStyle.h:16
SkScalerContext::MakeEmpty
static std::unique_ptr< SkScalerContext > MakeEmpty(sk_sp< SkTypeface > typeface, const SkScalerContextEffects &effects, const SkDescriptor *desc)
Definition:
SkScalerContext.cpp:1280
SkString
Definition:
SkString.h:118
SkString::reset
void reset()
Definition:
SkString.cpp:358
SkTypeface::LocalizedStrings
Definition:
SkTypeface.h:257
SkTypeface
Definition:
SkTypeface.h:52
TestEmptyTypeface::EmptyLocalizedStrings
Definition:
TestEmptyTypeface.h:45
TestEmptyTypeface::EmptyLocalizedStrings::next
bool next(SkTypeface::LocalizedString *) override
Definition:
TestEmptyTypeface.h:47
TestEmptyTypeface
Definition:
TestEmptyTypeface.h:16
TestEmptyTypeface::onMakeClone
sk_sp< SkTypeface > onMakeClone(const SkFontArguments &args) const override
Definition:
TestEmptyTypeface.h:24
TestEmptyTypeface::onGetTableData
size_t onGetTableData(SkFontTableTag, size_t, size_t, void *) const override
Definition:
TestEmptyTypeface.h:64
TestEmptyTypeface::onGetFontDescriptor
void onGetFontDescriptor(SkFontDescriptor *, bool *) const override
Definition:
TestEmptyTypeface.h:37
TestEmptyTypeface::TestEmptyTypeface
TestEmptyTypeface()
Definition:
TestEmptyTypeface.h:21
TestEmptyTypeface::Make
static sk_sp< SkTypeface > Make()
Definition:
TestEmptyTypeface.h:18
TestEmptyTypeface::onOpenStream
std::unique_ptr< SkStreamAsset > onOpenStream(int *ttcIndex) const override
Definition:
TestEmptyTypeface.h:23
TestEmptyTypeface::onGetTableTags
int onGetTableTags(SkFontTableTag tags[]) const override
Definition:
TestEmptyTypeface.h:63
TestEmptyTypeface::getPostScriptGlyphNames
void getPostScriptGlyphNames(SkString *) const override
Definition:
TestEmptyTypeface.h:42
TestEmptyTypeface::onGetAdvancedMetrics
std::unique_ptr< SkAdvancedTypefaceMetrics > onGetAdvancedMetrics() const override
Definition:
TestEmptyTypeface.h:34
TestEmptyTypeface::onGetVariationDesignPosition
int onGetVariationDesignPosition(SkFontArguments::VariationPosition::Coordinate coordinates[], int coordinateCount) const override
Definition:
TestEmptyTypeface.h:55
TestEmptyTypeface::onCreateScalerContext
std::unique_ptr< SkScalerContext > onCreateScalerContext(const SkScalerContextEffects &effects, const SkDescriptor *desc) const override
Definition:
TestEmptyTypeface.h:27
TestEmptyTypeface::onGetPostScriptName
bool onGetPostScriptName(SkString *) const override
Definition:
TestEmptyTypeface.h:50
TestEmptyTypeface::onGetVariationDesignParameters
int onGetVariationDesignParameters(SkFontParameters::Variation::Axis parameters[], int parameterCount) const override
Definition:
TestEmptyTypeface.h:59
TestEmptyTypeface::onCountGlyphs
int onCountGlyphs() const override
Definition:
TestEmptyTypeface.h:41
TestEmptyTypeface::onGetFamilyName
void onGetFamilyName(SkString *familyName) const override
Definition:
TestEmptyTypeface.h:49
TestEmptyTypeface::onGetUPEM
int onGetUPEM() const override
Definition:
TestEmptyTypeface.h:44
TestEmptyTypeface::getGlyphToUnicodeMap
void getGlyphToUnicodeMap(SkUnichar *) const override
Definition:
TestEmptyTypeface.h:43
TestEmptyTypeface::onGlyphMaskNeedsCurrentColor
bool onGlyphMaskNeedsCurrentColor() const override
Definition:
TestEmptyTypeface.h:54
TestEmptyTypeface::onCreateFamilyNameIterator
SkTypeface::LocalizedStrings * onCreateFamilyNameIterator() const override
Definition:
TestEmptyTypeface.h:51
TestEmptyTypeface::onCharsToGlyphs
void onCharsToGlyphs(const SkUnichar *chars, int count, SkGlyphID glyphs[]) const override
Definition:
TestEmptyTypeface.h:38
TestEmptyTypeface::onFilterRec
void onFilterRec(SkScalerContextRec *) const override
Definition:
TestEmptyTypeface.h:33
sk_sp< SkTypeface >
args
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
Definition:
fl_event_channel.h:89
import_conformance_tests.desc
desc
Definition:
import_conformance_tests.py:63
SkFontArguments::VariationPosition::Coordinate
Definition:
SkFontArguments.h:18
SkFontArguments
Definition:
SkFontArguments.h:16
SkFontParameters::Variation::Axis
Definition:
SkFontParameters.h:17
SkScalerContextEffects
Definition:
SkScalerContext.h:240
SkScalerContextRec
Definition:
SkScalerContext.h:68
SkTypeface::LocalizedString
Definition:
SkTypeface.h:253
true
true
Definition:
verylargebitmap.cpp:163
Generated on Sun Jun 23 2024 21:56:50 for Flutter Engine by
1.9.4