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

Suresh P sureshp at gmx.com
Tue Jun 18 07:03:05 PDT 2013

Richard Wordingham wrote:
> On Mon, 17 Jun 2013 08:47:10 +0530
> Suresh P<sureshp at gmx.com>  wrote:
>> Behdad Esfahbod wrote:
>>> On 13-06-13 07:57 AM, Suresh P wrote:
>>>> Behdad Esfahbod wrote:
>>>>> On 13-06-11 07:29 AM, Suresh P wrote:
>>>>>> I want to know whether it is possible to prevent pref and blwf
>>>>>> rules being applied using contextual rules
>>>> But I find the ligation(for pref and blwf) always happen
>>>> irrespective of the rules in the contextual lookup.
>> Okay, as per the spec.
>>>     Show us the font and malfunctioning sequence.
>> There is no malfunctioning as such. But is looks weird when one see a
>> pre-base RA in front of a base YA ( and a below base LA subjoining
>> YA ) because it is never written like this. Instead, in actual use,
>> ligation (and reordering) is avoided and written with explicit
>> virama. A test case is attached herewith and it applies to any font
>> which uses pre-base RA and below base LA. It is better left to the
>> font developer to decide the contexts.
> I'll offer my understanding of the situation.  If my explanation
> doesn't help you, it may be necessary to examine the actual <GSUB>
> table of your font to explain what is happening, and other tables will
> provide context for it.
> So what you want in exactly one lookup for the <blwf> feature:
> In context <ya virama la> do nothing
> else in context <virama la> ligate virama la.
It seems neither blwf ligature lookup for <VIRAMA LA> nor pref lookup 
for <VIRAMA RA> honour the contextual lookups. :(  The calt feature I 
used for YA VIRAMA LA with fontforge was:

lookup caltContextualAlternatesinMalay {
   lookupflag 0;
     ignore sub [\b_ya \m_U \b_la]'
} caltContextualAlternatesinMalay;

feature calt {
   script mlm2;
      language dflt ;
       lookup caltContextualAlternatesinMalay;

} calt;

Also tried [\b_ya] [\m_U]' [\b_la].
> (The second, normal condition will invoke a ligature lookup.)
> That should do what you want; are you having trouble expressing that
> in the lookup definition language you are using?
> The same trick should work with the <pref> feature:
> In context <ya virama ra> do nothing
> else in context <virama ra> ligate virama ra.
> Again, the second, normal condition will invoke a ligature lookup.
> This ligature lookup should *not* be listed under the <pref> feature.
> The OpenType specification at
> http://www.microsoft.com/typography/OpenTypeDev/malayalam/intro.htm
> says:
> "Reorder pre-base reordering consonants: If a pre-base reordering
> consonant is found, reorder it according to the following rules:
> 1.   Only reorder a glyph produced by substitution during application
>       of the <pref> feature. (Note that a font may shape a Ra consonant
>       with the <pref> feature generally but block it in certain
>       contexts.)
> ..."
> This is exactly the logic you want.
>    RA will be classified as a
> pre-base reordering consonant, but not reordered in the context <ya
> virama ra> because there will be no substitution resulting from
> application of the <pref> feature.  I don't know if this rule applies
> to the old Malayalam rendering engine - you may need to ensure that you
> have the script tag <mlm2> rather than <mlym> in the <GSUB> table.
The font contains script tags for both versions and I think harfbuzz 
defaults to mlm2.
> Richard.
> _______________________________________________
> HarfBuzz mailing list
> HarfBuzz at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/harfbuzz

More information about the HarfBuzz mailing list