MCPcopy
hub / github.com/arrowtype/recursive / setVersion

Function setVersion

mastering/prep_fonts.py:307–327  ·  view source on GitHub ↗

Sets the `versionMajor` and `versionMinor` for a `list` of fonts. *fonts* is a `list` of font objects (Defcon or FontParts). *version* is a `string` of the version number for the fonts

(fonts, version)

Source from the content-addressed store, hash-verified

305
306
307def setVersion(fonts, version):
308 """
309 Sets the `versionMajor` and `versionMinor` for a `list` of fonts.
310
311 *fonts* is a `list` of font objects (Defcon or FontParts).
312 *version* is a `string` of the version number for the fonts
313 """
314
315 if len(version.split(".")) > 2:
316 raise ValueError
317
318 version = version.split(".")
319 versionMajor = int(version[0])
320 try:
321 versionMinor = int(version[1])
322 except IndexError:
323 versionMinor = 0
324
325 for font in fonts:
326 font.info.versionMajor = versionMajor
327 font.info.versionMinor = versionMinor
328
329
330def checkName(name, mapping):

Callers 1

prepFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected