Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
SkTypefaceProxy Class Reference

#include <SkTypeface_remote.h>

Inheritance diagram for SkTypefaceProxy:
SkTypeface SkWeakRefCnt SkRefCnt SkRefCntBase

Public Member Functions

 SkTypefaceProxy (const SkTypefaceProxyPrototype &prototype, sk_sp< SkStrikeClient::DiscardableHandleManager > manager, bool isLogging=true)
 
 SkTypefaceProxy (SkTypefaceID typefaceID, int glyphCount, const SkFontStyle &style, bool isFixedPitch, bool glyphMaskNeedsCurrentColor, sk_sp< SkStrikeClient::DiscardableHandleManager > manager, bool isLogging=true)
 
SkTypefaceID remoteTypefaceID () const
 
int glyphCount () const
 
bool isLogging () 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

int onGetUPEM () const override
 
std::unique_ptr< SkStreamAssetonOpenStream (int *ttcIndex) const override
 
sk_sp< SkTypefaceonMakeClone (const SkFontArguments &args) 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
 
void onGetFamilyName (SkString *familyName) const override
 
bool onGetPostScriptName (SkString *) const override
 
SkTypeface::LocalizedStringsonCreateFamilyNameIterator () const override
 
int onGetTableTags (SkFontTableTag tags[]) const override
 
size_t onGetTableData (SkFontTableTag, size_t offset, size_t length, void *data) const override
 
std::unique_ptr< SkScalerContextonCreateScalerContext (const SkScalerContextEffects &effects, const SkDescriptor *desc) const override
 
void onFilterRec (SkScalerContextRec *rec) const override
 
void onGetFontDescriptor (SkFontDescriptor *, bool *) const override
 
void getGlyphToUnicodeMap (SkUnichar *) const override
 
void getPostScriptGlyphNames (SkString *) const override
 
std::unique_ptr< SkAdvancedTypefaceMetricsonGetAdvancedMetrics () const override
 
void onCharsToGlyphs (const SkUnichar *chars, int count, SkGlyphID glyphs[]) const override
 
int onCountGlyphs () const override
 
void * onGetCTFontRef () const override
 
- Protected Member Functions inherited from SkTypeface
 SkTypeface (const SkFontStyle &style, bool isFixedPitch=false)
 
 ~SkTypeface () override
 
void setIsFixedPitch (bool isFixedPitch)
 
void setFontStyle (SkFontStyle style)
 
virtual std::unique_ptr< SkStreamAssetonOpenExistingStream (int *ttcIndex) const
 
virtual bool onGetKerningPairAdjustments (const SkGlyphID glyphs[], int count, int32_t adjustments[]) const
 
virtual sk_sp< SkDataonCopyTableData (SkFontTableTag) const
 
virtual bool onComputeBounds (SkRect *) 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
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 &))
 

Detailed Description

Definition at line 90 of file SkTypeface_remote.h.

Constructor & Destructor Documentation

◆ SkTypefaceProxy() [1/2]

SkTypefaceProxy::SkTypefaceProxy ( const SkTypefaceProxyPrototype prototype,
sk_sp< SkStrikeClient::DiscardableHandleManager manager,
bool  isLogging = true 
)

Definition at line 137 of file SkTypeface_remote.cpp.

140 : SkTypeface{prototype.style(), prototype.fIsFixedPitch}
141 , fTypefaceID{prototype.fServerTypefaceID}
142 , fGlyphCount{prototype.fGlyphCount}
143 , fIsLogging{isLogging}
144 , fGlyphMaskNeedsCurrentColor{prototype.fGlyphMaskNeedsCurrentColor}
145 , fDiscardableManager{std::move(manager)} {}
bool isLogging() const

◆ SkTypefaceProxy() [2/2]

SkTypefaceProxy::SkTypefaceProxy ( SkTypefaceID  typefaceID,
int  glyphCount,
const SkFontStyle style,
bool  isFixedPitch,
bool  glyphMaskNeedsCurrentColor,
sk_sp< SkStrikeClient::DiscardableHandleManager manager,
bool  isLogging = true 
)

