-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[makeotf] PUA unicodes automatically assigned to /dieresisacute and /dieresisgrave #1662
Comments
Two ways to get around this:
|
Thanks for the example. I wish there was a way to disable any of this automatic mapping when a GlyphOrderAndAliasDB file is supplied during compilation. At least it would be helpful if makeotf would report automatic mapping during compilation. Now we suddenly ended up with a font containing PUA unicodes where we had no idea where they came from. And subsequently a faulty font because the OS/2 unicode ranges did not have a flag for the PUA range. |
I think this might be a “careful what you wish for” kind of situation – the AGD mapping is also the reason for glyph names like Of course, it’s odd that the AGD would map to PUA, not sure what the reason for that originally was. I made a little script for you to verify which glyphs go through the AGD: from afdko import agd, fdkutils
from pathlib import Path
f = CurrentFont()
agd_txt = Path(fdkutils.get_resources_dir()) / 'AGD.txt'
with open(agd_txt, "r") as agd_blob:
agd_data = agd_blob.read()
agd_dict = agd.dictionary(agd_data) # this is called dictionary but doesn’t seem to be a proper dict object :-/
for gname in f.templateGlyphOrder:
agd_glyph = agd_dict.glyphs.get(gname)
if agd_glyph:
print(agd_glyph.uni, gname)
else:
print('not in AGD', gname) in a UFO containing
|
In our workflow we always create our own GlyphOrderAndAliasDB files based on the actual mapping in the source files themselves. Therefore glyphs such as |
I am not sure what this comment implies. What does your GlyphOrderAndAliasDB look like? |
What I meant is that each font gets its own GlyphOrderAndAliasDB file which is dynamically generated when exporting FDK files. The content of that file is based on the name and unicode mapping in the source file (which can be a FontLab or UFO file). Below is the one from IBM Plex Sans Bold, for example.
|
Thank you for the example, I get it now. You probably are aware of all the following, but I’ll do a run-down for everyone else reading this issue: How does the GlyphOrderAndAliasDB work?The GlyphOrderAndAliasDB is basically a spreadsheet. Each entry can have up to three columns, with the 3rd being optional. The column order is as follows:
final nameThis is the name which ends up in the font file. This name used to carry meaning (especially in pre-Unicode times), but modern software should really not rely on glyph names for text layout. Therefore, the importance of this name within the font file is low. However,
“friendly” or human-readable nameThis is the name we deal with in the font editor, in OT feature code, kerning, etc. Note that the characters which can be used here are relaxed in comparison to the final name (hyphens are allowed, for example). Unicode overrideThis optional column allows assigning a code point that’s different from the ones auto-assigned or implied by example for assigning a different code point:
The .sups suffix implies an alternate glyph, which example for assigning multiple code points:
In this case, the space will act as normal and non-breaking space; the hyphen will be used (in addition to the default hyphen) for non-breaking hyphen, soft hyphen, and “hyphen-minus” as well. The benefit here is that there’s no possibility for advance widths going out of sync – also, the feature code is simplified. example for assigning no code point:
This is a feature I wasn’t aware of before embarking on this issue – and it is the answer to the question “Is there a way to disable any of this automatic mapping” Analysis of supplied GlyphOrderAndAliasDBWith all the above in mind, here’s an unsolicited review of the supplied GlyphOrderAndAliasDB file:
This won’t hurt, but the same can be achieved via
or even
This …
… is equivalent to …
… and could be made more user-friendly by doing something like
This …
… could become that
ConclusionThere’s no question that assigning an unexpected PUA code point is annoying. I will remove those from |
Upon a rebuild of the FDK, this should probably address #1662.
When compiling source files with makeotf, glyphs named dieresisacute and dieresisgrave will automatically get PUA unicode values of 0xF6D7 and 0xF6D8.
The supplied GlyphOrderAndAliasDB file does not specify any unicode value for these glyphs and that's also what we expect to be in the generated fonts:
Is there a way to disable any of this automatic mapping by makeotf?
The text was updated successfully, but these errors were encountered: