[HarfBuzz] Setting initial cluster value

Kelvin Ma kelvinsthirteen at gmail.com
Sat Jun 25 16:00:55 UTC 2016


On Sat, Jun 25, 2016 at 8:57 AM, Khaled Hosny <khaledhosny at eglug.org> wrote:

> 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
>
>
So you have to add the text to the buffer one letter at a time? That could
get very slow with python loops and function calls


> >                                                               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.
>

Well font change would produce a separate run that wouldn’t know about the
other runs so context can only be within a same-direction, same-font run.
But would adding the context & using the start and finish indexes cause
latin ligatures like fi to get shaped when they shouldn’t be is what I’m
asking?


>
> Regards,
> Khaled
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/harfbuzz/attachments/20160625/c9bc01af/attachment.html>


More information about the HarfBuzz mailing list