Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
SkTypeface_FCI Class Reference

#include <SkFontConfigTypeface.h>

Inheritance diagram for SkTypeface_FCI:
SkTypeface_FreeType SkTypeface SkWeakRefCnt SkRefCnt SkRefCntBase

Public Member Functions

const SkFontConfigInterface::FontIdentitygetIdentity () const
 
sk_sp< SkTypefaceonMakeClone (const SkFontArguments &args) const override
 
- Public Member Functions inherited from SkTypeface_FreeType
std::unique_ptr< SkFontDatamakeFontData () const
 
FaceRecgetFaceRec () const
 
- Public Member Functions inherited from SkTypeface
SkFontStyle fontStyle () const
 
bool isBold () const
 
bool isItalic () const
 
bool isFixedPitch () const
 
int getVariationDesignPosition (SkFontArguments::VariationPosition::Coordinate coordinates[], int coordinateCount) const
 
int getVariationDesignParameters (SkFontParameters::Variation::Axis parameters[], int parameterCount) const
 
SkTypefaceID uniqueID () const
 
sk_sp< SkTypefacemakeClone (const SkFontArguments &) const
 
void serialize (SkWStream *, SerializeBehavior=SerializeBehavior::kIncludeDataIfLocal) const
 
sk_sp< SkDataserialize (SerializeBehavior=SerializeBehavior::kIncludeDataIfLocal) const
 
void unicharsToGlyphs (const SkUnichar uni[], int count, SkGlyphID glyphs[]) const
 
int textToGlyphs (const void *text, size_t byteLength, SkTextEncoding encoding, SkGlyphID glyphs[], int maxGlyphCount) const
 
SkGlyphID unicharToGlyph (SkUnichar unichar) const
 
int countGlyphs () const
 
int countTables () const
 
int getTableTags (SkFontTableTag tags[]) const
 
size_t getTableSize (SkFontTableTag) const
 
size_t getTableData (SkFontTableTag tag, size_t offset, size_t length, void *data) const
 
sk_sp< SkDatacopyTableData (SkFontTableTag tag) const
 
int getUnitsPerEm () const
 
bool getKerningPairAdjustments (const SkGlyphID glyphs[], int count, int32_t adjustments[]) const
 
LocalizedStringscreateFamilyNameIterator () const
 
void getFamilyName (SkString *name) const
 
bool getPostScriptName (SkString *name) const
 
std::unique_ptr< SkStreamAssetopenStream (int *ttcIndex) const
 
std::unique_ptr< SkStreamAssetopenExistingStream (int *ttcIndex) const
 
std::unique_ptr< SkScalerContextcreateScalerContext (const SkScalerContextEffects &, const SkDescriptor *) const
 
SkRect getBounds () const
 
void filterRec (SkScalerContextRec *rec) const
 
void getFontDescriptor (SkFontDescriptor *desc, bool *isLocal) const
 
void * internal_private_getCTFontRef () const
 
- Public Member Functions inherited from SkWeakRefCnt
 SkWeakRefCnt ()
 
 ~SkWeakRefCnt () override
 
bool try_ref () const
 
void weak_ref () const
 
void weak_unref () const
 
bool weak_expired () const
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Static Public Member Functions

static SkTypeface_FCICreate (sk_sp< SkFontConfigInterface > fci, const SkFontConfigInterface::FontIdentity &fi, SkString familyName, const SkFontStyle &style)
 
- Static Public Member Functions inherited from SkTypeface_FreeType
static int GetUnitsPerEm (FT_Face face)
 
static sk_sp< SkTypefaceMakeFromStream (std::unique_ptr< SkStreamAsset >, const SkFontArguments &)
 
- Static Public Member Functions inherited from SkTypeface
static bool Equal (const SkTypeface *facea, const SkTypeface *faceb)
 
static sk_sp< SkTypefaceMakeEmpty ()
 
static sk_sp< SkTypefaceMakeDeserialize (SkStream *, sk_sp< SkFontMgr > lastResortMgr)
 
static void Register (FactoryId id, sk_sp< SkTypeface >(*make)(std::unique_ptr< SkStreamAsset >, const SkFontArguments &))
 

Protected Member Functions

 SkTypeface_FCI (sk_sp< SkFontConfigInterface > fci, const SkFontConfigInterface::FontIdentity &fi, SkString familyName, const SkFontStyle &style)
 
void onGetFamilyName (SkString *familyName) const override
 
void onGetFontDescriptor (SkFontDescriptor *, bool *) const override
 
std::unique_ptr< SkStreamAssetonOpenStream (int *ttcIndex) const override
 
std::unique_ptr< SkFontDataonMakeFontData () const override
 
