ToxicFrog / Ligaturizer

Programming Fonts with Ligatures added (& a script to add them to other fonts)
GNU General Public License v3.0
2.19k stars 112 forks source link

Liguritized Input Sans runs into numerous spacing problems. #72

Open jcklpe opened 4 years ago

jcklpe commented 4 years ago

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.

ToxicFrog commented 4 years ago

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.