[HarfBuzz] Ligatures

Richard Wordingham richard.wordingham at ntlworld.com
Fri May 22 22:18:00 UTC 2020


On Fri, 22 May 2020 22:32:04 +0300
Eli Zaretskii <eliz at gnu.org> wrote:

> Can someone please tell what are the recommended practices regarding
> these ligatures?  Is the set of possible ligatures indeed infinite and
> impossible to know in advance?  And does HarfBuzz have APIs to query a
> font about the ligatures it supports?

hb_ot_layout_get_ligature_carets() is liable to be garbage in garbage
out.  While the cursor positions were included in OTL fonts to assist
cursor placement, it obviously fails when the components are stacked
vertically. Microsoft gave up on it and, if I remember the informal
statement correctly, just divides it up evenly between the characters
or grapheme clusters.  Many OpenType fonts don't populate the relevant
section of the GDEF table. And, of course, one has real trouble when
one glyph can come from different numbers of components.

LibreOffice takes (or took) a different approach, and uses the width of
the characters logically before the insertion point.  It's rather
disconcerting when the cursor jumps backwards as one steps through the
string.  It could happen with the Latin script string "a͡i", for the
'double' inverted breve should shorten when the second letter is 'i'.
One can get the effect in Indic scripts because of spacing viramas.

Richard.


More information about the HarfBuzz mailing list