One naive way to do this would be to create ligature pairs for difficult pairs (mi, lm, etc). But instead, they seem to be selecting character alternates that fill the fixed width differently based on their surroundings.
I really like the idea of using different style of font for different things, but as primarily terminal user, I don't even know which terminals support it (if any), and then we would need CLI text editors support as well. But I think it's a great idea.
Other editors/terminal emulators would probably need to add support for this.
Unfortunately, it's on the editor to support mixing fonts. There's never been multiple compatible monospaced fonts before so no editors really support this yet. Lots of editors also don't support variable typefaces properly yet (ahem, VS Code) but this is going to change.
Ultimately what you're describing is the future! But we have to release the typefaces to bootstrap that future.
We made a prototype extension that hack it into VS Code. But they're hacky af and not really releasable.
Radon (the handwriting one) seems to complement the other fonts well because it's basically an italic. But all the others are so similar, with their identical metrics and whatnot, that the "authoritative docstrings" and "Copilot voice" examples are really hard to distinguish.
As far as I can tell from the demo, these pairs currently aren't affected by texture healing, and they look a little awkward in Radon especially.
Oh this has been done for decades. Metafont (by the inimitable Don Knuth) let you describe glyphs as toolpaths in code. You could have as many parameters as you wanted; I've seen examples where a sans-serif is smoothly swept into a serif.
Metafont never got adopted as much as I would have hoped; the lack of a graphical editor and some impedance mismatch with OpenType probably prevented its wider adoption.
In practice this is unusable. Because the width of the letters now depends on the succeeding character, the text jumps as you write it. Super annoying.
Cool for reading. Awful for writing.
blah
FTA. It means you can do things like have inline comments use Radon, docstrings use Xenon, code use Neon, and string literals use Krypton for more visual difference -- without the line heights and columns getting all weird because of it.
Some seem useful but is seems I can not pick them individually and have to commit to an entire group of them. The symbol for </> (something I never used anyway) looks like the absolute worst to me, like how is that better? And especially of you do rarely or never used it you get forced into this shit if you like other things from that group and enable it.
Turning two == into one long one, NO! I think people just overthink it, it becomes confusing and not more readable.
!= is two bloody characters not one.
And now people are doing it for 3 characters.
With this kind of thing, you get all the text editing idiocy of combining characters (like emojis) for no benefit at all.
See: Text Editing Hates You Too https://lord.io/text-editing-hates-you-too/
for anyone unaware, Marvin Gaye - Sexual Healing https://youtu.be/fn4i8bAfnMY
Jetbrains, VSCode people, whomever: edit mode and presentation view. There are times when I think for a lot of people the traditional math style makes sense for reading, but when it comes to editing, it bothers the hell out of me too.
Unfortunately that's not true.
The problem shows itself when looking at codeblocks that developers share (in docs, blogs, videos, etc...)
Ligatures become a readability problem.
In addition to ligatures, you get IMO a better version of the "Mix & Match" idea: doc comments are rendered as normal proportional text.
I’ve wanted to switch to an open alternative to Operator Mono for a long time now, and I think because of the mix and match, this finally is the one.
If it's just an issue with the textbox, it doesn't matter. If it's an issue with the monospaced font, that's a problem.
Edit and OT: Interesting HN algorithm behavior: I just wrote two posts in this thread (on different topics). The first appeared at the top of the page, as usual for new comments. When I clicked "Submit" on the second one, it appeared below the first one. My guess is that it was because it's much shorter. (First comment: >>38213113 )
Even Monaspace here has a width slider, which starts at "wider than PragmataPro" and just slides to "silly width". I wonder why they didn't try sliding down to a condensed version?
% ttfmono MonaspaceArgon-Regular.otf
monospaced flag = 0
(0 = variable-width, otherwise = monospaced)
Sadly I think that because of that flag it does not enable ligatures.I was able to see ligatures and text healing in vim running in a patched st* though. I really like it thanks! The text healing only moves the line subtly as I type and when I cursor over there are no droppings from the widened 'm' for example. It's well thought-out for code.
If I could ask for a feature it would be to select some variants, like angular 0 with reverse slash or to leave the ! in the != ligature. To see what I mean: https://github.com/be5invis/Iosevka/blob/main/doc/stylistic-...
Default Iosevka is close, but the leading is much larger. Luckily you can customize it to be almost identical (set `leading = 1110` in the config; value obtained by trial and error).
those other variants are not nearly different enough to really convey information.
- native language
- mathematically or symbolically oriented
- etc.
I personally find them imminently readable and use with Fira Code font.
[append] Oh, I do see some jumping when I type "optimized". Honestly, it doesn't seem very jarring to me; the jumping is always right where the edit point is so the added or removed letter causes a much bigger jump.
> If you want coding ligatures but do not want texture healing, you can elide the calt setting:
There is no point in cranking out yet another code font that doesn't have hinting. PragmataPro and Berkeley Mono are such well loved fonts not because of their aesthetic quality (code fonts are (proudly) ugly), but because of how well their hinting has been done.
If I want an unhinted, but well performing, font... there is Iosevka. Which I use.
Using this approach, you can use up to 4 different fonts: One for normal text, one for italic, one for bold, and one for bold italic. And the font for each group doesn't necessarily need to be that style, e.g. you can use a non-bold version for the `bold` font, etc.
This beautiful feature is created by the GitHub team and is only available on VS Code, strengthening its lead over the other editors.
This fact has led me to look more closely at Commit Mono, suggested by nvartolomei in his comment (this article). I love the texture healing idea, and that font looks to be more open and easier to use in other environments.
`overflow: scroll` is almost never (p>0.999) the right thing, and users that don’t use overlay scrollbars are suffering because of the poor choice of name, getting a forced scrollbar when one is almost never appropriate. (This includes almost all Windows for now, I believe; and some Linux, probably no longer most since GNOME is bent on ruining everyone’s life; and some macOS.)
—⁂—
When is `overflow: scroll` legitimate?
One obsolete case is preventing document scrolling when a modal is open, without triggering reflow due to the scrollbar disappearing, but I say the side-effects are still worse than the problem (the document scrollbar is nonsensical while the modal is open), so you should let it be (why was scrolling the document under the modal such a problem anyway?), or prevent scrolling by means other than scrollbar manipulation, by capturing it in the modal backdrop.
Another obsolete case is avoiding a bit of layout shift when switching between pages if some fit in the viewport an others don’t; but honestly it’s so long since I’ve seen a site where any pages fit in the viewport… and more to the point, this is better handled with `scrollbar-gutter` (not supported by Safari; you could use @supports to fall back to `overflow: scroll`, but the importance and number of affected users—since Safari is normally overlay scrollbars—are so tiny I don’t think it’s worth it).
The only arguably legitimate case I can think of is on spreadsheets/data grid components, where you can reasonably prefer to display a noop scrollbars rather than just reserving the space for them.
OK, and one other: code to find scrollbar dimensions for various layout purpose normally uses `overflow: scroll` on a temporary element and this is legit, even though you could do it other, mildly more complex ways; but it also makes assumptions about scrollbars always being the same size, and there’s honestly no reason why they should be, and `scrollbar-width` has shown a distinct appetite for using thinner scrollbars in some places and a browser could reasonably vary its default scrollbar width based on the dimensions. And scrollbar-dimension-finding isn’t particularly common, and the problems it’s used to solve are mostly better handled in other ways; now if only viewport units weren’t broken by design in the presence of document scrollbars…
I’ve contemplated campaigning for explicit deprecation of `overflow: scroll` and getting warnings shown in dev tools if you use them, because I’ve seen it misused so many times in the last decade, where people actually meant `overflow: auto`, and other than scrollbar-dimension-finding doubt I’ve seen even a single legitimate and reasonable use in that time.
> Here’s a concrete example of the mess that it is: <https://www.youtube.com/watch?v=OSgIEDMekSg&t=157>. He says, “so we can write an if statement, so we can say ‘if want is not equal to got’”, with the character `!` briefly visible on screen, then a ≠. Fortunately he was aware enough to put text over the video “I’m using the ‘Fira Code’ font, which shows ‘!=’ in this neat way. Try it!”, so the beginner (since this is designed for beginners) at least gets some hint—but I bet that more than a few will forget and find it difficult to figure out what it is again, and anyone that’s skimming may just miss that part altogether.
In education material in particular, coding ligatures are emphatically not OK. How on earth is the user supposed to figure out that that wide ≠ is actually typed !=? So you’re putting a stumbling-block in their path.
> Fortunately he was aware enough to put text over the video “I’m using the ‘Fira Code’ font, which shows ‘!=’ in this neat way. Try it!”
It's not a difficult concept. Nobody gets confused if :) is displayed as an emoji.
—⁂—
Fun fact: the King James Version of the Bible uses “:)” 37 times (e.g. Matthew 24:15) and “;)” 53 times (e.g. Deuteronomy 4:31).
I’ve had auto-emojification of character sequences like :) cause problems on more than one occasion, e.g. in things like copying logs and getting them mangled. I strongly oppose those sorts of transformations being applied willy-nilly. Converting :) into U+1F642 or similar at authoring time is OK, so long as I can turn it off, but doing it blindly causes enough problems and helps little enough that it just shouldn’t be done any more, not when most devices have ready access to actual emoji input.
But even without anything like that, if it’s good for reading I like to use different fonts when reviewing and writing code to help with the context-switch, so I think this could be useful to me. And I guess people in regions where a single keystroke isn’t always a single character such as Korea, China, Japan and the arab world might be used to the jarring effect already?
Emacs and Vim have both supported this since at least last century.
I have recommended this many times here, but I use a proportional coding font: Input Sans
For others, this is ligatures https://fonts.google.com/knowledge/glossary/ligature
[0] http://eastfarthing.com/luculent/
[1] https://fontlibrary.org/en/font/luculent (live example in browser)
I feel at least partially the same about fancy ligatures; we could just use the actual characters in source code, Unicode is widely supported. Raku does that, but it would need better typesetting (with variable-width fonts) to really shine.
Real typographers know that the Computer Modern family is garbage.
It sometimes breaks out of the grid, but there still is a grid. Things are sometimes not micro-aligned but still macro-aligned, and that matters (to me).
I do think I've seen it before, I don't think it's a new idea. Probably some typographic tradition from when it was used as a section separator in prose.
The one that kills me is the squiggly comparisons ~>, I find it horrible and doesn't evoke the kind of comparison I see in Gemfiles.
I read |> as "pipe + redirect" for me so turning them to triangles make them lose a ton of meaning.
Oh and != is so much wider than >=, probably because == is, so as not to be confused with = which kinda makes sense but is visually jarring. It's even more jarring with === which gets so wide and thin three-band that it loses its "equalness" and becomes a striped rectangle.
The healing is a nice trick but the difference of m character width riles me up when they line up vertically:
limit
gamut
I can't quite make sense of the whole of ss04 </ glyphs. I feared \/ and /\ would be terrible for awkperlruby regexes, but they only apply if there's whitespace around (still / \/ / is an improbable yet valid regex that would have it transformed)Turns out a font can only infer so much based only on characters when combinations are contextual.
But the most annoying thing is that even if that was solved, ligatures are terrible when editing, especially when your (line) caret ends up in the middle of a ligature or (box) over half of the character (or third), which breaks the illusion/abstraction as you now have to think about the underlying characters.
Definitely a no-go for me, but to each his own.
Why do we keep using fixed-width fonts? Because a lot of stuff has been written that depends on a columnar grid. Most notably, terminals are absolutely predicated on it and fundamentally cannot support any other mode of operation.
To begin with: visual alignment, ASCII art, diagrams using box-drawing characters, &c., both in code and in the output of diverse tools:
def function_name(and_long_parameter_list,
so_that_it_wraps="like so"):
pass
ABC_D = 1 # Explanation
ABC_EFG = 2.0 # Another one
ABC_HI = 34 # A third one
┌────────┬─────────────┐
│ Tables │ Using │
┝━━━━━━━━┿━━━━━━━━━━━━━┥
│ Cell │ Box-drawing │
│ Cello │ characters │
│ Viola │ ⋮ │
│ Voilà │ │
└────────┴─────────────┘
error: cannot find macro `behold` in this scope
--> <anon>:1:13
|
1 | fn main() { behold!() }
| ^^^^^^
$ ls -la
total 43210
drwxr-xr-x 17 root root 4096 Jan 1 23:45 .
drwxr-xr-x 17 root root 4096 Jan 1 23:45 ..
lrwxrwxrwx 1 root root 7 Feb 29 2020 bin -> usr/bin
drwxr-xr-x 2 root root 0 Dec 31 23:59 boot
⋮
(I included the ⋮ in the box drawing table deliberately, because it demonstrates a weakness in the scheme: terminals and most monospacy text editors force stuff into the grid, just clipping or overflowing the cell if a glyph has to come from a fallback font, but most other things don’t, so you end up with visual alignment breaking if the fallback font used has different metrics. Also the whole East Asian Width thing and ucwidth and whatever is super messy. Your monospace font may or may not include the box-drawing characters, but it’s much more unlikely to include ⋮.)Terminals are also built on columnar behaviour; there are escape codes for moving the cursor to such-and-such a line and column, for example, and things like a side-by-side split require columnar behaviour.
Text editors can go non-monospaced, but it breaks various content for the reasons discussed, and you’ll need monospace for any terminal because loads of stuff will break otherwise, so combined with inertia, even editors that support proportional fonts aren’t often used that way if they default to monospace.
(Me, I’d rather like to use a proportional font while editing, but I’m not moving off Vim for it, so I’ll probably never get it. But for presentation, I like to go at least partially proportional with the monospace font Triplicate’s Poly variant, which breaks strict monospaceness, widening characters like w/m/W/M and narrowing characters like i/j/l/1. As for what Monaspace’s texture healing, I like it most of the time, but am not sold on cases like some_function_w_, where the last two underscores are markedly shorter than the first and it feels unbalanced.)
https://en.wikipedia.org/wiki/Asterism_(typography)
Edit: it’s called an Asterism
I was on a quest to find the narrowest font and Quinze was the answer. It's something like 20% narrower than Iosevka and M+. I can't find an easy comparison with PragmataPro but if Iosevka is a free interpretation of PragmataPro like you mentioned then Quinze should be narrower as well.
In fact Quinze is so narrow that when I attempted to force its use in all monospace text in the browser, readability took a hit instead of improving. This is because at the same height it is much smaller than "normal" fonts. In my coding setup I use a huge font size which works great with the narrow width.
I guess the downside is that Quinze is very minimal: pretty much only ASCII, no ligature, no customization etc. None of those bother me.
The text editor widget on their page is a bunch of "line" divs with individual terms being inside spans. If you add an inline style of
font-feature-settings: "calt" off;
or, more completely, font-feature-settings: "calt" off,"dlig" var(--ligatures,1),"ss01" var(--ligatures,1),"ss02" var(--ligatures,1),"ss03" var(--ligatures,1),"ss04" var(--ligatures,1),"ss05" var(--ligatures,1),"ss06" var(--ligatures,1),"ss07" var(--ligatures,1),"ss08" var(--ligatures,1);
to a single line div or a single term span, it won't do the healing. If one of the CSS pseudo selectors worked for these kinds of elements (I see there are a lot that apply to forms, but.. maybe :active / :active-within would work for editable spans?), you could have healing automatically apply to terms when they 'blur' / when they're no longer active.I have a bunch of font-feature-settings subfeatures turned off explicitly in my userChrome.css, so it took me a little while to realize that that was what was messing with this site. I couldn't figure out what texture healing was supposed to do because toggling it wasn't helping, but it was because of my userChrome.
Another way to fix the inconsistency is for the language designers to get unstuck from the past and allow literal ≠ in code
It might be ok but there is a reason why type designers make every character to be the same and try to balance everything including spacing.
Monospaced fonts designs are dictated exactly by that limit of fixed character+fixed space.
But maybe the “healing” might not be verydistracting.
Makes me wonder how other people deal with so few characters on their screen, or is everyone using high DPI, >1080p monitors?
I might try this one, but I doubt it will be any improvement.
Here is a screenshot of Iosevka Comfy in action: https://share.combo.cc/-bN9f8hAiiG
and Iosevka Comfy Motion, with tasteful serifs: https://share.combo.cc/-BNHfhV4zgu
I have to explicitly set the "Show all fonts" checkbox which shows all "non monospaced" fonts.
If the editor “repaints” commit mono on the letter-pair boundary, I could see that being a very jumpy UX — ie: the letter I just typed is moving by a few pixels. But if that repaint happens on the word boundary it might be less noticeable?
In either case, a transition could be helpful for commit mono and/or Monaspace. (But agreed with above comments that Monaspace is more subtle because it spreads the spacing over the entire word, so maybe the transition is not actually percievable or worth it). :)
So if I want to use a variable pitch font (like say... DejaVu Sans) to draw comments, I can set the font-lock-comment-face to use the "DejaVu Sans" family.
But also, since I'm writing a character stream, I care about being able to see it as a monotonic stream of distinct characters (which is why I hate hate hate ligatures for e.g. "!=") and moving characters a tiny bit doesn't break that.
Why is that? In text or punctuation?
For words it’s more readable. The punctuation is designed for coding. The numerals are still monospaced.
But this was designed by type designers. So you can make exactly the same argument about texture healing.
Still surprised that you are so worked up by this - is it really so common or so problematic?
I'm using "Bell MT" to replace Times in browser (and also using it for variable-pitch font in emacs Org mode), it is good but I wish it had a taller/condensed version.
Also, one of the best condensed mono font is "The Sans Mono Condensed" which first popularized by early Oreilly books (it has since switched to other mono fonts). The downside is that it only has a western character set but I liked it a lot
• The design of Computer Modern was based on Monotype Modern 8A, which was made by a "real typographer" for Monotype corporation and used for decades in several textbooks by Addison-Wesley, including the first editions of TAOCP volumes 1–3 (and 2nd ed of vol 1).
• Knuth got close feedback on the font specimens at various steps of the process (and incorporated the suggestions) from many of the world's top font designers, in particular Hermann Zapf, Matthew Carter, Richard Southall, Charles Bigelow and Kris Holmes, who between them are behind such typefaces as Palatino, Optima, Verdana, Georgia, and Lucida. (Zapf and Southall visited Knuth at Stanford and spent weeks working closely with him on the fonts.) I imagine they wouldn't have spent so much time on it if they thought it was "garbage".
• Of course, Computer Modern, and Monotype Modern before it, are (intentionally) boring "workhorse" fonts for textbooks and won't win any points for being stylish or novel or a work of typographic genius — but within that category, CM is AFAICT something close to the best possible rendering of the basic design, very far from "garbage". I'm curious who thinks otherwise. (I've read a few reviews from typographers and no one said the font was bad; one I remember praised the even "texture" of the page, though that was more a result of TeX's Knuth–Plass line-breaking rather than the font itself.)
• (There is also a well-known issue with CM's appearance on low-resolution devices like computer screens rather than print, and especially the "spindly" appearance of the vector font that usually ends up getting used today if one asks for Computer Modern—see my answer at https://tex.stackexchange.com/a/361722 and links in the comments on it—but those have nothing to do with Knuth's design; in fact Knuth personally still uses the Metafont-generated bitmap fonts unlike everyone else. And there are now "newcomputermodern" and "mlmodern" to remedy this.)
Your use case sounds like it might be better handled by `scrollbar-gutter: stable`, though I might adjust my judgement on seeing it.
from fontTools import ttLib
from path import Path
output_dir = Path('mono')
for file in Path('.').files('*.otf'):
print(file)
font = ttLib.TTFont(file)
font['post'].isFixedPitch = 1
font['OS/2'].panose.bProportion = 9
font.save(output_dir / file.name)
font.close() hi Comment guifg=#7e7490 gui=bold,italic
In Kitty, set the desired fonts: font_family IosevkaTerm Nerd Font Mono
italic_font IosevkaTerm Nerd Font Mono
bold_font IosevkaTerm Nerd Font Mono
bold_italic_font Iosevka Term SlabFormat that worked for me is :
"font_face": "Monaspace Neon Light",
// What if tentative ideas looked handwritten?
/**
* What if docstrings looked authoritative?
*/
... misaligning the two ** in /** is awkward.Code can be aligned with elastic tabstops ( https://nickgravgaard.com/elastic-tabstops/ ) or virtual formatting (that things are aligned according to syntax regardless of whitespace).
Things to align in terminals are mostly tables, and they could be rendered as tables if the terminal supporting that knew that they are tables. Nushell natively supports tabular data structures, so rendering them as proper tables would need just one change – the table renderer.