When i generate a font using makeotf directly or robofont, it adds in a Version string (see the attached screenshot) the versions of each library that built the font (in this case, makeotflib, hotconv, et al).
What i would like to do is specify a version string on generation (or even after the fact, whatever), but i don't actually know how to modify this field for a generated font. I suspect this is a trivial operation, but it is eluding me.
primarily, i would like to be able to tag a release with a short hg or git commit hash so i can see how old an installed version is when i switch to a new computer or ask a friend if they have the latest version. right now, i have to look at the file creation date and sorta just guess, but i'd rather command-i the file and be able to see how aged the file is.
thanks for any help.
0
Comments
ttx [drag&drop .otf/.ttf file here]
to create an XML representation of the font. This is a file named like the original font but with a .ttx suffix. Search for
namerecord nameID="5"
and adjust the value. Then use the same command
ttx [drag&drop .ttx file here]
to create a binary font again.
You can also use FontTools to access font data via FontTools' API, avoiding the XML roundtrip.
So, unless you have a very good reason to remove it, don't.
still, i am slightly skeptical of this rationale only because the last two fonts i purchased, from font bureau and typotheque both have their versions set to something like "Version 1.0" and "Version 1.0; 2009" respectively. what's up with that?
font.naked().version
to a version string, and it will carry through to a font that is generated directly from Fontlab (= will be visible as the version in the info box in the Finder, and in Font Book). IIRC Robofab does not expose this field directly (that's why you have to usenaked()
). But there are other places version information is stored that you might want to keep consistent: I also use the version as part of thefont.info.openTypeNameUniqueID
.ttx foo.otf
. From there, you can run it, as below, and you'll get back afoo-hash.ttx
file that you can run ttx on, again, to get your new ttf/otf file which has a correctly formatted version string.you can feel free to modify this as you see fit (or whatever). much of the code, as you can see, is spent juggling filenames, so you could conceivably work this into some more complex post-processing workflow if that's your thing.