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

#include <SkTypeface_FreeType.h>

Inheritance diagram for SkTypeface_FreeTypeStream:
SkTypeface_FreeType SkTypeface SkWeakRefCnt SkRefCnt SkRefCntBase SkTypeface_Fuchsia

Public Member Functions

 SkTypeface_FreeTypeStream (std::unique_ptr< SkFontData > fontData, const SkString familyName, const SkFontStyle &style, bool isFixedPitch)
 
 ~SkTypeface_FreeTypeStream () 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
 

Protected Member Functions

void onGetFamilyName (SkString *familyName) const override
 
void onGetFontDescriptor (SkFontDescriptor *, bool *serialize) const override
 
std::unique_ptr< SkStreamAssetonOpenStream (int *ttcIndex) const override
 
std::unique_ptr< SkFontDataonMakeFontData () const override
 
sk_sp< SkTypefaceonMakeClone (const SkFontArguments &) 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 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 &))
 
- 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 92 of file SkTypeface_FreeType.h.

Constructor & Destructor Documentation

◆ SkTypeface_FreeTypeStream()

SkTypeface_FreeTypeStream::SkTypeface_FreeTypeStream ( std::unique_ptr< SkFontData fontData,
const SkString  familyName,
const SkFontStyle style,
bool  isFixedPitch 
)

Definition at line 1954 of file SkFontHost_FreeType.cpp.

1958 , fFamilyName(std::move(familyName))
1959 , fData(std::move(fontData))
1960{ }
SkTypeface_FreeType(const SkFontStyle &style, bool isFixedPitch)
bool isFixedPitch() const
Definition: SkTypeface.h:68

◆ ~SkTypeface_FreeTypeStream()

SkTypeface_FreeTypeStream::~SkTypeface_FreeTypeStream ( )
override

Definition at line 1962 of file SkFontHost_FreeType.cpp.

1962{}

Member Function Documentation

◆ onGetFamilyName()

void SkTypeface_FreeTypeStream::onGetFamilyName ( SkString familyName) const
overrideprotectedvirtual

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 1964 of file SkFontHost_FreeType.cpp.

1964 {
1965 *familyName = fFamilyName;
1966}

◆ onGetFontDescriptor()

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

Implements SkTypeface.

Definition at line 1991 of file SkFontHost_FreeType.cpp.

1991 {
1992 desc->setFamilyName(fFamilyName.c_str());
1993 desc->setStyle(this->fontStyle());
1996 *serialize = true;
1997}
void setFactoryId(SkTypeface::FactoryId factoryId)
const char * c_str() const
Definition: SkString.h:133
static void FontDataPaletteToDescriptorPalette(const SkFontData &, SkFontDescriptor *)
SkFontStyle fontStyle() const
Definition: SkTypeface.h:55
void serialize(SkWStream *, SerializeBehavior=SerializeBehavior::kIncludeDataIfLocal) const
Definition: SkTypeface.cpp:202
SkFourByteTag FactoryId
Definition: SkTypeface.h:335

◆ onMakeClone()

sk_sp< SkTypeface > SkTypeface_FreeTypeStream::onMakeClone ( const SkFontArguments args) const
overrideprotectedvirtual

Implements SkTypeface.

Definition at line 1977 of file SkFontHost_FreeType.cpp.

1977 {
1978 SkFontStyle style = this->fontStyle();
1979 std::unique_ptr<SkFontData> data = this->cloneFontData(args, &style);
1980 if (!data) {
1981 return nullptr;
1982 }
1983
1984 SkString familyName;
1985 this->getFamilyName(&familyName);
1986
1987 return sk_make_sp<SkTypeface_FreeTypeStream>(
1988 std::move(data), familyName, style, this->isFixedPitch());
1989}
std::unique_ptr< SkFontData > cloneFontData(const SkFontArguments &, SkFontStyle *style) const
void getFamilyName(SkString *name) const
Definition: SkTypeface.cpp:459
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63

◆ onMakeFontData()

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

Implements SkTypeface_FreeType.

Definition at line 1973 of file SkFontHost_FreeType.cpp.

1973 {
1974 return std::make_unique<SkFontData>(*fData);
1975}

◆ onOpenStream()

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

Implements SkTypeface.

Definition at line 1968 of file SkFontHost_FreeType.cpp.

1968 {
1969 *ttcIndex = fData->getIndex();
1970 return fData->getStream()->duplicate();
1971}

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