adobe-type-tools / afdko

Adobe Font Development Kit for OpenType
https://adobe-type-tools.github.io/afdko/
Other
1.06k stars 167 forks source link

[hotconv] negative TypoLineGap warning checks TypoAscender #1653

Closed NSGod closed 1 year ago

NSGod commented 1 year ago

In c/makeotf/lib/hotconv/hot.c is the following code starting at line 760:

    if (!OVERRIDE(font->TypoLineGap)) {
        font->TypoLineGap = IS_CID(g)
                                ? font->TypoAscender - font->TypoDescender
                                : EM_SCALE(1200) - font->TypoAscender + font->TypoDescender;
    }

    /* warn if the line gap is negative. */
    if (font->TypoAscender < 0) {
        hotMsg(g, hotWARNING, "The feature file OS/2 override TypoLineGap value is negative!");
    }

It looks like it's supposed to be checking the line gap and warning if it's negative, but it's actually checking font->TypoAscender < 0 not font->TypoLineGap < 0.