Hello, I was wondering about the nomenclature of OTF/TTF vs. CFF/TT. For instance.generate(), the Format argument only accepts OTF/TTF, but as pointed out in Can I export variable fonts as OTF files instead of TTF files? - #3 by GeorgSeifert, this describes the file extension (and, de facto, the outline flavour, but that is not necessarily the same). Would it make sense to accept CFF/TT as values for the Format argument as well (or add a new Flavour argument)?
I would imagine that, if I pass Format=CFF, the file extension would default to .otf, and likewise for TT.
No, I am happy with Glyphs’ behaviour. Just for the sake of accuracy/consistency, I prefer using CFF/TT instead of OTF/TTF as my flavour keywords. Since instance.generate() doesn’t accept a Flavour argument (which is fine), I need to translate between the two schemes in my plugin, which is a source for errors. So I wanted to suggest accepting CFF/TT as values for the Format argument as well.
Thank you!
Maybe an extra Flavour (or, since you use American English, Flavor) keyword argument would be best. If only the flavour is passed, TT sets the Format to TTF, and CFF sets it to OTF.
If both are passed, and the combination is not possible (such as Flavour=CFF and Format=TTF), then the method could return an Error.
I would not error in that case. There are legitimate, while rare, use cases for packaging CFF/TT outlines with a TTF/OTF file extension. (Software that only allows one type of font file extension but internally forwards the font file to a text system that can handle both flavors.)
Some apps reject font files ending in “.otf” and only accept “.ttf”, but that is overly conservative since the library they use for font processing handles both. That might be a use case where you want to vend CFF/PS/OTF files with a “.ttf” file name extension.
I think I just “switch” to CFF/TT instead of OTF/TTF (supporting the old values for compatibility). It needs a really strong use case to persuade me to add a “file extension” parameter.
Is that really sensible, though? The format is still OTF/TTF, the flavour is CFF/TT. Using CFF/TT as the expected values for Format is slightly inaccurate (at least less accurate than the current implementation).