Hi!
Is it possible to remap the font weights of a OT Var font?
This would help me to set range from 100 to 900, as the CSS standard weight class.
In a .designspace file it would be something like:
What you want to change is the MaxValue of an Axis definition inside the fvar table.
Easiest way to do this is with OTMaster. It has a straight forward UI, you open the font, look for fvar, open its Axis definitions, and change the MaxValue entries, and save the file, done.
If you want to do it with ttx, you furst need to take the hurdle of installing fonttools. Best guess is to paste this in Terminal, and to hope it works:
python3 -m pip install fonttools
This makes a command called ttx available, which can convert your OpenType font into XML and back again.
So, first, you need to extract the fvar table. cd into the same directory as your font, and use this: ttx -t fvar "font.ttf"
Instead of font.ttf, use the name of the font file. (Hint: you can also drag and drop into the Terminal window.)
Open the resulting .ttx file in your favorite plaintext editor (I recommend Sublime Text, TextMate, BBEdit or Atom), look for the <MaxValue> tag, and change the value there. Save the file again.
Merge (-m) the .ttx back into the .ttf: ttx -m "font.ttf" -o "font.ttf" font.ttx
The -o option overwrites the existing file, rather than creating another copy.
Now the .ttf should have a new maximum for the respective axis.
You can add an avar table by adding an âAxis Mappingsâ custom parameter in File â Font Info⌠â Font. See the variable fonts tutorial for details:
But a lot of times, instead of adding an âAxis Mappingsâ parameter on the font, it is easier to add an âAxis Locationâ parameter in each instance.
I think is otherwise, in a font that has 6, 8 masters having to set up this on every master is annoying while in Axis mappings yo do it all at once.
Also in Axis Location parameter dialog the tab key to switch to other field doesnât work. So you need to click and type insteead of only use the keyboard.
In addtion I think it will be handy if the initial values will not be zero but the âcurrent master locationâ, because most of the times you only need to map only one axis, typically the weight.