afdko icon indicating copy to clipboard operation
afdko copied to clipboard

Port version of nam_getNamedInstancePSName to python

Open skef opened this issue 3 years ago • 0 comments

When hinting instances psautohint issues log messages about particular fonts (when using a "reference" font together with other masters) or instances (when hinting a variable font). In the python prototype I'm currently just using "Model %d instance %d" as the instance name where the first number is the vsindex.

Normally one would expect each instance with a glyph to be among the named instances in fvar, but there may be cases where one is missing. Ideally we would have a python-level function (based on fontTools) that returned:

  1. The name of the instance, if it is in fvar, or
  2. A string with elements corresponding to each axis in order, using the name of the position on that axis in STAT if present and a user-space value otherwise.

For whatever reason fontTools doesn't have much plumbing for this at present. I didn't even find an "unnormalize location" function to go from normalized space back to user space. So this might also be something to add to fontTools and use from there.

skef avatar Mar 30 '22 11:03 skef