> who really cares if “æ” is written as “ae”?
Nitpicking, but if you're writing about text rendering you should know:
Yes, ligatures are really about presentation and not semantics. For example fi (U+FB01) means the same thing as fi; it just looks neater in some situations.
æ (U+00E6) is not a ligature; it's a mostly obsolete character, with different semantics (or phonetics) than ae.
For example, for purely typsetting beauty, your word processor might substitute the ligature fi for the two letters fi (which can f* search, and I resent both the ligature and lazy search function developers). It would never substitute æ for ae; that would misspell the word as much as substituting an o.
(2019) Popular in:
2023 (290 points, 119 comments) https://news.ycombinator.com/item?id=36478892
2022 (399 points, 154 comments) https://news.ycombinator.com/item?id=30330144
2019 (542 points, 170 comments) https://news.ycombinator.com/item?id=21105625
I've tried to ask this before in various contexts and I've never been able to find an answer but maybe commenters on a post like this would know.
I like the way that the CJK fonts render without anti-aliasing on windows. I want to know why and how to cause windows to render a non-cjk font of my choosing in this aliased style. I am not opposed to hex-editing or otherwise modifying the font if that's necessary. I've never been able to find information bout the mechanism or how it's triggered.
> Text is complicated
So true!
> and english is bad at expressing these nuances.
I think English is a terrible shitpile of grammar and syntax. I'm very impressed that anyone who speaks another language natively can get good at it.
But I'm interested in the notion that it lacks nuance to describe the intricacies of text rendering. Can someone tell me where that would apply?
The ligatures part of this article gets me every time I re-read it. I think reading this article may have been the first time I realized that even large, well-funded projects are still done by people who are just regular humans, and sometimes settle for something that's good enough.
> Just so you have an idea for how a typical text-rendering pipeline works, here’s a quick sketch:
1. Styling (parse markup, query system for fonts)
2. Layout (break text into lines)
3. Shaping (compute the glyphs in a line and their positions)
4. Rasterization (rasterize needed glyphs into an atlas/cache)
5. Composition (copy glyphs from the atlas to their desired positions)
Why is layout done so early? It seems to me that that would be later in the process.
"Subpixel offsets break glyph caches"
I once resolved that by keeping a vertically shrunken but really wide glyph around in a cache. Just resample it for a different horizontal offset.
>But if the transform is an animation this will actually look even worse
I wish they provided an example video of this since I can't visualize it. My natural thinking is subpixel antialiasing should look fine.
>the characters will jiggle as each glyph bounces around between different subpixel snappings and hints on each frame.
This shouldn't be a big issue unless your animation is slow and your subpixels are big.
Hmm I use Firefox and the rendering I see in Firefox looks nothing like the render the author gets in Firefox; in fact the text rendering I get looks very similar to the "Chrome" rendering. Obviously this must depend on the libraries linked during the build process.
> Don’t ask about the code which line-breaks partial ligatures though.
Wondered about this. All the circular dependencies sound like you could feasibly get some style/layout combinations that lead to self-contradictory situations.
E.g. consider a ligature that's wider than the characters' individual glyphs. If the ligature is at the end of the box, it could trigger a line break. But that line break would also break up the ligature and cause the characters to be rendered as individual glyphs, reducing their width - which would undo the line break. But without the line break, the ligature would reconnect, increase the width and restore the line break, etc etc...
And the companion article: https://lord.io/text-editing-hates-you-too/
(posted in other other threads too)
> So subpixel-AA is a really neat hack that can significantly improve text legibility, great! But, sadly, it’s also a huge pain in the neck!
Especially when you have a monitor with unusual subpixel layout, which is very common for OLEDs that don't have any standard for it. In practice, developers of common font libraries like FreeType simply didn't bother with trying to support all that. And that trickles down to toolkits like Qt. Surprising the article doesn't mention this major problem with modern displays.
> Retina displays really don’t need it
Assuming this means high resolution displays - unfortunately that's not always what you end up using. So subpixel antialiasing can still be useful, if it can work. But as above, it's often just broken on OLEDs.
How did they get the exact effect to show what they want in the text here instead of say, me seeing the exact same visuals for each browser as I am reading it from a single browser?
Good. I hated it first!
The real takeaway from the article is that you can rathole forever on ill-defined problems. Decide upfront whether you care about actual humans and their usecases or hypothetical humans and their hypothetical usecases.
Few more additional ones, more about editing than just rendering:
The style change mid ligature has a related problem. While it might be reasonable not to support style change in the middle of ligature, you still want to select individual letters within ligatures like "ff", "ffi" and "fl". The problem just like with color change is that neither the text shaper nor program rendering text knows where each individual letter within ligature glyph is positioned. Font simply lacks this information.
From what I have seen most programs which support it use similar approximation as what Firefox uses for coloring - split the ligature into equal parts. Works good enough for something like "fi", "fl" not so much for some of ligatures within programming fonts that combine >= into ≥.
There are even worse edge cases in scripts for other languages. There are ligatures which look roughly like the 2 characters which formed it side by side but in reverse order. There are also some ligatures in CJK fonts which combine 4 characters in a square.
Backspace erases characters at finer granularity than it's possible to select them.
With regards to LTR/RTL selection weirdness I recently discovered that some editors display small flag on the cursor displaying current position direction when it's in mixed direction text.