varLib¶
Module for dealing with ‘gvar’-style font variations, also known as run-time interpolation.
The ideas here are very similar to MutatorMath. There is even code to read MutatorMath .designspace files in the varLib.designspace module.
For now, if you run this file on a designspace file, it tries to find ttf-interpolatable files for the masters and build a variable-font from them. Such ttf-interpolatable and designspace files can be generated from a Glyphs source, eg., using noto-source as an example:
$ fontmake -o ttf-interpolatable -g NotoSansArabic-MM.glyphs
Then you can make a variable-font this way:
$ fonttools varLib master_ufo/NotoSansArabic.designspace
API will change in near future.
-
fontTools.varLib.
build
(designspace_filename, master_finder=<function <lambda>>, exclude=[], optimize=True)[source]¶ Build variation font from a designspace file.
If master_finder is set, it should be a callable that takes master filename as found in designspace file and map it to master font binary as to be opened (eg. .ttf or .otf).