logoalt Hacker News

djoldmantoday at 1:48 PM1 replyview on HN

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


Replies

gudzpoztoday at 5:42 PM

An example: the text "Hello There إلا بسم الله Beep Boop!!" should turn into two visual lines as follows if it is line-wrapped:

    Hello There إلا
    بسم الله Beep Boop!!
Notice how "إلا" goes from the fifth word (from left to right) to the third after the line wrap. This won't work if shaping happens before line wrapping.
show 1 reply