[HarfBuzz] Cluster value in hb_glyph_info_t when codepoint is zero

Preet prismatic.project at gmail.com
Wed Apr 30 00:30:01 PDT 2014


Hi all,

I'm new to i18n and to text rendering so please bear with me if I'm
asking something odd or obvious.

After shaping a run of text with harfbuzz, you can get a codepoint
(font glyph index) and cluster back for each glyph that remains.

I want to use said cluster info to help me do line breaking later
on... but when the font doesn't have the codepoint in question (or any
other condition that causes harfbuzz to set hb_glyph_info_t.codepoint
= 0 occurs), the cluster value is invalid as well. For example, the
post shaping clusters for the following text when a Korean language
font isn't present:

input: "안녕하세요"
clusters: 32767,32767,32767,32767,32767

Is it possible to figure out which cluster the missing glyph belonged
to (aside from the example case which is obvious)? My use case is
implementing a custom 'missing glyph' bitmap that isn't tied a single
font for redundancy, so I need reverse lookup even when harfbuzz
doesn't shape a glyph.


Regards,

Preet


More information about the HarfBuzz mailing list