animator.skia.Typeface

class animator.skia.Typeface

Bases: pybind11_builtins.pybind11_object

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: animator.skia.Typeface) -> None

Returns the default normal typeface.

  1. __init__(self: animator.skia.Typeface, familyName: Optional[str], fontStyle: animator.skia.FontStyle = <animator.skia.FontStyle object at 0x7f20529b86b0>) -> None

Creates a new reference to the typeface that most closely matches the requested familyName and fontStyle.

Methods

Equal(facea, faceb)

MakeDefault()

MakeDeserialize(data)

Given the data previously written by serialize(), return a new instance of a typeface referring to the same font.

MakeFromData(data[, index])

MakeFromFile(path[, index])

MakeFromName(familyName, fontStyle)

UniqueID(face)

__init__(*args, **kwargs)

Overloaded function.

copyTableData(self, tag)

countGlyphs(self)

countTables(self)

createFamilyNameIterator(self)

Returns an iterator which returns tuple of (family name, language) specified by the font.

fontStyle(self)

getBounds(self)

getFamilyName(self)

Returns the family name for this typeface.

getFamilyNames(self)

Returns a list of tuple of (family name, language) specified by the font.

getKerningPairAdjustments(self, glyphs)

Given a run of glyphs, return the associated horizontal adjustments.

getPostScriptName(self)

Returns the PostScript name for this typeface.

getTableData(self, tag[, offset, length])

Returns the contents of a table.

getTableSize(self, tag)

getTableTags(self)

Returns the list of table tags in the font.

getUnitsPerEm(self)

getVariationDesignParameters(self)

Returns the design variation parameters.

getVariationDesignPosition(self)

Returns the design variation coordinates.

isBold(self)

isFixedPitch(self)

isItalic(self)

makeClone(self, fontArguments)

serialize(self, behavior)

textToGlyphs(self, text, encoding)

Given a string, return its corresponding glyph IDs.

unicharToGlyph(self, unichar)

unicharsToGlyphs(self, uni)

Given an array of UTF32 character codes, return their corresponding glyph IDs.

uniqueID(self)

static Equal(facea: animator.skia.Typeface, faceb: animator.skia.Typeface) bool
static MakeDefault() animator.skia.Typeface
static MakeDeserialize(data: animator.skia.Data) animator.skia.Typeface

Given the data previously written by serialize(), return a new instance of a typeface referring to the same font.

static MakeFromData(data: animator.skia.Data, index: int = 0) animator.skia.Typeface
static MakeFromFile(path: str, index: int = 0) animator.skia.Typeface
static MakeFromName(familyName: Optional[str], fontStyle: animator.skia.FontStyle = <animator.skia.FontStyle object at 0x7f2052985b30>) animator.skia.Typeface
class SerializeBehavior

Bases: pybind11_builtins.pybind11_object

Members:

kDoIncludeData

kDontIncludeData

kIncludeDataIfLocal

property name
static UniqueID(face: animator.skia.Typeface) int
copyTableData(self: animator.skia.Typeface, tag: int) animator.skia.Data
countGlyphs(self: animator.skia.Typeface) int
countTables(self: animator.skia.Typeface) int
createFamilyNameIterator(self: animator.skia.Typeface) animator.skia.Typeface.LocalizedStrings

Returns an iterator which returns tuple of (family name, language) specified by the font.

Warning

Please use getFamilyNames() instead which returns a list instead of an iterator. There’s probably a memory leak in this method, but I don’t know how to fix it.

fontStyle(self: animator.skia.Typeface) animator.skia.FontStyle
getBounds(self: animator.skia.Typeface) animator.skia.Rect
getFamilyName(self: animator.skia.Typeface) str

Returns the family name for this typeface.

getFamilyNames(self: animator.skia.Typeface) list

Returns a list of tuple of (family name, language) specified by the font.

getKerningPairAdjustments(self: animator.skia.Typeface, glyphs: List[int]) Optional[List[int]]

Given a run of glyphs, return the associated horizontal adjustments.

getPostScriptName(self: animator.skia.Typeface) str

Returns the PostScript name for this typeface.

getTableData(self: animator.skia.Typeface, tag: int, offset: int = 0, length: int = - 1) bytes

Returns the contents of a table.

Parameters
  • tag – The table tag whose contents are to be copied.

  • offset – The offset into the table at which to start copying.

  • length – The number of bytes to copy. If this is negative, the entire table is copied.

Returns

table contents

getTableSize(self: animator.skia.Typeface, tag: int) int
getTableTags(self: animator.skia.Typeface) List[int]

Returns the list of table tags in the font.

getUnitsPerEm(self: animator.skia.Typeface) int
getVariationDesignParameters(self: animator.skia.Typeface) List[animator.skia.FontParameters.Variation.Axis]

Returns the design variation parameters.

getVariationDesignPosition(self: animator.skia.Typeface) animator.skia.FontArguments.VariationPosition.CoordinateVector

Returns the design variation coordinates.

isBold(self: animator.skia.Typeface) bool
isFixedPitch(self: animator.skia.Typeface) bool
isItalic(self: animator.skia.Typeface) bool
makeClone(self: animator.skia.Typeface, fontArguments: animator.skia.FontArguments) animator.skia.Typeface
serialize(self: animator.skia.Typeface, behavior: animator.skia.Typeface.SerializeBehavior = <SerializeBehavior.kIncludeDataIfLocal: 2>) animator.skia.Data
textToGlyphs(self: animator.skia.Typeface, text: str, encoding: animator.skia.TextEncoding = <TextEncoding.kUTF8: 0>) List[int]

Given a string, return its corresponding glyph IDs.

Parameters
  • text – the text string.

  • encoding – the text encoding.

Returns

the corresponding glyph IDs for each character.

unicharToGlyph(self: animator.skia.Typeface, unichar: int) int
unicharsToGlyphs(self: animator.skia.Typeface, uni: List[int]) List[int]

Given an array of UTF32 character codes, return their corresponding glyph IDs.

Parameters

chars – the array of UTF32 chars.

Returns

the corresponding glyph IDs for each character.

uniqueID(self: animator.skia.Typeface) int