Can anyone recommend the best app that would allow me to edit (batch process?) completed .ufo and .otf files?
I'm interested in being able to do something to the effect of 'find and replace' for font naming (and maybe other metadata) quickly and painlessly. Is there an app that would allow me to 'open up the hood' so-to-speak on said files and make changes, save etc.?
I'm going to have a bunch of files that will potentially need the naming changed from their temporary names to finalized font names.
0
Comments
1. Download https://github.com/behdad/fonttools/archive/master.zip
2. Follow the instructions for fontTools given on http://store.fontlab.com/index.php?option=com_fss&view=kb&Itemid=431&kbartid=13
Once you've installed fontTools/TTX, you can use it in commandline such as this:
ttx -t name -t 'CFF ' yourfont.otf
You'll get a yourfont.ttx file which is an XML file containing the "name" and "CFF " tables that have the font names. Open it in a text editor, search-and-replace, then do
ttx -m yourfont.otf yourfont.ttx
You'll get a yourfont#1.otf file which will contain the new naming.
Even simpler, you can first just do
ttx yourfont.otf
and you'll get a yourfont.ttx which contains the entire font in XML format. Do your edits there and run
ttx yourfont.ttx
to get a new yourfont#1.otf.
The first method (just converting specific tables) is a bit more "secure" since you'll unlikely screw up anything else in the font.
My tool:
https://github.com/twardoch/fonttools-utils/tree/master/pyftfeatfreeze
can also be used for just renaming the internal font names, like here:
pyftfeatfreeze.py -R 'Lato/Otal' Lato-Regular.ttf Otal-Regular.ttf
In the -R option, you can supply a list of comma-separated search and replace string pairs: 'search1/replace1,search2/replace2,...' . You separate the search string from the replace string by /, and all comma-separated pairs are executed one after another.
Best,
Adam
for pyftfeatfreeze, I specifically made the search-replace function to work on substrings so spaces can be taken out of the equation. For example, the full name may be "Lato Pro Bold" and the PS namy may be "LatoPro-Bold". I could specify -R 'Lato Pro/Otal Com,LatoPro/OtalCom' but perhaps it's better to just do -R 'Lato/Otal' or -R 'Lato/LatoCust'.
Beware of situations like, in the above case, -R 'Lato/Lato Cust'. This will inadvertently insert a space into the PS name (so it'll become "Lato CustPro-Bold" which is invalid. (I'll probably fix that so spaces are always removed when needed).
But there is a special -S -U 'Cust' method that appends a suffix. That one is done intelligently i.e. the suffix may contain spaces and they will be stripped off when needed. You can use -S -U together with -R.
The OpenType features are in the GSUB and GPOS tables. The compiled structure of OT features takes a bit of getting used to, especially if you’re primarily accustomed to working with the Adobe syntax of an uncompiled .fea file.
You can learn more about the structure of an OpenType font by reading the OT spec documentation.
The OT {kern} feature data will be in the GPOS table. If there is a top-level <kern> table in your ttx file, that is the legacy, flat kerning table.
Your second best bet is DTL OTMaster, which can be purchased from FontLab Ltd.’s webshop. Adam can tell you more about it.
There are a number of OTM users here on TD, and perhaps some of them are willing to share their experiences with you.
Sometimes I feel OTM is too ‘secure’, especially when it prevents editing of some name records, unless I change a name in a related table first. Hey, let me screw up my fonts if I want to. Maybe a checkbox
☑️ I know what I’m doing
would be nice
What would you like to batch-process exactly?
Aye Aye Sir! We will add a preference setting for screwing up fonts! At least for the CFF-FontName <–> PS Name & the Windows Full name entries.