Deactivate OpenType feature when user modifies spacing

Hello.

I am working on a font that has an opentype feature which only works as intended when the user is not modifying the spacing or kerning in Indesign or other applications. The feature looks broken if the user modifies the spacing so i was wondering if there is a way to make the opentype feature automatically de-activate as soon as the user modifies the spacing or kerning?

The opentype feature is Calt.
Thanks in advance.

Sadly, the font has no control over this.

Applications will frequently disable ligatures when the spacing/kerning is adjusted, so if it makes sense, you can put your calt code into liga and hope for the best.

Hey Florian, thanks a lot for your reply.

For some reason i can’t export my font when the feature is moves to “Liga”. It then says “Unknown glyph found in feature line 1” etc.

I do not understand why it recognises the glyphs when the code is in Calt but not when in Liga.

can you show your feature code?

Yes the code is quite long, and calls several classes. My glyph naming might be a bit hard to understand, because there are very many alternates of each letter. I post a small part of it here.

If the glyph for a given glyph name is missing, then the name should be underlined in red. That does not appear to be the case in your screenshot.

Is this the top of your liga code or did you remove some code before taking the screenshot?

Or are you removing glyphs at export time with a “Remove Glyphs” custom parameter or something similar?

Either way, if the code worked in calt, it should work in liga as well.

Hello.

Yes you were right, i had removed the glyphs and the feature in certain styles in the export, and now that i remembered and go back and also remove Liga in those styles, it’s no longer an issue.

In indesign the feature is now deactivating when i give the font positive spacing, thank you! However it still is active on negative spacing. Any ideas if there would be a way to solve this as well?

I don’t think there is anything you can do about that. Different apps will handle this differently; some disabling ligatures for both positive and negative spacing, some for one case, some in no case, and in any case at different thresholds.

Okay, thanks for you reply, i appreciate it!