fontmake: Compiling UFO failed

mauro sacchetto
mauro sacchetto Posts: 353
edited February 2023 in Font Technology
This is the self-explanatory message:
<pre class="CodeBlock"><code>samiel@debian:~$ fontmake -u ContemporaryGaramond-Italic.ufo/<br>INFO:fontmake.font_project:Building OTF for Contemporary Garamond-Italic<br>INFO:ufo2ft:Pre-processing glyphs<br>INFO:ufo2ft.filters:Running DecomposeComponentsFilter on ContemporaryGaramond-Italic<br>INFO:ufo2ft.filters:Running RemoveOverlapsFilter on ContemporaryGaramond-Italic<br>INFO:ufo2ft:Building OpenType tables<br>fontmake: Error: In 'ContemporaryGaramond-Italic.ufo': Compiling UFO failed: ContemporaryGaramond-Italic.ufo/features.fea:1135:2: Script statements are not allowed within "feature aalt"
In that section I find:
feature aalt {<br><br>&nbsp; DFLT scripts;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; language dflt ;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lookup aaltAccessAllAlternateslookup0;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lookup aaltAccessAllAlternateslookup1;<br><br>&nbsp; greek script;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; language dflt ;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lookup aaltAccessAllAlternateslookup0;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lookup aaltAccessAllAlternateslookup1;<br><br>&nbsp; script latn;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; language dflt ;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lookup aaltAccessAllAlternateslookup0;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lookup aaltAccessAllAlternateslookup1;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; language AZE exclude_dflt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lookup aaltAccessAllAlternateslookup0;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lookup aaltAccessAllAlternateslookup1;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CRT language exclude_dflt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lookup aaltAccessAllAlternateslookup0;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lookup aaltAccessAllAlternateslookup1;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; language FRA exclude_dflt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lookup aaltAccessAllAlternateslookup0;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lookup aaltAccessAllAlternateslookup1;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; language ITA exclude_dflt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lookup aaltAccessAllAlternateslookup0;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lookup aaltAccessAllAlternateslookup1;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MOL language exclude_dflt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lookup aaltAccessAllAlternateslookup0;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lookup aaltAccessAllAlternateslookup1;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ROM language exclude_dflt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lookup aaltAccessAllAlternateslookup0;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lookup aaltAccessAllAlternateslookup1;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TRK language exclude_dflt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lookup aaltAccessAllAlternateslookup0;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lookup aaltAccessAllAlternateslookup1;<br>} aalt;
and I can't figure out the nature of the reported error.
Thank you
m

PS
Is there a better way to report code here?
If I chose "format: code" I obtain all in a (very long) line

Comments

  • it is a bit hard to read - if you click on "Toggle HTML View" (the </> icon) in your post, and then paste the code inside of this HTML tag: <pre>your feature code here</pre> that should work better
  • Denis Moyogo Jacquerye
    edited February 2023
    (Using the Quote instead of Code tag)

    It looks like you should have:
    feature aalt {
    lookup aaltAccessAllAlternateslookup0;
    lookup aaltAccessAllAlternateslookup1;
    } aalt;
    Have a look at the aalt section in the Feature File specification.
  • I flagged this, because the features.fea is automatically generated by FontForge:
    As soon as I get hold of my daughter's MacBook I try with Glyphs
  • John Hudson
    John Hudson Posts: 3,186
    Everything about the aalt feature is silly. It is a hack that Adobe came up with for a situation that they then demonstrated in their own software was unnecessary. Giving aalt special behaviour and requirements in the fea specification and AFDKO compiler just makes the whole thing even sillier. GSUB is GSUB and shouldn’t be constrained by special rules or limitations in a compiler.
  • mauro sacchetto
    mauro sacchetto Posts: 353
    edited February 2023
    Solution: manually edit the features.fea file by deleting all lines except
    <pre>feature aalt {<br>&nbsp; lookup aaltAccessAllAlternateslookup0;<br>&nbsp; lookup aaltAccessAllAlternateslookup1;<br>} aalt;</pre>

    But evidently the behavior of FontForge is not correct here.

  • Everything about the aalt feature is silly. It is a hack that Adobe came up with for a situation that they then demonstrated in their own software was unnecessary.

    Apart from simply accessing every glyph variant, isn’t AALT what they use to order and arrange the glyph palette in InDesign? And thus in theory any other app that chooses to use it? I can imagine scenarios where the AALT glyph order is presented differently than the font file’s internal glyph order, and AALT broken into language classifications where for example, if the text language in the document is set to Greek, the Greek alphabet glyphs appear ahead of Latin in the glyph palette, et cetera.
  • John Hudson
    John Hudson Posts: 3,186
    edited February 2023
    The idea of aalt, as I understood it when Adobe first registered the feature, was that InDesign’s glyph palette needed it as a way to map all variants of a glyph to populate the pop-ups from the little triangle arrows on a glyph. But that was then demonstrated not to be a requirement, because the glyph palette could be coded to parse any GSUB feature to find one-to-one glyph mappings and identify variants that way.

    So here is the InDesign palette pop-up functioning fine in Brill Roman, a font without any aalt feature:
     

    or example, if the text language in the document is set to Greek, the Greek alphabet glyphs appear ahead of Latin in the glyph palette, et cetera.
    But that would have nothing to do with aalt. If one wanted to sort a glyph palette by script or specific alphabet, that would be primarily a Unicode character level sorting, and you can still group all variants by parsing all the GSUB features, rather than relying on one special feature. Also, parsing all the GSUB in that case would also capture script- or language specific ligatures and other non-one-to-one variants.

    [This is, in any case, hypothetical, as the only sort order options for the InDesign glyph palette are still Unicode order or GID/CID order.]

  • John Hudson
    John Hudson Posts: 3,186
    PS. I can see how aalt could make it easier for a glyph palette to capture some kinds of variant relationships, but ironically those are in complex scripts of the kind that Adobe was not supporting at the time they registered the aalt feature. For example, some of our Indic fonts contain variants of syllabic ligatures, which are the output of a whole series of pre- and post-reordering GSUB lookups, and parsing the chain of features and lookups that precede the variant selection would be complex (but also possibly unnecessary, since one could skip those steps and just map the input and output of ssXX feature lookups).