Re:Ask HN: Anyone using proportional fonts for coding?
by kevin_thibedeau on Sunday July 30, 2023 @01:07AM
(#36928013)
They preclude ASCII and Unicode diagrams.
[ Parent
| on HN ]
Re:Ask HN: Anyone using proportional fonts for coding?
by rhn_mk1 on Sunday July 30, 2023 @01:34AM
(#36928160)
They preclude ASCII, but not Unicode diagrams.
Unicode block characters have constant width.
Unicode also contains fixed-width equivalents to ASCII letters: abc. Just add 0xFEE0 to the code point.
And 0x3000 is an ideographic space, with the same width.
+---------+
| | +--------------+
| NFS |--+ | |
| | | +-->| CacheFS |
+---------+ | +----------+ | | /dev/hda5 |
| | | | +--------------+
turns into +---------+
| | +--------------+
| NFS |--+ | |
| | | +-->| CacheFS |
+---------+ | +----------+ | | /dev/hda5 |
| | | | +--------------+
EDIT: which would have looked much better had HN not replaced full spaces with the narrow kind.
Re:Ask HN: Anyone using proportional fonts for coding?
by Kwpolska on Sunday July 30, 2023 @04:52AM
(#36929238)
Those diagrams might look nice, but are hard to edit (for your average user without a CJK input method) and hard to copy things from (you can't get the string /dev/hda5 from your example, you'll get something Linux won't do anything meaningful with.)
Re:Ask HN: Anyone using proportional fonts for coding?
by rhn_mk1 on Sunday July 30, 2023 @10:12AM
(#36931306)
I don't think diagrams are meant to be copy-pasted from a lot, so I'm not worried about that.
For editing, I'd just use a conversion tool, and edit it in a fixed-width editor rather than directly in code. Yes, it's an extra tool, but I don't think it's that outlandish to edit pictures in a tool for editing pictures.