afdko icon indicating copy to clipboard operation
afdko copied to clipboard

otfstemhist results not useable if no processed layer exists

Open frankrolf opened this issue 5 years ago • 2 comments

When running psstemhist on a UFO with overlapping contours in the default layer and no processed layer present, the results created are not useful – see attached text files for comparison.

Proposal:

  • Option 1: alert the user if no processed layer exists and quit
  • Option 2: create the processed layer on the fly, and run psstemhist on that data. Ideally this would happen with a dummy UFO file which is discarded afterwards.

I would personally prefer option 2, but can understand if that’s too much overhead.

SourceSerif_c1.ufo.vstm overlap.txt

SourceSerif_c1.ufo.vstm merged.txt

frankrolf avatar Jun 03 '20 11:06 frankrolf

We should decide how this should work. Since otfautohint can now hint glyphs with overlap we can probably just run that algorithm and then the stemhist stuff and there would be no need to store the data temporarily in the filesystem.

skef avatar Aug 14 '23 21:08 skef

I think this is basically fixed. By default, when hinting a VF we process the glyphs to remove overlap, use that glyph to extract candidate stems, and then back-map those stems to the original glyph. We don't do that by default with static instances, including UFOs, but otfautohint has the option to force that processing.

The same option exists in otfstemhist. So if you just force overlap processing in this scenario you should get what you want.

skef avatar Nov 05 '23 17:11 skef