i-tu / Hasklig

Hasklig - a code font with monospaced ligatures
SIL Open Font License 1.1
5.56k stars 156 forks source link

Italic and others not monospaced, according to fontconfig. #130

Open timtro opened 2 years ago

timtro commented 2 years ago

Thanks in advance. Forgive me if I've missed something silly.

I just downloaded a zip of the 1.2 release and tried to use it with Kitty terminal, which only uses monospace fonts. Long-story-short, it seems that the italic face is failing fontconfig's test for monospace font:

> fc-list : family spacing outline scalable | grep -i "hasklig"Hasklig:spacing=100:outline=True:scalable=True
Hasklig:outline=True:scalable=True
Hasklig,Hasklig Black:spacing=100:outline=True:scalable=True
Hasklig,Hasklig Semibold:spacing=100:outline=True:scalable=True
Hasklig,Hasklig Light:outline=True:scalable=True
Hasklig,Hasklig Semibold:outline=True:scalable=True
Hasklig,Hasklig Light:spacing=100:outline=True:scalable=True
Hasklig,Hasklig Medium:outline=True:scalable=True
Hasklig,Hasklig Medium:spacing=100:outline=True:scalable=True
Hasklig,Hasklig ExtraLight:spacing=100:outline=True:scalable=True

Or likewise:

> fc-list :mono family | grep -i "hasklig"
Hasklig
Hasklig,Hasklig Black
Hasklig,Hasklig Light
Hasklig,Hasklig Semibold
Hasklig,Hasklig Medium
Hasklig,Hasklig ExtraLight

I don't know anything about fonts, but it looks like fc uses some property called 'advances' to rule a font FC_MONO? So if the advances of each glyph are all "approximately equal" then the font is monospace: https://github.com/behdad/fontconfig/blob/5b41ded2b0ddb98a07ac86264b94403cb7a0fd82/src/fcfreetype.c#L2348

I'm not even sure this is a bug, but let me know if I can help.