Definition at line 147 of file SkTypeface_remote.cpp.

154 : SkTypeface{style, isFixedPitch}
155 , fTypefaceID{typefaceID}
156 , fGlyphCount{glyphCount}
157 , fIsLogging{isLogging}
158 , fGlyphMaskNeedsCurrentColor(glyphMaskNeedsCurrentColor)
159 , fDiscardableManager{std::move(manager)} {}
bool isFixedPitch() const
Definition SkTypeface.h:68

Member Function Documentation

◆ getGlyphToUnicodeMap()

void SkTypefaceProxy::getGlyphToUnicodeMap ( SkUnichar ) const
inlineoverrideprotectedvirtual

Implements SkTypeface.

Definition at line 158 of file SkTypeface_remote.h.

158 {
159 SK_ABORT("Should never be called.");
160 }
#define SK_ABORT(message,...)
Definition SkAssert.h:70

◆ getPostScriptGlyphNames()

void SkTypefaceProxy::getPostScriptGlyphNames ( SkString ) const
inlineoverrideprotectedvirtual

Implements SkTypeface.

Definition at line 162 of file SkTypeface_remote.h.

162 {
163 SK_ABORT("Should never be called.");
164 }

◆ glyphCount()

int SkTypefaceProxy::glyphCount ( ) const
inline

Definition at line 106 of file SkTypeface_remote.h.

106{return fGlyphCount;}

◆ isLogging()

bool SkTypefaceProxy::isLogging ( ) const
inline

Definition at line 108 of file SkTypeface_remote.h.

108{return fIsLogging;}

◆ onCharsToGlyphs()

void SkTypefaceProxy::onCharsToGlyphs ( const SkUnichar chars,
int  count,
SkGlyphID  glyphs[] 
) const
inlineoverrideprotectedvirtual

Implements SkTypeface.

Definition at line 169 of file SkTypeface_remote.h.

169 {
170 SK_ABORT("Should never be called.");
171 }

◆ onCountGlyphs()

int SkTypefaceProxy::onCountGlyphs ( ) const
inlineoverrideprotectedvirtual

Implements SkTypeface.

Definition at line 172 of file SkTypeface_remote.h.

172 {
173 return this->glyphCount();
174 }

◆ onCreateFamilyNameIterator()

SkTypeface::LocalizedStrings * SkTypefaceProxy::onCreateFamilyNameIterator ( ) const
inlineoverrideprotectedvirtual

Returns an iterator over the family names in the font.

Implements SkTypeface.

Definition at line 136 of file SkTypeface_remote.h.

136 {
137 SK_ABORT("Should never be called.");
138 }

◆ onCreateScalerContext()

std::unique_ptr< SkScalerContext > SkTypefaceProxy::onCreateScalerContext ( const SkScalerContextEffects effects,
const SkDescriptor desc 
) const
inlineoverrideprotectedvirtual

Implements SkTypeface.

Definition at line 145 of file SkTypeface_remote.h.

147 {
148 return std::make_unique<SkScalerContextProxy>(
149 sk_ref_sp(const_cast<SkTypefaceProxy*>(this)), effects, desc, fDiscardableManager);
150 }
sk_sp< T > sk_ref_sp(T *obj)
Definition SkRefCnt.h:381

◆ onFilterRec()

void SkTypefaceProxy::onFilterRec ( SkScalerContextRec rec) const
inlineoverrideprotectedvirtual

Implements SkTypeface.

Definition at line 151 of file SkTypeface_remote.h.

151 {
152 // The rec filtering is already applied by the server when generating
153 // the glyphs.
154 }

◆ onGetAdvancedMetrics()

std::unique_ptr< SkAdvancedTypefaceMetrics > SkTypefaceProxy::onGetAdvancedMetrics ( ) const
inlineoverrideprotectedvirtual

Implements SkTypeface.

Definition at line 166 of file SkTypeface_remote.h.

166 {
167 SK_ABORT("Should never be called.");
168 }

◆ onGetCTFontRef()

void * SkTypefaceProxy::onGetCTFontRef ( ) const
inlineoverrideprotectedvirtual

