3 ms·
I'm fine with this in theory and have spent plenty of time running variable width fonts in code editors. In practice their non-alphanumeric symbols like bracket
by giraffe_lady 4y ago
I'm fine with this in theory and have spent plenty of time running variable width fonts in code editors. In practice their non-alphanumeric symbols like brackets and carets aren't designed and set correctly for the significance those characters have in code. In prose they are meant to be clear enough but unobtrusive, with a fair bit of play between the tradeoffs in either direction being acceptable.
It's not an insurmountable problem, probably any skilled typographer could do a great job at it on a given typeface. Probably even just a committed amateur with fontforge could do an acceptable job in a weekend. But I'm neither and I don't know of any "code variant" variable-width fonts yet.
Plus the last few years this problem more or less resolved itself for me. There are a number of incredibly high quality code-specific fonts now, plus there are now fixed-width fonts so tightly designed with this in mind they aren't even obviously fixed-width unless you have a practiced eye for typesetting. You can get very close to the same result without giving up aligned columns, which is one advantage that is still fairly relevant.
- macrael 4y agoI would love to see a serious take on a variable width coding font. I have a friend who made some edits to Avenir for me, making the minus as wide as the plus and making spaces that come at the beginning of a line wider to make space-indentation more obvious. I've never had any problems with brackets and carrots but of course these font choices are some of the most personal of coding decisions.