[HarfBuzz] Harfbuzz with linebreaking

Kelvin Ma kelvinsthirteen at gmail.com
Mon Jun 13 15:00:16 UTC 2016


So I’ve not received an answer to this anywhere, so, how do I typeset
paragraphs with Harfbuzz? How do I use the ‘safe-to-break’ iterator?

Because it sounds like right now I’d have to shape the *entire* paragraph
as one line, then find the last shaped glyph that falls before the cutoff
point, then iterate backwards from the character corresponding to the glyph
following *that*, on each breakpoint, reshaping the whole line each time
until something fits. Then I’d have to do that all over again for the
second line until the entire paragraph is shaped. So to typeset 5 lines of
text I’d have to shape about 22 lines of text. To typeset a 20 line
paragraph I’d have to shape about 240 lines of text.

Surely this is not how harfbuzz expects users to use it?

(Asking because I need harfbuzz for my typesetter app
<https://github.com/kelvin13/Knockout>)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/harfbuzz/attachments/20160613/1e8824f3/attachment.html>


More information about the HarfBuzz mailing list