ttGlyphSet: GlyphSets returned by a TTFont object

Overview

The fontTools.ttLib.ttGlyphSet module is a helper for fontTools.ttLib.

Most users will not need to access this module directly. Instead, the glyphs in a font are accessible as a .glyphSet dictionary in a TTFont instance.

GlyphSets returned by a TTFont.

class fontTools.ttLib.ttGlyphSet._TTGlyphSet(font, location, glyphsMapping, *, recalcBounds=True)[source]

Bases: Mapping

Generic dict-like GlyphSet class that pulls metrics from hmtx and glyph shape from TrueType or CFF.

pushLocation(location, reset: bool)[source]
pushDepth()[source]
has_key(glyphName)[source]
_abc_impl = <_abc._abc_data object>
class fontTools.ttLib.ttGlyphSet._TTGlyphSetGlyf(font, location, recalcBounds=True)[source]

Bases: _TTGlyphSet

_abc_impl = <_abc._abc_data object>
class fontTools.ttLib.ttGlyphSet._TTGlyphSetCFF(font, location)[source]

Bases: _TTGlyphSet

setLocation(location)[source]
pushLocation(location, reset: bool)[source]
_abc_impl = <_abc._abc_data object>
class fontTools.ttLib.ttGlyphSet._TTGlyphSetVARC(font, location, glyphSet)[source]

Bases: _TTGlyphSet

_abc_impl = <_abc._abc_data object>
class fontTools.ttLib.ttGlyphSet._TTGlyph(glyphSet, glyphName, *, recalcBounds=True)[source]

Bases: ABC

Glyph object that supports the Pen protocol, meaning that it has .draw() and .drawPoints() methods that take a pen object as their only argument. Additionally there are ‘width’ and ‘lsb’ attributes, read from the ‘hmtx’ table.

If the font contains a ‘vmtx’ table, there will also be ‘height’ and ‘tsb’ attributes.

abstract draw(pen)[source]

Draw the glyph onto pen. See fontTools.pens.basePen for details how that works.

drawPoints(pen)[source]

Draw the glyph onto pen. See fontTools.pens.pointPen for details how that works.

_abc_impl = <_abc._abc_data object>
class fontTools.ttLib.ttGlyphSet._TTGlyphGlyf(glyphSet, glyphName, *, recalcBounds=True)[source]

Bases: _TTGlyph

draw(pen)[source]

Draw the glyph onto pen. See fontTools.pens.basePen for details how that works.

drawPoints(pen)[source]

Draw the glyph onto pen. See fontTools.pens.pointPen for details how that works.

_getGlyphAndOffset()[source]
_getGlyphInstance()[source]
_abc_impl = <_abc._abc_data object>
class fontTools.ttLib.ttGlyphSet._TTGlyphCFF(glyphSet, glyphName, *, recalcBounds=True)[source]

Bases: _TTGlyph

draw(pen)[source]

Draw the glyph onto pen. See fontTools.pens.basePen for details how that works.

_abc_impl = <_abc._abc_data object>
fontTools.ttLib.ttGlyphSet._evaluateCondition(condition, fvarAxes, location, instancer)[source]
class fontTools.ttLib.ttGlyphSet._TTGlyphVARC(glyphSet, glyphName, *, recalcBounds=True)[source]

Bases: _TTGlyph

_draw(pen, isPointPen)[source]

Draw the glyph onto pen. See fontTools.pens.basePen for details how that works.

draw(pen)[source]
drawPoints(pen)[source]
_abc_impl = <_abc._abc_data object>
fontTools.ttLib.ttGlyphSet._setCoordinates(glyph, coord, glyfTable, *, recalcBounds=True)[source]
class fontTools.ttLib.ttGlyphSet.LerpGlyphSet(glyphset1, glyphset2, factor=0.5)[source]

Bases: Mapping

A glyphset that interpolates between two other glyphsets.

Factor is typically between 0 and 1. 0 means the first glyphset, 1 means the second glyphset, and 0.5 means the average of the two glyphsets. Other values are possible, and can be useful to extrapolate. Defaults to 0.5.

_abc_impl = <_abc._abc_data object>
class fontTools.ttLib.ttGlyphSet.LerpGlyph(glyphname, glyphset)[source]

Bases: object

draw(pen)[source]