afdko icon indicating copy to clipboard operation
afdko copied to clipboard

[spot] alternate metrics ignored in class kern proof

Open takaakifuji opened this issue 2 years ago • 1 comments

We found that some kerning pairs in CJK fonts were printed with no palt applied when generating a PostScript proof with $ spot -P palt,kern font.otf.

  • Steps to reproduce
    1. Grab IBMPlexSansJP-Regular.otf, which comes with class-based kana kerning pairs along with palt/vpal.
    2. Generate a PostScript proof by running $ spot -P palt,kern IBMPlexSansJP-Regular.otf > IBMPlexSansJP-Regular.ps.
    3. Go to p.64 and look for (CID+857) and (CID+635) pair.
  • Expected result
    • For the pair ぐ。, the alternate metrics for both of the characters should be applied.
  • Actual result
    • For the pair ぐ。, the alternate metrics for both of the characters are not applied.

See the following screenshots for better illustration:

Expected Actual
Screenshot 2023-10-25 at 10 58 58 Screenshot 2023-10-25 at 10 59 11

For reference, the following is the result obtained with hb-shape:

$ hb-shape --features='palt,kern' IBMPlexSansJP-Regular.otf 'ぐ。'
[gid857=0@-105,0+785|gid635=1+500]

Applying a patch like this to c/spot/source/GPOS.c should fix this issue, so my speculation is that the code for handling palt is somehow missing for class kerning.

takaakifuji avatar Oct 27 '23 09:10 takaakifuji