*DrawBot bug alert*:

While running out extensive proofing texts, I realized that GSUB and GPOS are not being applied to FormattedString() if it runs to more than three pages.

OTFeatures and, most importantly, *kerning* only get applied to the last few pages, and not the initial pages.

Issue filed and confirmed: https://github.com/typemytype/drawbot/issues/585

@justvanrossum identified the bug as part of CoreText.

FormattedString(openTypeFeatures) not applied consistently · Issue #585 · typemytype/drawbot

If I have a text that lays out on three pages or less, then the OT Features (ex. {liga}) get applied throughout. If the text is longer than three pages, then only the last three pages have features...

GitHub
@kentlew @justvanrossum Ohhh! I've been getting the same issue on some of my proofs and now I understand why changing the font size "fixed" it for me.
@jmsole @kentlew why didn’t you report it?
@justvanrossum @kentlew I hadn’t gotten enough time to figure out if the issue was with my code or not. I only saw the issue a couple of weeks ago in a proof where I have a variable font with feature variations that switch diacritics, so I wasn’t sure if the issue was with VFs, feature variations, my code, Drawbot or what, and I didn’t feel I had enough info to report it. For me it also expresses itself differently, I use drawbotgrid and the issue only happened in the first column of the proof.
@justvanrossum @kentlew The first time I saw the issue I had just made some big changes to the code I was using, so I really mostly suspected my code, with the font I was using as second suspect. Then for some other reason I changed the font size on the proof and that eliminated the issue which was confusing. And I’ve only over seen it happen in the first column of my proofs using drawbotgrid, so I wasn’t sure if maybe the issue was with that library.
@justvanrossum @kentlew Actually, in my case, it seems like the issue happens inconsistently. Both images below are of proofs where I show a number of words that use each of the letters with diacritics in the font. The first one does this in a big size, and it's correct, where the diacritics for this Optical Size should be flat with vertical terminals; it runs for 8 pages. On the second image, that's where I see the issue, the first column shows more upright diacritics, second col. is correct.

@jmsole Can you give me an approximate character count of the input text (before it gets filled into the boxes) for both these cases? It can still be the same bug.

In case you’re comfortable with building DrawBot from the sources, you could try if this (merged) pr fixed it: https://github.com/typemytype/drawbot/pull/588

Use kCTTypesetterOptionAllowUnboundedLayout option for setting 'longer' strings, ensuring OT features are applied in all cases by justvanrossum · Pull Request #588 · typemytype/drawbot

This fixes #585.

GitHub
@justvanrossum Yeah, that fixes it 👍
I am still intrigued by the fact that with drawbotgrid it always only affected the first column. I know for sure there was a difference in string length, even if I can't actually predict what that might be. The way that part of the script works is by getting all characters with diacritics that are found in the font and then finding x number of words that contain that diacritic, so for any given run the number of entries and length in characters could change.
@justvanrossum And of course, thank you so much for looking into the issue @kentlew reported and fixing things so quickly. Next time I bump into an issue I'll do my best to be more proactive in exploring and reporting it.