MCPcopy Create free account
hub / github.com/PageBot/PageBot / getVariableAxisFonts

Function getVariableAxisFonts

Lib/pagebot/fonttoolbox/variablefontbuilder.py:46–60  ·  view source on GitHub ↗

Answers the two instance fonts located at minValue and maxValue of the axis. If varFont is not a Variable Font, or the axis does not exist in the font, then answer (varFont, varFont).

(varFont, axisName, normalize=True, cached=False,
        lazy=True)

Source from the content-addressed store, hash-verified

44 return getMasterPath() + '_instances/'
45
46def getVariableAxisFonts(varFont, axisName, normalize=True, cached=False,
47 lazy=True):
48 """Answers the two instance fonts located at minValue and maxValue of the
49 axis. If varFont is not a Variable Font, or the axis does not exist in the
50 font, then answer (varFont, varFont)."""
51 if axisName in varFont.axes:
52 minValue, _, maxValue = varFont.axes[axisName]
53 minInstance = getVarFontInstance(varFont, {axisName:minValue},
54 normalize=normalize,
55 cached=cached, lazy=lazy)
56 maxInstance = getVarFontInstance(varFont, {axisName:maxValue},
57 normalize=normalize,
58 cached=cached, lazy=lazy)
59 return minInstance, maxInstance
60 return varFont, varFont
61
62def fitVariableWidth(context, varFont, s, w, fontSize, condensedLocation,
63 wideLocation, fixedSize=True, tracking=None, cached=True, lazy=True):

Callers

nothing calls this directly

Calls 1

getVarFontInstanceFunction · 0.85

Tested by

no test coverage detected