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

#include <RandomScalerContext.h>

Inheritance diagram for SkRandomTypeface:
SkTypeface SkWeakRefCnt SkRefCnt SkRefCntBase

Public Member Functions

 SkRandomTypeface (sk_sp< SkTypeface > proxy, const SkPaint &, bool fakeit)
 
SkTypefaceproxy () const
 
const SkPaintpaint () 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

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
 
std::unique_ptr< SkStreamAssetonOpenStream (int *ttcIndex) const override
 
sk_sp< SkTypefaceonMakeClone (const SkFontArguments &args) const override
 
void onGetFontDescriptor (SkFontDescriptor *, bool *isLocal) const override
 
void onCharsToGlyphs (const SkUnichar *chars, int count, SkGlyphID glyphs[]) const override
 
int onCountGlyphs () const override
 
int onGetUPEM () const override
 
void onGetFamilyName (SkString *familyName) const override
 
bool onGetPostScriptName (SkString *) const override
 
SkTypeface::LocalizedStringsonCreateFamilyNameIterator () const override
 
void getPostScriptGlyphNames (SkString *) 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
 
- 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
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 19 of file RandomScalerContext.h.

Constructor & Destructor Documentation

◆ SkRandomTypeface()

SkRandomTypeface::SkRandomTypeface ( sk_sp< SkTypeface proxy,
const SkPaint paint,
bool  fakeit 
)

Definition at line 165 of file RandomScalerContext.cpp.

166 : SkTypeface(proxy->fontStyle(), false)
167 , fProxy(std::move(proxy))
168 , fPaint(paint)
169 , fFakeIt(fakeIt) {}
const SkPaint & paint() const
SkTypeface * proxy() const
SkFontStyle fontStyle() const
Definition: SkTypeface.h:55
SkTypeface(const SkFontStyle &style, bool isFixedPitch=false)
Definition: SkTypeface.cpp:56

Member Function Documentation

◆ getGlyphToUnicodeMap()

void SkRandomTypeface::getGlyphToUnicodeMap ( SkUnichar glyphToUnicode) const
overrideprotectedvirtual

Implements SkTypeface.

Definition at line 184 of file RandomScalerContext.cpp.

184 {
185 fProxy->getGlyphToUnicodeMap(glyphToUnicode);
186}
virtual void getGlyphToUnicodeMap(SkUnichar *dstArray) const =0
Definition: SkTypeface.cpp:468

◆ getPostScriptGlyphNames()

void SkRandomTypeface::getPostScriptGlyphNames ( SkString names) const
overrideprotectedvirtual

Implements SkTypeface.

Definition at line 230 of file RandomScalerContext.cpp.

230 {
231 return fProxy->getPostScriptGlyphNames(names);
232}
virtual void getPostScriptGlyphNames(SkString *) const =0
static const char *const names[]
Definition: symbols.cc:24

◆ onCharsToGlyphs()

void SkRandomTypeface::onCharsToGlyphs ( const SkUnichar chars,
int  count,
SkGlyphID  glyphs[] 
) const
overrideprotectedvirtual

Implements SkTypeface.

Definition at line 210 of file RandomScalerContext.cpp.

210 {
211 fProxy->unicharsToGlyphs(uni, count, glyphs);
212}
uint16_t glyphs[5]
Definition: FontMgrTest.cpp:46
int count
Definition: FontMgrTest.cpp:50
void unicharsToGlyphs(const SkUnichar uni[], int count, SkGlyphID glyphs[]) const
Definition: SkTypeface.cpp:357

◆ onCountGlyphs()

int SkRandomTypeface::onCountGlyphs ( ) const
overrideprotectedvirtual

Implements SkTypeface.

Definition at line 214 of file RandomScalerContext.cpp.

214{ return fProxy->countGlyphs(); }
int countGlyphs() const
Definition: SkTypeface.cpp:432

◆ onCreateFamilyNameIterator()

SkTypeface::LocalizedStrings * SkRandomTypeface::onCreateFamilyNameIterator ( ) const
overrideprotectedvirtual

Returns an iterator over the family names in the font.

Implements SkTypeface.

Definition at line 226 of file RandomScalerContext.cpp.

226 {
227 return fProxy->createFamilyNameIterator();
228}
LocalizedStrings * createFamilyNameIterator() const
Definition: SkTypeface.cpp:455

◆ onCreateScalerContext()

std::unique_ptr< SkScalerContext > SkRandomTypeface::onCreateScalerContext ( const SkScalerContextEffects effects,
const SkDescriptor desc 
) const
overrideprotectedvirtual

Implements SkTypeface.

Definition at line 171 of file RandomScalerContext.cpp.

173{
174 return std::make_unique<RandomScalerContext>(
175 sk_ref_sp(const_cast<SkRandomTypeface*>(this)), effects, desc, fFakeIt);
176}
sk_sp< T > sk_ref_sp(T *obj)
Definition: SkRefCnt.h:381

◆ onFilterRec()

void SkRandomTypeface::onFilterRec ( SkScalerContextRec rec) const
overrideprotectedvirtual

Implements SkTypeface.

Definition at line 178 of file RandomScalerContext.cpp.

178 {
179 fProxy->filterRec(rec);
182}
@ kNone
glyph outlines unchanged
void filterRec(SkScalerContextRec *rec) const
Definition: SkTypeface.h:322
@ kARGB32_Format
SkPMColor.
Definition: SkMask.h:30
SkMask::Format fMaskFormat
void setHinting(SkFontHinting)