- Protected Member Functions inherited from SkTypeface_FreeType
 SkTypeface_FreeType (const SkFontStyle &style, bool isFixedPitch)
 
 ~SkTypeface_FreeType () override
 
std::unique_ptr< SkFontDatacloneFontData (const SkFontArguments &, SkFontStyle *style) const
 
std::unique_ptr< SkScalerContextonCreateScalerContext (const SkScalerContextEffects &, const SkDescriptor *) const override
 
void onFilterRec (SkScalerContextRec *) const override
 
void getGlyphToUnicodeMap (SkUnichar *) const override
 
std::unique_ptr< SkAdvancedTypefaceMetricsonGetAdvancedMetrics () const override
 
void getPostScriptGlyphNames (SkString *dstArray) const override
 
bool onGetPostScriptName (SkString *) const override
 
int onGetUPEM () const override
 
bool onGetKerningPairAdjustments (const uint16_t glyphs[], int count, int32_t adjustments[]) const override
 
void onCharsToGlyphs (const SkUnichar uni[], int count, SkGlyphID glyphs[]) const override
 
int onCountGlyphs () const override
 
LocalizedStringsonCreateFamilyNameIterator () const override
 
bool onGlyphMaskNeedsCurrentColor () const override
 
int onGetVariationDesignPosition (SkFontArguments::VariationPosition::Coordinate coordinates[], int coordinateCount) const override
 
int onGetVariationDesignParameters (SkFontParameters::Variation::Axis parameters[], int parameterCount) const override
 
int onGetTableTags (SkFontTableTag tags[]) const override
 
size_t onGetTableData (SkFontTableTag, size_t offset, size_t length, void *data) const override
 
sk_sp< SkDataonCopyTableData (SkFontTableTag) const override
 
virtual std::unique_ptr< SkFontDataonMakeFontData () const =0
 
- Protected Member Functions inherited from SkTypeface
 SkTypeface (const SkFontStyle &style, bool isFixedPitch=false)
 
 ~SkTypeface () override
 
virtual sk_sp< SkTypefaceonMakeClone (const SkFontArguments &) const =0
 
void setIsFixedPitch (bool isFixedPitch)
 
void setFontStyle (SkFontStyle style)
 
virtual std::unique_ptr< SkScalerContextonCreateScalerContext (const SkScalerContextEffects &, const SkDescriptor *) const =0
 
virtual void onFilterRec (SkScalerContextRec *) const =0
 
virtual std::unique_ptr< SkAdvancedTypefaceMetricsonGetAdvancedMetrics () const =0
 
virtual void getPostScriptGlyphNames (SkString *) const =0
 
virtual void getGlyphToUnicodeMap (SkUnichar *dstArray) const =0
 
virtual std::unique_ptr< SkStreamAssetonOpenStream (int *ttcIndex) const =0
 
virtual std::unique_ptr< SkStreamAssetonOpenExistingStream (int *ttcIndex) const
 
virtual bool onGlyphMaskNeedsCurrentColor () const =0
 
virtual int onGetVariationDesignPosition (SkFontArguments::VariationPosition::Coordinate coordinates[], int coordinateCount) const =0
 
virtual int onGetVariationDesignParameters (SkFontParameters::Variation::Axis parameters[], int parameterCount) const =0
 
virtual void onGetFontDescriptor (SkFontDescriptor *, bool *isLocal) const =0
 
virtual void onCharsToGlyphs (const SkUnichar *chars, int count, SkGlyphID glyphs[]) const =0
 
virtual int onCountGlyphs () const =0
 
virtual int onGetUPEM () const =0
 
virtual bool onGetKerningPairAdjustments (const SkGlyphID glyphs[], int count, int32_t adjustments[]) const
 
virtual void onGetFamilyName (SkString *familyName) const =0
 
virtual bool onGetPostScriptName (SkString *) const =0
 
virtual LocalizedStringsonCreateFamilyNameIterator () const =0
 
virtual int onGetTableTags (SkFontTableTag tags[]) const =0
 
virtual size_t onGetTableData (SkFontTableTag, size_t offset, size_t length, void *data) const =0
 
virtual sk_sp< SkDataonCopyTableData (SkFontTableTag) const
 
virtual bool onComputeBounds (SkRect *) const
 
virtual void * onGetCTFontRef () const
 
- Protected Member Functions inherited from SkWeakRefCnt
virtual void weak_dispose () const
 

Additional Inherited Members

- Public Types inherited from SkTypeface
enum class  SerializeBehavior { kDoIncludeData , kDontIncludeData , kIncludeDataIfLocal }
 
using FactoryId = SkFourByteTag
 
- Static Public Attributes inherited from SkTypeface_FreeType
static constexpr SkTypeface::FactoryId FactoryId = SkSetFourByteTag('f','r','e','e')
 
