[HarfBuzz] Getting the number of Graphmes for a ligature

Behdad Esfahbod behdad at behdad.org
Mon Oct 25 18:21:30 PDT 2010


On 10/25/10 09:25, Tom Hacohen wrote:
> Hey all,
> 
> I wonder, is there a way to get the number of Graphmes for a ligature?
> I can just take the cluster index and the next cluster index (or in rtl
> texts the other way around) and by that find the number of items,  but
> this means I will have to handle the special case of just one ligature
> in the text (because I won't have a next item).

That's how it should be done in the current design, and what Pango does
indeed.  For the last cluster, you need to take the length of the original
text into account, yes.  I've been thinking about adding a sentinel item at
the end of the buffer to help with that (setting the cluster index to the
position after all text), but that fails in the rtl situation.

behdad


> Thanks,
> Tom.
> 
> _______________________________________________
> HarfBuzz mailing list
> HarfBuzz at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/harfbuzz
> 



More information about the HarfBuzz mailing list