Closed robmck-ms closed 8 years ago
Thanks Rob.
ySubscript, ySuperscript, yStrikeout* should now be set by ufo2ft. I'd recommend setting unicode ranges in Glyphs/UFO sources themselves (the AFDKO uses a rough heuristic to set them anyways: https://github.com/adobe-type-tools/afdko/blob/0dd483454f2f8cf9e03802bc1350985452071f5b/FDK/Tools/Programs/makeotf/makeotf_lib/source/hotconv/map.c#L1744)
@jamesgk the fonttools' OS/2 table module has a recalcUnicodeRanges
function, in case you didn't know. It simply sets the ulUnicodeRange*
bits if there is any intersection (at least one character) between the OS/2 block ranges and the Unicode cmap subtables in the font.
It also contains the unicode ranges data from the OT spec in case one wants to use a different algorithm.
Oh! That sounds useful. Though, I'm not really sure how to use it in ufo2ft. We'd have to call it after the outline is compiled, but only if the existing ranges are all blank? Not sure if that's necessarily a good idea but I'm open to it.
Thanks!
Usually, Glyphs figures out unicode ranges for you, so I suspect most people to leave it unset in Glyphs. Might be nice in the long term to auto-calculate it. For now, I'll manually set it.
We'd have to call it after the outline is compiled, but only if the existing ranges are all blank?
Can we just recalculate all the time? Arguably the data in the source shouldn't be discarded, but I can't see why one would want this data different for the actual glyph coverage in the font.
Because there's no unanimous agreement on how those bits should be calculated. For the fonttools subsetter (the tool for which that feature was added) we ended up only un-setting the ones for which there are no characters left after subsetting. As for when one should set them on, the spec says it is left to "designer".
The turn-them-on-if-at-east-one-is-present rule comes from FontLab, and it's the one I personally prefer.
Does any software make use of ulUnicodeRange anyway?
cc @twardoch
Usually, Glyphs figures out unicode ranges for you
@schriftgestalt I'm curious, how does Glyphs calculates OS/2 Unicode ranges?
Glyphs isn't doing it, it's makeOTF.
Good to know, thanks.
Using https://github.com/googlei18n/fontmake/ to dump a Glyphs file to TTF, most OS/2 table values are zeroed. e.g. unicode ranges, ySubscript, ySuperscript, yStrikeout*, etc. Though, I notice that the UFOs don't have these either.
Filing the issue here per Behdad's suggestion.