
Modern Text Rendering with Linux - daww
https://mrandri19.github.io/2019/07/24/modern-text-rendering-linux-overview.html
======
Jasper_
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.

~~~
microcolonel
HarfBuzz for shaping, too.

------
dang
Two weeks ago:
[https://news.ycombinator.com/item?id=20491203](https://news.ycombinator.com/item?id=20491203)

------
robin_reala
Do projects like Pathfinder fit into this stack anywhere? At a guess you could
replace Freetype with it, but I guess it does more?

~~~
daww
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](https://github.com/servo/pathfinder/issues/143)

------
sayusyz
Great detailed pictures. I'm curious where general hinting belongs.

~~~
Jasper_
"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...](https://docs.google.com/document/d/1wpzgGMqXgit6FBVaO76epnnFC_rQPdVKswrDQWyqO1M/edit)

~~~
criddell
Now that very high dpi screens are so popular and inexpensive, is subpixel
rendering worth doing anymore?

~~~
raphlinus
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.

~~~
criddell
Do you know if the layout engines for laser printers do subpixel stuff?

~~~
microcolonel
Most laser printers tend to use PostScript (a Turing complete language), which
does not know about displays hardly at all. It does arbitrary positioning.

~~~
criddell
> It does arbitrary positioning.

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

------
amelius
To make it more modern, hopefully they will replace the XML by JSON at some
point.

~~~
Mister_Snuggles
How does replacing XML with JSON make it more modern?

~~~
rurban
smaller, more readable, faster, safer.

