[HarfBuzz] Setting initial cluster value

Khaled Hosny khaledhosny at eglug.org
Sat Jun 25 12:57:38 UTC 2016


On Fri, Jun 24, 2016 at 10:06:07PM -0400, Kelvin Ma wrote:
> How do you set the initial cluster value? So that harfbuzz will start
> counting from some number like 25 instead of 0.

Use hb_buffer_add(), or just do 25 + cluster in your code.

>                                                 Also what’s the point of
> *item_offset* and *item_length* in the buffer_add functions?

It is explained in the documentation:
http://behdad.github.io/harfbuzz/harfbuzz-Buffers.html#hb-buffer-add-codepoints

>                                                               Don’t you need
> context to be ignored if the boundaries of the text you want to shape fall
> inside a cluster? Like in the string 'af[fluency s]tate' where only the
> 'fluency s' is supposed to be shaped?

Depends on why you are shaping “fluency s” alone, if it is because of,
say, font change, then you need HarfBuzz to know the context otherwise
you get broken Arabic shaping.

Regards,
Khaled


More information about the HarfBuzz mailing list