> In code examples, a proportional-width font is used for identifiers. … At first glance, this presentation style will seem “unnatural” to programmers accustomed to seeing code in constant-width fonts. However, proportional-width fonts are generally regarded as better than constant-width fonts for presentation of text. Using a proportional-width font also allows me to present code with fewer illogical line breaks.
I switched years ago and would never go back to monospace.
So it would be nice if IDEs rich-rendered regions column aligned.
eg, object literals in JS, in which space separator are as a wide as needed to align the values.
JetBrains MPS has a decision table rendering for DSLs, which is similar to what I described.
Check out "elastic tabstops":
It's what I landed on after completing the Coding Font game submitted to HN yesterday: https://news.ycombinator.com/item?id=47575403
A bit weird to not mention that.
Unfortunately until editors start supporting this (and I’m not sure what would motivate them to), these remain great ideas only.
I more meant the idea of using different fonts in the same buffer to represent different kinds of text.
Monaspace is a monospace font that uses contextual alternatives: it changes how letters look depending on surrounding letters.
They are nothing alike in their approach to this problem.
(Also this is a marketing piece. Contextual alternatives is not a new tech.)
it is also a monospaced font
Mixing monosoace and proportional fonts can be a little strange, but there are some 3rd party packages or guides (prot has one iirc) to workaround it.
Contextual alternates are normally used for certain scripts, like Arabic, where the shape of each glyph depends on the surrounding glyphs. And they are also used for cursive handwriting fonts where the stroke of the “pen” might have different connection points across letters. Texture healing is a novel application of this technology to code.”
Why has no one tried it before? Because (a) nobody thought of it and (2) OpenType alternates, while they’ve been around for a while, have not always been supported in the sorts of programs that use monospace fonts (code editors and terminals)
In the comparator page of Commit Mono, Menlo tracks wider than Commit Mono et al., which I prefer for fastest reading.
(And CommitMono looks to be a deserifed and thinned Google Sans Code, which now I think about it, is odd to have serifs...)
>Has no one tried this before?
This is a great execution of a very common font practice.
Conversely, nobody seems to be doing pixel-based hinting anymore, which is why all newer fonts tend to look terrible at small font sizes on lower-DPI displays.
Can't quickly find a screenshot though you can use web dev tools to add
font-feature-settings: "cv10" 1;
To the interactive demo on https://monaspace.githubnext.com modify_font cell_width 95%
But yes it seems weird that their variable font doesn't go narrower.But I find it (and some vertical padding) helps get closer to the Victor Mono proportions I was used to as long as you don't go too far. It's maybe more like reducing letterspacing which Victor Mono also had less of.