Ligaturizer icon indicating copy to clipboard operation
Ligaturizer copied to clipboard

Liguritized Input Sans runs into numerous spacing problems.

Open jcklpe opened this issue 4 years ago • 1 comments

I used Ligaturizer to add some ligatures to Input Sans, a non-monospaced programming font.

Unfortunately this seems to have caused some problems as you can see here:

image

image

image

Any suggestions on how this can be fixed?

Also I realize that this is a pretty weird usecase but it would be nice to have a proportional font that still had various programing related ligatures like FiraCode.

jcklpe avatar Aug 29 '19 21:08 jcklpe

Ligaturizer attempts to scale ligatures to match the size of the font being patched; to do this, it makes some assumptions, the most foundational being that all characters in the input font are 1em wide and thus the width of any ligature is (number of characters in ligature) em.

I think fixing this would "just" be a matter of changing correct_character_width and correct_ligature_width to use the size of the glyph (or the set of glyphs making up the ligature) in self, rather than just using self.emwidth. That said, variable-width fonts are hairy enough compared to fixed-width ones that I'm not completely confident in that statement.

I would welcome a patch for this, as long as it doesn't break support for fixed-width fonts, but I doubt I'll ever get around to implementing it myself.

ToxicFrog avatar Mar 13 '20 23:03 ToxicFrog