[HarfBuzz] isLetter function problems with indic characters

Pravin Satpute psatpute at redhat.com
Mon Sep 20 02:02:03 PDT 2010


On 09/20/2010 12:11 PM, Peter Hunter wrote:
>
> I happened to come across the same issue
>
> Seems to me that the return value for isLetter (and IsMark) is
> incorrectly determined
>
> i.e.
>
> static HB_Bool isLetter(HB_UChar16 ucs)
>
> {
>
>     const int test = FLAG(HB_Letter_Uppercase) |
>
>                      FLAG(HB_Letter_Lowercase) |
>
>                      FLAG(HB_Letter_Titlecase) |
>
>                      FLAG(HB_Letter_Modifier) |
>
>                      FLAG(HB_Letter_Other);
>
>     return FLAG(HB_GetUnicodeCharCategory(ucs)) & test;
>
> }
>
>  
>
> The return value is a HB_BOOL (which is a byte) whereas the computed
> mask value for everything other than HB_Letter_Other is greater than 256.
>
> A more appropriate return value would be
>
>     return (FLAG(HB_GetUnicodeCharCategory(ucs)) & test) != 0;
>

Aha, applying this, gives correct output to me.

Thanks,
Pravin S
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/harfbuzz/attachments/20100920/b431db65/attachment.html>


More information about the HarfBuzz mailing list