Hacker News new | ask | show | jobs
by adamrezich 1765 days ago
the example in the readme doesn't render correctly for me (Chrome on Windows 10). is this an issue with the font or what?
3 comments

Yeah, I've noticed that a lot of "monospace" fonts don't actually use the same character width for all characters... What makes it even worse is that the "monospace" font used by GitHub is one of those. It screws me over from time to time as I like to format things nicely and use a lot of unicode...

I think I will need to add some images to the readme as well, just make it looks less wonky. :(

Github uses a system font stack, this is the one for code blocks: `ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace`.

I don't know if there are better monospace ones builtin on windows 10 that they could add to the stack.

Not to get snarky (and certainly not at you, thanks for the info ;) ) but Microsoft owns Windows 10 as well as GitHub. If anyone could add a better default monospace font to the mix it would be them... :D
Copy-pasted the example into Notepad and it still looks warped. Tried to align them adding three spaces to the middle of each line except the first and last, and most rows still don't align. Changed the font from Consolas to Courier to Courier New, and they still don't align.

Maybe Unicode Braille has issues with Windows monospace fonts? iOS and Linux display them aligned.

It works for me using Pragamata Pro (my trusty default) and some preinstalled ones (at least mac) those being PT Mono, Spot Mono, and Andale Mono. It shouldn't be an issue as long as the "empty braille character", i.e. U+2800, doesn't get kerned to hell and back by the font.
I've added some images and a disclaimer to the readme. In case you still want to see the proper results. ;)