News for hackers. Stuff that matters.
Re:Modern Text Rendering with Linux by Jasper_ on Sunday August 04, 2019 @09:28AM (#20606396)
This is missing a text layout engine: separating a string of texts into multiple blocks with word wrap. This is handled in GTK+ through Pango and in Qt with an internal algorithm. I don't believe FreeBiDi/ICU is used in either.
Re:Modern Text Rendering with Linux by microcolonel on Sunday August 04, 2019 @02:47PM (#20608460)
HarfBuzz for shaping, too.
Re:Modern Text Rendering with Linux by dang on Sunday August 04, 2019 @04:31PM (#20609044)
Re:Modern Text Rendering with Linux by robin_reala on Sunday August 04, 2019 @09:14AM (#20606330)
Do projects like Pathfinder fit into this stack anywhere? At a guess you could replace Freetype with it, but I guess it does more?
Re:Modern Text Rendering with Linux by daww on Sunday August 04, 2019 @09:30AM (#20606410)
Interesting question, from my understanding Pathfinder is only concerned with rendering so it doesn't completely replace FreeType: you still need some software to extract the curves path data from the font file. This can be done in rust with skribo and font-kit

You can check out this issue for more info: https://github.com/servo/pathfinder/issues/143

Re:Modern Text Rendering with Linux by Jasper_ on Sunday August 04, 2019 @09:28AM (#20606403)
Pathfinder replaces FreeType. It doesn't do more, and shouldn't: it's focused on glyph (and image) rendering.
Re:Modern Text Rendering with Linux by sayusyz on Sunday August 04, 2019 @11:54AM (#20607249)
Great detailed pictures. I'm curious where general hinting belongs.
Re:Modern Text Rendering with Linux by Jasper_ on Sunday August 04, 2019 @12:02PM (#20607296)
"Hinting" is a combination of techniques. Subpixel placement hinting is done by the shaper, which would be HarfBuzz in this case. Metrics hinting (adjusting the glyph width) is done by a combination of the shaper and the renderer, which would be HarfBuzz and FreeType. Outline hinting (fitting outline to the grid by distoring shapes without) is done by FreeType.

Behdad Esfahboh, the author of HarfBuzz, has a great paper on the different choices and tradeoffs here: https://docs.google.com/document/d/1wpzgGMqXgit6FBVaO76epnnF...

Re:Modern Text Rendering with Linux by criddell on Sunday August 04, 2019 @12:10PM (#20607353)
Now that very high dpi screens are so popular and inexpensive, is subpixel rendering worth doing anymore?
Re:Modern Text Rendering with Linux by raphlinus on Sunday August 04, 2019 @12:18PM (#20607402)
It's important to make the distinction between subpixel positioning and subpixel (RGB) rendering. I'd personally say yes to the former, even at high dpi, and no to the latter if you're on a mobile device. The kerning errors you get from quantizing the position of glyphs to integer pixels are, to my eyes, a noticeable degradation of quality.
Re:Modern Text Rendering with Linux by criddell on Sunday August 04, 2019 @01:48PM (#20608050)
Do you know if the layout engines for laser printers do subpixel stuff?
Re:Modern Text Rendering with Linux by microcolonel on Sunday August 04, 2019 @02:51PM (#20608483)
Most laser printers tend to use PostScript (a Turing complete language), which does not know about displays hardly at all. It does arbitrary positioning.
Re:Modern Text Rendering with Linux by criddell on Monday August 05, 2019 @12:05PM (#20615204)
> It does arbitrary positioning.

So are you saying that whether or not subpixel effects are accounted for is implementation dependent?

Re:Modern Text Rendering with Linux by Matthias247 on Sunday August 04, 2019 @12:58PM (#20607708)
I don’t know the details, but on my 4K screen different applications font rendering looks very has a very noticeable difference in quality. Eg IntelliJ looks great, and afaik uses some form of subpixel Rendering. Where’s VS Code looks kind of crappy since the update to macOS Mojave, which as far as I understood changed font rendering
Re:Modern Text Rendering with Linux by microcolonel on Sunday August 04, 2019 @02:53PM (#20608492)
Yeah, at distances people actually view displays at, there is still a benefit to subpixel rendering and some amount of hinting, even on "retina" displays.

Far as I'm concerned, high res displays help hinting do less damage, but they don't render it obsolete.

Re:Modern Text Rendering with Linux by amelius on Sunday August 04, 2019 @03:08PM (#20608600)
To make it more modern, hopefully they will replace the XML by JSON at some point.
Re:Modern Text Rendering with Linux by Mister_Snuggles on Sunday August 04, 2019 @03:22PM (#20608682)
How does replacing XML with JSON make it more modern?
Re:Modern Text Rendering with Linux by rurban on Monday August 05, 2019 @06:10PM (#20619636)
smaller, more readable, faster, safer.