#include <SkFontMgr.h>
|
int | countFamilies () const |
|
void | getFamilyName (int index, SkString *familyName) const |
|
sk_sp< SkFontStyleSet > | createStyleSet (int index) const |
|
sk_sp< SkFontStyleSet > | matchFamily (const char familyName[]) const |
| The caller must call unref() on the returned object. More...
|
|
sk_sp< SkTypeface > | matchFamilyStyle (const char familyName[], const SkFontStyle &) const |
| Find the closest matching typeface to the specified familyName and style and return a ref to it. More...
|
|
sk_sp< SkTypeface > | matchFamilyStyleCharacter (const char familyName[], const SkFontStyle &, const char *bcp47[], int bcp47Count, SkUnichar character) const |
| Use the system fallback to find a typeface for the given character. More...
|
|
sk_sp< SkTypeface > | makeFromData (sk_sp< SkData >, int ttcIndex=0) const |
| Create a typeface for the specified data and TTC index (pass 0 for none) or NULL if the data is not recognized. More...
|
|
sk_sp< SkTypeface > | makeFromStream (std::unique_ptr< SkStreamAsset >, int ttcIndex=0) const |
| Create a typeface for the specified stream and TTC index (pass 0 for none) or NULL if the stream is not recognized. More...
|
|
sk_sp< SkTypeface > | makeFromStream (std::unique_ptr< SkStreamAsset >, const SkFontArguments &) const |
|
sk_sp< SkTypeface > | makeFromFile (const char path[], int ttcIndex=0) const |
| Create a typeface for the specified fileName and TTC index (pass 0 for none) or NULL if the file is not found, or its contents are not recognized. More...
|
|
sk_sp< SkTypeface > | legacyMakeTypeface (const char familyName[], SkFontStyle style) const |
|
bool | unique () const |
| May return true if the caller is the only owner. More...
|
|
void | ref () const |
| Increment the reference count. More...
|
|
void | unref () const |
| Decrement the reference count. More...
|
|
|
virtual int | onCountFamilies () const =0 |
|
virtual void | onGetFamilyName (int index, SkString *familyName) const =0 |
|
virtual sk_sp< SkFontStyleSet > | onCreateStyleSet (int index) const =0 |
|
virtual sk_sp< SkFontStyleSet > | onMatchFamily (const char familyName[]) const =0 |
| May return NULL if the name is not found. More...
|
|
virtual sk_sp< SkTypeface > | onMatchFamilyStyle (const char familyName[], const SkFontStyle &) const =0 |
|
virtual sk_sp< SkTypeface > | onMatchFamilyStyleCharacter (const char familyName[], const SkFontStyle &, const char *bcp47[], int bcp47Count, SkUnichar character) const =0 |
|
virtual sk_sp< SkTypeface > | onMakeFromData (sk_sp< SkData >, int ttcIndex) const =0 |
|
virtual sk_sp< SkTypeface > | onMakeFromStreamIndex (std::unique_ptr< SkStreamAsset >, int ttcIndex) const =0 |
|
virtual sk_sp< SkTypeface > | onMakeFromStreamArgs (std::unique_ptr< SkStreamAsset >, const SkFontArguments &) const =0 |
|
virtual sk_sp< SkTypeface > | onMakeFromFile (const char path[], int ttcIndex) const =0 |
|
virtual sk_sp< SkTypeface > | onLegacyMakeTypeface (const char familyName[], SkFontStyle) const =0 |
|
◆ countFamilies()
int SkFontMgr::countFamilies |
( |
| ) |
const |
◆ createStyleSet()
◆ getFamilyName()
void SkFontMgr::getFamilyName |
( |
int |
index, |
|
|
SkString * |
familyName |
|
) |
| const |
◆ legacyMakeTypeface()
◆ makeFromData()
Create a typeface for the specified data and TTC index (pass 0 for none) or NULL if the data is not recognized.
The caller must call unref() on the returned object if it is not null.
◆ makeFromFile()
sk_sp<SkTypeface> SkFontMgr::makeFromFile |
( |
const char |
path[], |
|
|
int |
ttcIndex = 0 |
|
) |
| const |
Create a typeface for the specified fileName and TTC index (pass 0 for none) or NULL if the file is not found, or its contents are not recognized.
The caller must call unref() on the returned object if it is not null.
◆ makeFromStream() [1/2]
◆ makeFromStream() [2/2]
Create a typeface for the specified stream and TTC index (pass 0 for none) or NULL if the stream is not recognized.
The caller must call unref() on the returned object if it is not null.
◆ matchFamily()
The caller must call unref() on the returned object.
Never returns NULL; will return an empty set if the name is not found.
Passing nullptr as the parameter will return the default system family. Note that most systems don't have a default system family, so passing nullptr will often result in the empty set.
It is possible that this will return a style set not accessible from createStyleSet(int) due to hidden or auto-activated fonts.
◆ matchFamilyStyle()
Find the closest matching typeface to the specified familyName and style and return a ref to it.
The caller must call unref() on the returned object. Will return nullptr if no 'good' match is found.
Passing |nullptr| as the parameter for |familyName| will return the default system font.
It is possible that this will return a style set not accessible from createStyleSet(int) or matchFamily(const char[]) due to hidden or auto-activated fonts.
◆ matchFamilyStyleCharacter()
Use the system fallback to find a typeface for the given character.
Note that bcp47 is a combination of ISO 639, 15924, and 3166-1 codes, so it is fine to just pass a ISO 639 here.
Will return NULL if no family can be found for the character in the system fallback.
Passing |nullptr| as the parameter for |familyName| will return the default system font.
bcp47[0] is the least significant fallback, bcp47[bcp47Count-1] is the most significant. If no specified bcp47 codes match, any font with the requested character will be matched.
◆ onCountFamilies()
virtual int SkFontMgr::onCountFamilies |
( |
| ) |
const |
|
protectedpure virtual |
◆ onCreateStyleSet()
◆ onGetFamilyName()
virtual void SkFontMgr::onGetFamilyName |
( |
int |
index, |
|
|
SkString * |
familyName |
|
) |
| const |
|
protectedpure virtual |
◆ onLegacyMakeTypeface()
◆ onMakeFromData()
◆ onMakeFromFile()
virtual sk_sp<SkTypeface> SkFontMgr::onMakeFromFile |
( |
const char |
path[], |
|
|
int |
ttcIndex |
|
) |
| const |
|
protectedpure virtual |
◆ onMakeFromStreamArgs()
◆ onMakeFromStreamIndex()
◆ onMatchFamily()
May return NULL if the name is not found.
◆ onMatchFamilyStyle()
◆ onMatchFamilyStyleCharacter()
virtual sk_sp<SkTypeface> SkFontMgr::onMatchFamilyStyleCharacter |
( |
const char |
familyName[], |
|
|
const SkFontStyle & |
, |
|
|
const char * |
bcp47[], |
|
|
int |
bcp47Count, |
|
|
SkUnichar |
character |
|
) |
| const |
|
protectedpure virtual |
◆ ref()
void SkRefCntBase::ref |
( |
| ) |
const |
|
inlineinherited |
Increment the reference count.
Must be balanced by a call to unref().
◆ RefDefault()
Return the default fontmgr.
◆ RefEmpty()
◆ unique()
bool SkRefCntBase::unique |
( |
| ) |
const |
|
inlineinherited |
May return true if the caller is the only owner.
Ensures that all previous owner's actions are complete.
◆ unref()
void SkRefCntBase::unref |
( |
| ) |
const |
|
inlineinherited |
Decrement the reference count.
If the reference count is 1 before the decrement, then delete the object. Note that if this is the case, then the object needs to have been allocated via new, and not on the stack.
The documentation for this class was generated from the following file: