UFO Import: PostScript hints?

Does Glyphs import PostScript glyph hints from UFOs at all? If so, which formats/lib keys is the data expected to be in?

  • com.adobe.type.autohint (vfb2ufo) is ignored
  • com.adobe.type.autohint.v2 (Adobe FDK) is ignored
  • public.postscript.hints (UFO spec) is ignored

I tried to find out by exporting a hinted UFO from Glyphs, but it seems hinting is not exported at all :wink:

I forgot that I already had a script for applying PS hints from an imported UFO. I just updated it to use the current com.adobe.type.autohint.v2 data format: https://github.com/jenskutilek/Glyphs-Scripts/blob/master/Hinting/Apply%20UFO%20PS%20Hints.py

@jkutilek I also noticed that when imported UFO. Hints are there, but they are not imported.

Jens, with that script, will the hints from UFO be tied to the nodes, or will they be just presented but untied, as in the exported .otf files?

The script will tie them to the nodes. Hints that can’t be assigned to a node will be deleted, but the script will print a warning about the affected hints.

1 Like

Cool, I’ll remember it for the future.

The problem is only how to pull the hints out of the depths of the UFO file to make them visible in Glyphs after import? Hints are presented there but doesn’t survive the import. This is what you mentioned at the start of topic.

Can you give me an example file. Then I’ll see what I can do. I just had a look at the spec and I have some questions.

Pulling the hints from the depths of the UFO is exactly what my script does.

The hints are stored in my UFO in the glyph lib, under the com.adobe.type.autohint.v2 key. On import in Glyphs, the lib contents is stored in GSLayer.userData. From there, my script converts the data into actual hints that are shown and can be edited in the Glyphs interface.

But it requires the hints to be in the com.adobe.type.autohint.v2 key and data format, which is an invention of Adobe and not part of the UFO standard.

@michaelrafailyk how did you generate your UFO? Different apps may be following different standards …

@GeorgSeifert Just sent the file to email.

Oh, I apologize, didn’t realize I need to select the glyphs in a Font window before running the script. It works awesome Jens!

Oh, sorry, yes you need to select the glyphs which should be processed.

I just updated my script to also look in the public.postscript.hints field, which is what the FontLab 8 UFO export uses.

Attached are two UFOs, one exported from FontLab 8, and one from a FontLab 5 VFB converted with vfbLib/vfb3ufo.

PSHints.zip (12.7 KB)