[HarfBuzz] Ligatures

Eli Zaretskii eliz at gnu.org
Sun May 24 15:41:04 UTC 2020


> > I almost understand (and agree), sans one part: the "arbitrary parts"
> > of what you wrote.  If we want to produce a ligature out of "ffi", the
> > shaper will get "fii" and nothing more.  Which part here is arbitrary?
> 
> Sending "ffi" alone is an arbitrary decision. The font might have kerning between "ffi" and what comes before and after it, but you won't get it. The font might not have a ligature for "ffi" at all, but using kerning instead, so you will get kerning between "ffi" glyphs and not other glyphs which is arbitrary. It might be a cursive font that changes glyph shapes based on surrounding glyphs, and you will get that for "ffi" and not elsewhere which is arbitrary.
> 
> That is just plain wrong, there is no way around it.

So, to make sure I understand the correct solution: you are saying
that all the text to be displayed should go through the shaper, is
that right?

If so, how large should be the chunks of text to be passed to the
shaper in any one call, in order to have a correct result?  Would it
be enough to pass whitespace-separated words one by one? or do we need
to send entire physical lines (up to the terminating newline
character)? or maybe an entire paragraph?  What is the recommendation
here?

Thanks.


More information about the HarfBuzz mailing list