Reimplemented from SkTypeface.

Definition at line 176 of file SkTypeface_remote.h.

176 {
177 SK_ABORT("Should never be called.");
178 }

◆ onGetFamilyName()

void SkTypefaceProxy::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 129 of file SkTypeface_remote.h.

129 {
130 // Used by SkStrikeCache::DumpMemoryStatistics.
131 *familyName = "";
132 }

◆ onGetFontDescriptor()

void SkTypefaceProxy::onGetFontDescriptor ( SkFontDescriptor ,
bool *   
) const
inlineoverrideprotectedvirtual

Implements SkTypeface.

Definition at line 155 of file SkTypeface_remote.h.

155 {
156 SK_ABORT("Should never be called.");
157 }

◆ onGetPostScriptName()

bool SkTypefaceProxy::onGetPostScriptName ( SkString ) const
inlineoverrideprotectedvirtual

Implements SkTypeface.

Definition at line 133 of file SkTypeface_remote.h.

133 {
134 SK_ABORT("Should never be called.");
135 }

◆ onGetTableData()

size_t SkTypefaceProxy::onGetTableData ( SkFontTableTag  ,
size_t  offset,
size_t  length,
void *  data 
) const
inlineoverrideprotectedvirtual

Implements SkTypeface.

Definition at line 142 of file SkTypeface_remote.h.

142 {
143 SK_ABORT("Should never be called.");
144 }

◆ onGetTableTags()

int SkTypefaceProxy::onGetTableTags ( SkFontTableTag  tags[]) const
inlineoverrideprotectedvirtual

Implements SkTypeface.

Definition at line 139 of file SkTypeface_remote.h.

139 {
140 SK_ABORT("Should never be called.");
141 }

◆ onGetUPEM()

int SkTypefaceProxy::onGetUPEM ( ) const
inlineoverrideprotectedvirtual

Implements SkTypeface.

Definition at line 111 of file SkTypeface_remote.h.

111{ SK_ABORT("Should never be called."); }

◆ onGetVariationDesignParameters()

int SkTypefaceProxy::onGetVariationDesignParameters ( SkFontParameters::Variation::Axis  parameters[],
int  parameterCount 
) const
inlineoverrideprotectedvirtual

Implements SkTypeface.

Definition at line 125 of file SkTypeface_remote.h.

126 {
127 SK_ABORT("Should never be called.");
128 }

◆ onGetVariationDesignPosition()

int SkTypefaceProxy::onGetVariationDesignPosition ( SkFontArguments::VariationPosition::Coordinate  coordinates[],
int  coordinateCount 
) const
inlineoverrideprotectedvirtual

Implements SkTypeface.

Definition at line 121 of file SkTypeface_remote.h.

122 {
123 SK_ABORT("Should never be called.");
124 }

◆ onGlyphMaskNeedsCurrentColor()

bool SkTypefaceProxy::onGlyphMaskNeedsCurrentColor ( ) const
inlineoverrideprotectedvirtual

Implements SkTypeface.

Definition at line 118 of file SkTypeface_remote.h.

118 {
119 return fGlyphMaskNeedsCurrentColor;
120 }

◆ onMakeClone()

sk_sp< SkTypeface > SkTypefaceProxy::onMakeClone ( const SkFontArguments args) const
inlineoverrideprotectedvirtual

Implements SkTypeface.

Definition at line 115 of file SkTypeface_remote.h.

115 {
116 SK_ABORT("Should never be called.");
117 }

◆ onOpenStream()

std::unique_ptr< SkStreamAsset > SkTypefaceProxy::onOpenStream ( int ttcIndex) const
inlineoverrideprotectedvirtual

Implements SkTypeface.

Definition at line 112 of file SkTypeface_remote.h.

112 {
113 SK_ABORT("Should never be called.");
114 }

◆ remoteTypefaceID()

SkTypefaceID SkTypefaceProxy::remoteTypefaceID ( ) const
inline

Definition at line 104 of file SkTypeface_remote.h.

104{return fTypefaceID;}

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