LigatureCaret in FEA wrong syntax

Issue #36 resolved
Georg Mayr-Duffner created an issue

reported by Adam Twardoch at http://sourceforge.net/mailarchive/forum.php?thread_name=CAEozd0yoe6LQmkfbazj96QuHrt4UXGY-ELObGtUwbckUhxgHtQ%40mail.gmail.com&forum_name=fontforge-devel

FontForge currently allows the following syntax in the FEA definition of carets (in the GDEF table definition):

table GDEF {
   LigatureCaret f_f <caret 277>;
   LigatureCaret longs_longs_l <caret 244> <caret 507>;
} GDEF;

The GDEF definition in the FEA spec: http://www.adobe.com/devnet/opentype/afdko/topic_feature_file_syntax.html#9.b is not very well written, but, when reading closely and looking at the examples, the correct syntax should be:

table GDEF {
     LigatureCaretByPos f_f 277;
     LigatureCaretByPos longs_longs_l 244 507;
} GDEF;

I.e. you can use either LigatureCaretByPos or LigatureCaretByIndex keyword, but the "LigatureCaret" keyword has no meaning. Also, the caret positions should be given as simple numbers rather than the <caret ###> syntax which FontForge seems to accept.

The 1st, incorrect, syntax works with FontForge but not with Adobe makeotf. The 2nd, correct, syntax works with Adobe makeotf but doesn't in FontForge. Given that Adobe makeotf is the reference implementation, I'd like to suggest that the FontForge implementation is changed to support the correct syntax.

Best, Adam

Comments (2)

  1. Khaled Hosny

    Fix ligature carets handling in feature files

    • There is no LigatureCaret keyword, looks like a typo in the spec
    • LigatureCaretByPos is followed by simple number(s), we now dump and read this (corresponds to format 1 in GDEF table spec).
    • LigatureCaretByIndex (format 2) is not supported
    • (we don’t support it when reading from SFNT files either), now it is parsed and silently ignored.
    • LigatureCaretByDev (format 3) is not supported either, bit since that neither AFDKO’s makeotf supports nor there are any example in the spec, nothing is done here and we will just raise an error.

    Fixes #36

    → <<cset b8f640946c1e>>

  2. Log in to comment