◆ onGetAdvancedMetrics()

std::unique_ptr< SkAdvancedTypefaceMetrics > SkRandomTypeface::onGetAdvancedMetrics ( ) const
overrideprotectedvirtual

Implements SkTypeface.

Definition at line 188 of file RandomScalerContext.cpp.

188 {
189 return fProxy->getAdvancedMetrics();
190}

◆ onGetFamilyName()

void SkRandomTypeface::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 218 of file RandomScalerContext.cpp.

218 {
219 fProxy->getFamilyName(familyName);
220}
void getFamilyName(SkString *name) const
Definition: SkTypeface.cpp:459

◆ onGetFontDescriptor()

void SkRandomTypeface::onGetFontDescriptor ( SkFontDescriptor desc,
bool *  isLocal 
) const
overrideprotectedvirtual

Implements SkTypeface.

Definition at line 204 of file RandomScalerContext.cpp.

204 {
205 // TODO: anything that uses this typeface isn't correctly serializable, since this typeface
206 // cannot be deserialized.
207 fProxy->getFontDescriptor(desc, isLocal);
208}
void getFontDescriptor(SkFontDescriptor *desc, bool *isLocal) const
Definition: SkTypeface.h:326

◆ onGetPostScriptName()

bool SkRandomTypeface::onGetPostScriptName ( SkString postScriptName) const
overrideprotectedvirtual

Implements SkTypeface.

Definition at line 222 of file RandomScalerContext.cpp.

222 {
223 return fProxy->getPostScriptName(postScriptName);
224}
bool getPostScriptName(SkString *name) const
Definition: SkTypeface.cpp:464

◆ onGetTableData()

size_t SkRandomTypeface::onGetTableData ( SkFontTableTag  tag,
size_t  offset,
size_t  length,
void *  data 
) const
overrideprotectedvirtual

Implements SkTypeface.

Definition at line 253 of file RandomScalerContext.cpp.

256 {
257 return fProxy->getTableData(tag, offset, length, data);
258}
size_t getTableData(SkFontTableTag tag, size_t offset, size_t length, void *data) const
Definition: SkTypeface.cpp:313
size_t length
SeparatedVector2 offset
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63

◆ onGetTableTags()

int SkRandomTypeface::onGetTableTags ( SkFontTableTag  tags[]) const
overrideprotectedvirtual

Implements SkTypeface.

Definition at line 249 of file RandomScalerContext.cpp.

249 {
250 return fProxy->getTableTags(tags);
251}
int getTableTags(SkFontTableTag tags[]) const
Definition: SkTypeface.cpp:305

◆ onGetUPEM()

int SkRandomTypeface::onGetUPEM ( ) const
overrideprotectedvirtual

Implements SkTypeface.

Definition at line 216 of file RandomScalerContext.cpp.

216{ return fProxy->getUnitsPerEm(); }
int getUnitsPerEm() const
Definition: SkTypeface.cpp:436

◆ onGetVariationDesignParameters()

int SkRandomTypeface::onGetVariationDesignParameters ( SkFontParameters::Variation::Axis  parameters[],
int  parameterCount 
) const
overrideprotectedvirtual

Implements SkTypeface.

Definition at line 244 of file RandomScalerContext.cpp.

245 {
246 return fProxy->onGetVariationDesignParameters(parameters, parameterCount);
247}
virtual int onGetVariationDesignParameters(SkFontParameters::Variation::Axis parameters[], int parameterCount) const =0

◆ onGetVariationDesignPosition()

int SkRandomTypeface::onGetVariationDesignPosition ( SkFontArguments::VariationPosition::Coordinate  coordinates[],
int  coordinateCount 
) const
overrideprotectedvirtual

Implements SkTypeface.

Definition at line 238 of file RandomScalerContext.cpp.

240 {
241 return fProxy->onGetVariationDesignPosition(coordinates, coordinateCount);
242}
virtual int onGetVariationDesignPosition(SkFontArguments::VariationPosition::Coordinate coordinates[], int coordinateCount) const =0

◆ onGlyphMaskNeedsCurrentColor()

bool SkRandomTypeface::onGlyphMaskNeedsCurrentColor ( ) const
overrideprotectedvirtual

Implements SkTypeface.

Definition at line 234 of file RandomScalerContext.cpp.

234 {
235 return fProxy->glyphMaskNeedsCurrentColor();
236}

◆ onMakeClone()

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

Implements SkTypeface.

Definition at line 196 of file RandomScalerContext.cpp.

196 {
198 if (!proxy) {
199 return nullptr;
200 }
201 return sk_make_sp<SkRandomTypeface>(proxy, fPaint, fFakeIt);
202}
sk_sp< SkTypeface > makeClone(const SkFontArguments &) const
Definition: SkTypeface.cpp:190
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args

◆ onOpenStream()

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

Implements SkTypeface.

Definition at line 192 of file RandomScalerContext.cpp.

192 {
193 return fProxy->openStream(ttcIndex);
194}
std::unique_ptr< SkStreamAsset > openStream(int *ttcIndex) const
Definition: SkTypeface.cpp:332

◆ paint()

const SkPaint & SkRandomTypeface::paint ( ) const
inline

Definition at line 24 of file RandomScalerContext.h.

24{ return fPaint; }

◆ proxy()

SkTypeface * SkRandomTypeface::proxy ( ) const
inline

Definition at line 23 of file RandomScalerContext.h.

23{ return fProxy.get(); }
T * get() const
Definition: SkRefCnt.h:303

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