githubnext / monaspace

An innovative superfamily of fonts for code
https://monaspace.githubnext.com
SIL Open Font License 1.1
13.14k stars 219 forks source link

Not all chars are rendered monospaced #174

Closed zingmane closed 6 months ago

zingmane commented 6 months ago

Some characters are not rendered mono spaced, especially those created with ascii drawing generators (e.g. https://asciiflow.com). It's not an issue with ligatures.

vscode settings:

"editor.fontFamily": "'Monaspace Neon', monospace",
"editor.fontLigatures": "'calt', 'liga', 'dlig', 'ss01', 'ss02'",

The example is this:

 *       ┌───────┐  ┌───────┐  ┌───────┐  ┌───────┐  ┌───────┐  ┌───────┐  ┌───────┐  ┌───────┐
 *       │       ├──┤       ├──┤       ├──┤       ├──┤       ├──┤       ├──┤       ├──┤       │
 *       └───────┘  └───────┘  └───────┘  └───────┘  └───────┘  └───────┘  └───────┘  └───────┘

image

cormullion commented 6 months ago

When you save a drawing in AsciiFlow there are two options: AsciiExtended and AsciiBasic. AsciiExtended (which should be named Unicode, probably) saves the drawing as Unicode glyphs in the U+2500 block, the "box drawing" characters.

Screenshot 2023-12-08 at 10 06 29

If the font you're using doesn't contain these U+25.. box drawing characters, most applications will find a replacement font that does, and use the glyphs from that one. This process is called "font fallback".

But some terminals and editors handle the different metrics of the different fonts more carefully than others. Unfortunately I think VS-Code 'faithfully' keeps using the different metrics of each font, and so you can see the slowly increasing width differences accumulating over the length of line 192 in your screenshot, as the glyphs from each font are chosen.

See also #43 #102 #143 ...

zingmane commented 6 months ago

Thx, couldn't find those existing issues. I close that one, b/c it's a duplicate.