Hi Deepak,

On 15-12-22 04:35 PM, Deepak Jois wrote:
> I was adding support for hb_buffer_add_codepoints in luaharfbuzz[1],
> and I was confused about how clustering works:
> 
> 1. Is it valid, if I initialise a buffer and then call
> hb_buffer_add_utf8, followed by hb_buffer_add_codepoints?

Yes.


> 2. When I try do the above by calling hb_buffer_add_utf8 with UTF8
> string ‘یہ ’ (U+06CC U+06C1 U+0020), followed by calling
> hb_buffer_add_codepoints with an array containing { U+06CC, U+06C1 },
> and then shape the output with Amiri font, I get this (offset and
> advance values elided for simplicity):

Arbitrary cluster values are supported.  So you are allowed to get access to
the buffer and modify cluster values before calling hb_shape().  So, you can
adjust to whatever scheme you like.


> {
>   {
>     cluster = 1,
>     codepoint = 2250,
>     …
>   },
>   {
>     cluster = 0,
>     codepoint = 2106,
>     …
>   },
>   {
>     cluster = 4,
>     codepoint = 3,
>     …
>   },
>   {
>     cluster = 2,
>     codepoint = 2250,
>     …
>   },
>   {
>     cluster = 0,
>     codepoint = 2106,
>     …
>   }
> }
> ---
> 
> What is the right way to correlate the cluster values to the original input?

Really whatever you (the client) want it to mean.

behdad

> Deepak
> 
> [1]:https://github.com/deepakjois/luaharfbuzz
> _______________________________________________
> HarfBuzz mailing list
> [email protected]
> http://lists.freedesktop.org/mailman/listinfo/harfbuzz
> 
_______________________________________________
HarfBuzz mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/harfbuzz

Reply via email to