Closed silverwind closed 6 years ago
Looks like the issue is even present on single characters. Here's the vertical beam in Chrome:
This is so weird. The character is vertical beam in the font file, at least according to FontForge:
That'll be because Menlo and Monaco use two different advance widths for their characters, which matters only when applications consider proportional sizing in font rendering. So in other words:
┌─────────┐ <- This row looks fine, because it only uses Menlo glyphs
│ Lorem │ <- This row looks screwed, because it uses glyphs from
both Menlo and Monaco
So as far as font metrics are concerned, you may as well have two completely different typefaces in use in the editor. If Menlo's advance widths are stored internally at, say, 1000, and Monaco's are 1004 or what-have-you, there's inevitably going to be a discrepancy when glyphs are mixed in a medium that isn't fixed-pitch.
This isn't easy to fix programmatically, I'm afraid. :disappointed:
Of course, if both fonts weren't commercial, I'd simply hack them together in an editor and upload the manually-corrected version. :grinning: But since they're proprietary, I had to write this entire repository just to share my work with the world.
Fuck closed-source.
Oh, and I was planning on making a similar repository to share my patched version of Menlo called Menlig (Menlo + ligatures), but I lost the source files with my MacBook. I was lucky enough to recover the OTF for it.
Here's how it looks in Konsole and Atom, or anything which supports OpenType ligatures:
Which I've uploaded here because I've well and truly had it with Apple.
/angry-diatribe-over
Thanks. I'm personally not that much into ligatures, but I can recommend the Fira Code font if you like them.
As for this issue: You're right. Monaco uses a advance width of 1233
while Menlo has 1229
, resulting in ever so slight misalignments. It might be possible to set the width of replaced glyphs to fix this issue, but I'm not sure if the font forge API (http://dmtr.org/ff.php) can do that.
When edge characters like
┐
and│
meet, I see this alignment issue:The issue shows for me on macOS in Firefox, Chrome, Sublime Text and Atom, but interestingly not in iTerm. The original Menlo font does not show this issue:
Here's the example text: