fontforge / fontforge

Free (libre) font editor for Windows, Mac OS X and GNU+Linux
http://fontforge.github.io/
Other
6.57k stars 707 forks source link

Support 'Adobe friendly names' #2011

Open adrientetar opened 9 years ago

adrientetar commented 9 years ago

The default GlyphOrderAndAliasDB of the AFDKO has some friendly development names instead of uniXXXX names, swapped at compile time. We should support this.

adrientetar commented 9 years ago

Here is how to dump a GlyphOrderAndAliasDB:

font = fontforge.activeFont()

for glyph in font.glyphs():
    print("{} {}".format(glyph.glyphname, glyph.glyphname))
davelab6 commented 9 years ago

@adrientetar I couldn't find a GlyphOrderAndAliasDB in the fdk repo, https://github.com/adobe-type-tools/afdko/blob/master/FDK/Tools/SharedData/FDKScripts/MakeOTF.py#L26-L30 mentions where it looks for one.... where is this default?

adrientetar commented 9 years ago

Couldn't find it either back when I started this (@MiguelSousa: any idea?).

The problem with the script I posted is that it doesn't really output the glyphs in the order of the program.
Also when I tried to dump a .nam encoding file ut only output 3xx glyphs while I have 636 in my font.

miguelsousa commented 9 years ago

@adrientetar @davelab6 Not sure why you're looking for a GlyphOrderAndAliasDB file in the FDK repo. Each font family needs to have its own, just like any other files required for running makeotf on a given project.

adrientetar commented 9 years ago

@miguelsousa

the sub-directory "SharedData", a directory tree containing shared data files used by various tools. The "GlyphOrderAndAliasDB" file is also an example file for making your own for use with makeotf. This, however, can be used as is, and contains the mappings used by Adobe fonts."

http://www.adobe.com/jp/devnet/opentype/afdko/topic_overview.html

miguelsousa commented 9 years ago

@adrientetar Got question?

adrientetar commented 9 years ago

@miguelsousa Haven't found that example GlyphOrderAndAliasDB mentioned in this document so far, so my question is, does it exist and if not, why does Adobe's documentation mention something that does not actually exist?

miguelsousa commented 9 years ago

@adrientetar When I follow that link I'm redirected to http://www.adobe.com/devnet/opentype/afdko/topic_overview.html which has no reference to GlyphOrderAndAliasDB. You must be looking at an outdated page.

In any case, it sounds like that file was supposed to be an example. If you're looking for an example you can find one at https://github.com/adobe-fonts/source-sans-pro/blob/master/Roman/GlyphOrderAndAliasDB

As I mentioned before, each font family needs to have its own GlyphOrderAndAliasDB file. Each font developer can define its own "friendly glyph names" (2nd column of the GlyphOrderAndAliasDB). The only requirement is to use standard glyph names in the 1st column of the GlyphOrderAndAliasDB, as these are the names that will be used in the compiled font.

In our projects at Adobe we use the names listed by https://github.com/adobe-type-tools/afdko/blob/master/FDK/Tools/SharedData/AGD.txt BUT these friendly names are not standard and can change without notice.

frank-trampe commented 9 years ago

@adrientetar, is there any action required on this?

adrientetar commented 9 years ago

Nothing required, it was just that it would be nice to support Adobe’s naming scheme (AGD.txt) for developers but it would warrant some maintenance in case some mapping changes and is just a naming convenience. So no big deal.