useExtension and AFDKO 2.5

agisaak's picture

I've run into a problem with GSUB coverage offset overflow errors in a largish font I have been working on. Adding useExtension to various lookups solves the problem when generating the font in FLS 5.0.4, but not in 5.1 where the error remains. Moreover, attempting to compile directly using AFDKO also fails, so I suspect that there is a bug in AFDKO 2.5 which is somehow causing the useExtension directive to be ignored.

I was wondering if anyone has successfully compiled code using this directive either in AFDKO 2.5 (or FLS 5.1 which relies on AFDKO 2.5). This would help me determine whether this is indeed the root of the problem or whether there is some other less obvious problem with my code which FLS 5.0.4 (ADFKO 1.6) accepts but which FLS 5.1 (AFDKO 2.5) does not.

(n.b. by 'successfully compiled' I mean compiled where the directive is actually necessary to prevent overflows -- not just where it is present).


Read Roberts's picture

Hi André;

Older versions of the FDK are not posted for download. I could recover an installable version of 1.6, but I think it would be a lot less work to make your features file work with 2.5. I can guarantee that the useExtension directive does work under 2.5, and that if the font can be *correctly* built with 1.6, it can also be built with FDK 2.5. Please send me the error log from the makeotf run, and I'll see what I can figure out (

- Read Roberts

agisaak's picture

After some additional hair-pulling I've discovered (fingers crossed) the source of my problem, though I'm still a bit mystified as to why FLS 5.0.4 and FLS 5.1 are behaving differently.

In my original font (begun pre FLS 5.1), I'd tried to get around the lack of standalone lookups in FDK 1.6 by defining all of my lookups in a single, unregistered dummy feature at the beginning of my feature list, and then simply using lookup references in all my actual feature definitions.

I've discovered that if I split this dummy feature into two (or more) dummy features, suddenly I can solve my offset overflow problems with useExtension. Apparently, FLS 5.1 chokes if the combined size of lookups *within a single feature block* exceeds a the size of a 16-bit offset.

I don't understand *why* it cares whether the lookups are declared within a single feature block or not, but apparently it does.


k.l.'s picture

(If I got you right, you're using FLS 5.1 now. Rather than using two dummy features instead of one, did you try to remove the feature **** { and } ****; wrapper around your lookup definitions entirely?)

agisaak's picture

It turns out that my original assessment was incorrect (Karsten's comment clued me into this since I'd already tried that to no avail, and if that didn't work, there's no reason to think breaking the feature up should matter).

It turns out I'd made a rather foolish mistake -- I'd performed this experiment on the *wrong* version of the font, and was dealing with a shorter set of code. Here, breaking up the container feature made a difference, but the reason for this turns out to be less than mysterious.

I'd started out with a single container feature, AGIT, which I'd broken into AGIT and AGI2, which contained roughly the same amount of code. I'd forgotten, though, that the feature file began with:

feature aalt {
    feature AGIT;
} aalt;

Since AGIT was now roughly half as long, it's no wonder the GSUB table shrank.

When I return to the .vfb I'd intended to work with, I get the same problem -- a single useExtension is needed in FLS 5.0.4/FDK 1.6 but no amount of useExtensions will prevent overflows in FLS 5.1/FDK 2.5

However, this seems to be restricted to this one file. I'd thought it extended to some other files as well, but it turns out the problem was solvable in these. It seems that FDK 2.5 produces longer GSUB code than FDK 1.6 by around 25%. So, except for my single problematic .vfb, useExtension will correct overflows, but it needs to be added to more lookups. After finding the problem wouldn't go away in my one file, I gave up too easily on the others rather than continuing to add useExtension until I was able to compile.

Syndicate content Syndicate content