- Static Protected Member Functions inherited from SkTypeface_FreeType
static void FontDataPaletteToDescriptorPalette (const SkFontData &, SkFontDescriptor *)
 

Detailed Description

Definition at line 20 of file SkFontConfigTypeface.h.

Constructor & Destructor Documentation

◆ SkTypeface_FCI()

SkTypeface_FCI::SkTypeface_FCI ( sk_sp< SkFontConfigInterface fci,
const SkFontConfigInterface::FontIdentity fi,
SkString  familyName,
const SkFontStyle style 
)
inlineprotected

Definition at line 49 of file SkFontConfigTypeface.h.

53 : INHERITED(style, false)
54 , fFCI(std::move(fci))
55 , fIdentity(fi)
56 , fFamilyName(std::move(familyName)) {}

Member Function Documentation

◆ Create()

static SkTypeface_FCI * SkTypeface_FCI::Create ( sk_sp< SkFontConfigInterface fci,
const SkFontConfigInterface::FontIdentity fi,
SkString  familyName,
const SkFontStyle style 
)
inlinestatic

Definition at line 26 of file SkFontConfigTypeface.h.

30 {
31 return new SkTypeface_FCI(std::move(fci), fi, std::move(familyName), style);
32 }
SkTypeface_FCI(sk_sp< SkFontConfigInterface > fci, const SkFontConfigInterface::FontIdentity &fi, SkString familyName, const SkFontStyle &style)

◆ getIdentity()

const SkFontConfigInterface::FontIdentity & SkTypeface_FCI::getIdentity ( ) const
inline

Definition at line 34 of file SkFontConfigTypeface.h.

34 {
35 return fIdentity;
36 }

◆ onGetFamilyName()

void SkTypeface_FCI::onGetFamilyName ( SkString familyName) const
inlineoverrideprotectedvirtual

Returns the family name of the typeface as known by its font manager. This name may or may not be produced by the family name iterator.

Implements SkTypeface.

Definition at line 58 of file SkFontConfigTypeface.h.

58{ *familyName = fFamilyName; }

◆ onGetFontDescriptor()

void SkTypeface_FCI::onGetFontDescriptor ( SkFontDescriptor desc,
bool *  serialize 
) const
overrideprotectedvirtual

Implements SkTypeface.

Definition at line 35 of file SkFontMgr_FontConfigInterface.cpp.

35 {
37 this->getFamilyName(&name);
38 desc->setFamilyName(name.c_str());
39 desc->setStyle(this->fontStyle());
41 *serialize = true;
42}
void setFactoryId(SkTypeface::FactoryId factoryId)
void getFamilyName(SkString *name) const
Definition: SkTypeface.cpp:459
SkFontStyle fontStyle() const
Definition: SkTypeface.h:55
void serialize(SkWStream *, SerializeBehavior=SerializeBehavior::kIncludeDataIfLocal) const
Definition: SkTypeface.cpp:202
SkFourByteTag FactoryId
Definition: SkTypeface.h:335
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32

◆ onMakeClone()

sk_sp< SkTypeface > SkTypeface_FCI::onMakeClone ( const SkFontArguments args) const
inlineoverridevirtual

Implements SkTypeface.

Definition at line 38 of file SkFontConfigTypeface.h.

38 {
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 }
std::unique_ptr< SkFontData > cloneFontData(const SkFontArguments &, SkFontStyle *style) const
bool isFixedPitch() const
Definition: SkTypeface.h:68
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63

◆ onMakeFontData()

std::unique_ptr< SkFontData > SkTypeface_FCI::onMakeFontData ( ) const
overrideprotectedvirtual

Implements SkTypeface_FreeType.

Definition at line 29 of file SkFontMgr_FontConfigInterface.cpp.

29 {
31 return std::make_unique<SkFontData>(std::unique_ptr<SkStreamAsset>(fFCI->openStream(id)),
32 id.fTTCIndex, 0, nullptr, 0, nullptr, 0);
33}
virtual SkStreamAsset * openStream(const FontIdentity &)=0
const SkFontConfigInterface::FontIdentity & getIdentity() const

◆ onOpenStream()

std::unique_ptr< SkStreamAsset > SkTypeface_FCI::onOpenStream ( int ttcIndex) const
overrideprotectedvirtual

Implements SkTypeface.

Definition at line 24 of file SkFontMgr_FontConfigInterface.cpp.

24 {
25 *ttcIndex = this->getIdentity().fTTCIndex;
26 return std::unique_ptr<SkStreamAsset>(fFCI->openStream(this->getIdentity()));
27}

The documentation for this class was generated from the following files: