textlayout_TypefaceFontProvider
- class textlayout_TypefaceFontProvider
Methods
New_Custom_Directory(dir: str) -> skia.FontMgr
RefDefault() -> skia.FontMgr
__init__(self: skia.textlayout_TypefaceFontProvider) -> None
countFamilies(self: skia.FontMgr) -> int
createStyleSet(self: skia.FontMgr, index: int) -> skia.FontStyleSet
getFamilyName(self: skia.FontMgr, index: int) -> str
legacyMakeTypeface(self: skia.FontMgr, familyName: str, style: skia.FontStyle) -> skia.Typeface
makeFromData(self: skia.FontMgr, data: skia.Data, ttcIndex: int = 0) -> skia.Typeface
makeFromFile(self: skia.FontMgr, path: str, ttcIndex: int = 0) -> skia.Typeface
matchFamily(self: skia.FontMgr, familyName: str) -> skia.FontStyleSet
matchFamilyStyle(self: skia.FontMgr, familyName: object, style: skia.FontStyle) -> skia.Typeface
matchFamilyStyleCharacter(self: skia.FontMgr, familyName: str, style: skia.FontStyle, bcp47: list[str], character: int) -> skia.Typeface
ref(self: skia.RefCntBase) -> None
unique(self: skia.RefCntBase) -> bool
unref(self: skia.RefCntBase) -> None
Methods
- static textlayout_TypefaceFontProvider.New_Custom_Directory(dir: str) skia.FontMgr
Create a custom font manager which scans a given directory for font files. This font manager uses FreeType for rendering.
- static textlayout_TypefaceFontProvider.New_Custom_Empty(*args, **kwargs)
Overloaded function.
New_Custom_Empty() -> skia.FontMgr
New_Custom_Empty(filename: str) -> skia.FontMgr
New_Custom_Empty(data: skia.Data) -> skia.FontMgr
- textlayout_TypefaceFontProvider.OneFontMgr()
New_Custom_Empty(*args, **kwargs) Overloaded function.
New_Custom_Empty() -> skia.FontMgr
New_Custom_Empty(filename: str) -> skia.FontMgr
New_Custom_Empty(data: skia.Data) -> skia.FontMgr
- static textlayout_TypefaceFontProvider.RefDefault() skia.FontMgr
Return the default fontmgr.
- textlayout_TypefaceFontProvider.__init__(self: skia.textlayout_TypefaceFontProvider) None
- textlayout_TypefaceFontProvider.countFamilies(self: skia.FontMgr) int
- textlayout_TypefaceFontProvider.createStyleSet(self: skia.FontMgr, index: int) skia.FontStyleSet
- textlayout_TypefaceFontProvider.getFamilyName(self: skia.FontMgr, index: int) str
- textlayout_TypefaceFontProvider.legacyMakeTypeface(self: skia.FontMgr, familyName: str, style: skia.FontStyle) skia.Typeface
- textlayout_TypefaceFontProvider.makeFromData(self: skia.FontMgr, data: skia.Data, ttcIndex: int = 0) skia.Typeface
Create a typeface for the specified data and TTC index (pass 0 for none) or NULL if the data is not recognized.
- textlayout_TypefaceFontProvider.makeFromFile(self: skia.FontMgr, path: str, ttcIndex: int = 0) skia.Typeface
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.
- textlayout_TypefaceFontProvider.matchFamily(self: skia.FontMgr, familyName: str) skia.FontStyleSet
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.
- textlayout_TypefaceFontProvider.matchFamilyStyle(self: skia.FontMgr, familyName: object, style: skia.FontStyle) skia.Typeface
Find the closest matching typeface to the specified familyName and style and return a ref to it.
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.
- textlayout_TypefaceFontProvider.matchFamilyStyleCharacter(self: skia.FontMgr, familyName: str, style: skia.FontStyle, bcp47: list[str], character: int) skia.Typeface
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.
- textlayout_TypefaceFontProvider.ref(self: skia.RefCntBase) None
Increment the reference count.
Must be balanced by a call to
unref()
.
- textlayout_TypefaceFontProvider.registerTypeface(*args, **kwargs)
Overloaded function.
registerTypeface(self: skia.textlayout_TypefaceFontProvider, typeface: skia.Typeface) -> int
registerTypeface(self: skia.textlayout_TypefaceFontProvider, typeface: skia.Typeface, alias: skia.String) -> int
- textlayout_TypefaceFontProvider.unique(self: skia.RefCntBase) bool
May return true if the caller is the only owner.
Ensures that all previous owner’s actions are complete.
- textlayout_TypefaceFontProvider.unref(self: skia.RefCntBase) None
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.