[HarfBuzz] [Harfbuzz] Issue in Malayalam String Rendering

Uvaraja Pandian p.uvaraja at gmail.com
Thu Sep 11 03:17:25 PDT 2014


PSB with comment [UvarajaP].

On Thu, Sep 11, 2014 at 3:24 PM, Rajeesh K Nambiar <
rajeeshknambiar at gmail.com> wrote:

>
>
> On Thu, Sep 11, 2014 at 11:06 AM, Uvaraja Pandian <p.uvaraja at gmail.com>
> wrote:
>
>> Hi  Team,
>>
>>
>>
>> We are using the Harfbuzz 0.9.34 version.
>>
>>
>>
>> While rendering the Malayalam string using the Harfbuzz and Freetype
>> engine, we see some issues.
>>
>>
>>
>> *String used: *ക്കേ
>>
>> *Unicode value:* 0x0d15, 0x0d4d, 0x0d15, 0x0d47, 0x0000
>>
>>
>>
>> *Harfbuzz Output:*
>>
>>
>>
>> *Proper Output :*
>>
>>
>>
>> *Font File used:* Akruti Family, Since this is a licensed font file, we
>> are not able to share it.
>>
>>
>>
>> *Issue in Detail:*
>>
>>
>>
>> In the font file,
>>
>> script mlym {
>>
>>   # Malayalam
>>
>>   feature Akhands;
>>
>>   feature BelowBaseSubstitutions;
>>
>>   feature *HalfForms*;
>>
>>   feature PostBaseForms;
>>
>>   feature PostBaseSubstitutions;
>>
>>   feature *PreBaseSubstitutions*;
>>
>> }
>>
>>
>>
>> As per the Harfbuzz implementation, below substitution is happening as
>> part of the HalfForms ,
>>
>> 0x0d15 & 0x0d4d è XYZ character,
>>
>>
>>
>> so the output is XYZ, 0x0d15, 0x0d47
>>
>>
>>
>> Final re-ordering happens and rearranges as below,
>>
>> XYZ, 0x0d15, 0x0d47 è XYZ, 0x0d47, 0x0d15
>>
>
> Does final_reordering happen before applying 'pres' lookup?
>
[UvarajaP] Yes, as per the HARFBUZZ logic in  indic_features[] list, PRES
is applied after the final_reordering.

>
>
>>
>>
>> As per the PreBaseSubstitutions,
>>
>> XYZ & 0x0d15 is not matched and the output is not proper.
>>
>
>>
>
> If the font has a 'pres' rule for XYZ, 0x0D15, the conjunct should form
> correctly.
>
[UvarajaP]  Font file has a substitution rule for XYZ and 0xOD15
combination. However in  final_reordering() it has changed the order, so it
is not able to match the substitution rule.

>
>
>> In-Order to solve this issue, below changes has been done,
>>
>>
>>
>> Final Re-ordering,
>>
>> PSB for the code changes
>>
>>
>>
>> As per the PreBaseSubstitutions,
>>
>> XYZ & 0x0d15 forms the final character.
>>
>>
>>
>> *Code Modifications:*
>>
>> In the file hb-ot-shape-complex-indic.cc, if we modify the lines as below
>> in the function final_reordering_syllable() it is working,
>>
>>
>>
>>   if (start + 1 < end && start < base) /* Otherwise there can't be any
>> pre-base matra characters. */
>>
>>   {
>>
>>           /* If we lost track of base, alas, position before last thingy.
>> */
>>
>>           unsigned int new_pos = base == end ? base - 2 : base - 1;
>>
>>
>>
>>     /* Malayalam / Tamil do not have "half" forms or explicit virama
>> forms.
>>
>>      * The glyphs formed by 'half' are Chillus or ligated explicit
>> viramas.
>>
>>      * We want to position matra after them.
>>
>>      */
>>
>>           if (buffer->props.script != HB_SCRIPT_MALAYALAM &&
>> buffer->props.script != HB_SCRIPT_TAMIL)
>>
>>          {
>>
>>>>
>>           }
>>
>>
>>
>>                        if (start < new_pos &&
>> info[new_pos].indic_position () != POS_PRE_M)
>>
>>                        {
>>
>>>>
>>                        } else {
>>
>>>>
>>                        }
>>
>>         }
>>
>>   }
>>
>>
>>
>> Please comment, will it have any side effect.
>>
>>
>>
>> Best Regards,
>>
>> Uvaraja P.
>>
>> Sindhura P.
>>
>>
>>
>>
>
>
> --
> Rajeesh
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/harfbuzz/attachments/20140911/3ce3cfac/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 2413 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/harfbuzz/attachments/20140911/3ce3cfac/attachment-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 1266 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/harfbuzz/attachments/20140911/3ce3cfac/attachment-0001.png>


More information about the HarfBuzz mailing list