Monospace ligatures

Hello,

for a monospace font I need to reaplace i e plus plus by plus_plus.liga.
In order to keep it a truly monospaced font, I have to add one space before or after the liga (which therefor has to have a negative sidebearing on one side).

Unfortunately writing the following seems to be not allowed:
sub plus plus by plus_plus.liga space;

I get: Invalid ligature rule replacement

What solution would be best?

(Yes, I have read https://forum.glyphsapp.com/t/coding-ligatures-in-monospaced-font/8595 already but still do not really get, where I would put that feature in particular. Especially with dozens of ligatures)

Thx!

That has to be a GPOS solution like this:
pos plus_plus.liga 600;

It doesn’t necessarily have to be listed in kern or liga feature. Some coding apps may ignore liga, so there might be a better place for space adjustment.

2 Likes

Having it in the same feature then the substation should be a good idea. But some apps ignore GPOS in some features. So add it to a feature that is always on.

That means you can substitute some glyphs by some others. You would need to do that in two steps, or with a chaining lookup. But the GPOS solution is much better.

2 Likes

Just that GPOS solutions are not viable for a monospace font. Apps like the terminal will count and position each glyph independently, and ignore GPOS. You have to split it into two lookups, because you cannot have ligature and one-to-many substitutions in the same lookup. So something like this maybe:

lookup ligatures {
    sub plus plus by plus_plus.liga;
} ligatures:
lookup spaces {
   sub plus_plus.liga by plus_plus.liga space;
} spaces;
2 Likes

Thx a lot, folks - looks good!