[HarfBuzz] Contextual shaping of Malayalam post(pre)/below base forms

Rajeesh K Nambiar rajeeshknambiar at gmail.com
Mon Jul 1 10:47:49 PDT 2013


On Thu, Jun 27, 2013 at 2:02 AM, Behdad Esfahbod <behdad at behdad.org> wrote:
> On 13-06-26 07:59 PM, Richard Wordingham wrote:
>> On Wed, 26 Jun 2013 19:09:54 -0400
>> Behdad Esfahbod <behdad at behdad.org> wrote:
>>
>>> Humm.  Ok, now I know.  In the particular sequence y1 is the base,
>>> right?  If yes, then it is NOT marked for the pref feature.  <pref>
>>> is applied to all characters after the base.
>>
>> Glyph y1 was the base in my test case, but the problem still applies
>> if I expand the input to the unlikely sequence <PA, VIRAMA, YA,
>> VIRAMA, RA> (as in the string പ്യ്രക്രഖ്ര ).  The <VIRAMA, RA> still forms the
>> prebase ra.
>>
>>>  I believe that's why your original design wasn't working.
>>
>> The logic to mark for the <pref> feature in 0.9.18 is
>>
>>     for (unsigned int i = base + 1; i + 1 < end; i++) {
>>       hb_codepoint_t glyphs[2] = {info[i].codepoint, info[i +
>> 1].codepoint};
>>       if (indic_plan->pref.would_substitute (glyphs, ARRAY_LENGTH
>>       (glyphs), true, face))
>>       {
>>         info[i++].mask |= indic_plan->mask_array[PREF];
>>         info[i++].mask |= indic_plan->mask_array[PREF];
>>         ...
>>
>> in function initial_reordering_consonant_syllable() in
>> hb-ot-shape-complex-indic.cc.
>>
>> I surmise that the marking is more specific for <pref> because pre-base
>> rearrangement looks for an isolated glyph marked for <pref>; this
>> should work, because Uniscribe forbids Malayalam from having two
>> pre-base ra's in the same syllable.
>
> Right.  That's why, indeed.
>
>
>>> Still I'm
>>> interested to double check that Uniscribe does the same.
>>
>> Test font is being sent off-list.
>>
>>>> I haven't yet worked out how HarfBuzz distinguishes a pre-base
>>>> <VIRAMA,
>>>> RA> ligature formed by the <pref> feature from a post-base <VIRAMA,
>>>> RA> RA>
>>>> ligature formed by the <pstf> feature,
>>
>>> It doesn't.
>>
>> One fix would be to remove <pref> marking from consecutive pairs of
>> glyphs immediately after the <pref> feature has been applied.  I can't
>> quantify the practical benefit.
>
> Yeah, lets wait until someone needs that and then try to figure out what
> Uniscribe does.

Not sure if related to this, but similar behaviour is observed with
<pstf> Ya and Va forms as well. For example, test case 1 in the
in-tree test file 'അഥൎവ്വം' was failing to render 'ൎവ്വ'
<dotreph,Va,Virama,Va> correctly even after adding a <akhn> rule for
it - the last <Virama,Va> was already forming <pstf> form of Va and
thus a <psts> rule involving <dotreph, Va, pstf_Va> was needed to get
a correct rendering.

>
> --
> behdad
> http://behdad.org/
> _______________________________________________
> HarfBuzz mailing list
> HarfBuzz at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/harfbuzz



--
Cheers,
Rajeesh
http://rajeeshknambiar.wordpress.com



More information about the HarfBuzz mailing list