> it took me quite a while to notice that it's a side effect of two features 
> that are turned on
> 
> you can play with
> 
> \definefontfeature
>  [devanagari-one]
>  [devanagari-one]
>  [rphf=no]
> 
> and
> 
> \definefontfeature
>  [devanagari-one]
>  [devanagari-one]
>  [half=no]
> 
> maybe Kai can have a look at it: as these are dealt with in a different we 
> probably don't need to enable them in the feature processor (even block them)
> 
> btw, you can play with
> 
> \showotfcomposition{file:chandas.ttf*devanagari-one}{l2r}{\char"0915 
> \char"094D \char"0930}
> 
> to see what happens
> 
> (i also noticed a few possible further optimizations but that's for later)
> 
> Hans

Thanks, Hans.

Those are indeed the relevant features. Unfortunately, turning them off 
completely breaks other things. I have attached another demonstration below. 
The good news is that we can now produce proper devanagari by switching the 
features on and off as needed in the middle of words. I am understanding 
OpenType better now and I will try again to look at the relevant source code 
tonight.

-Peter
--------------------------
\definefontfeature[devyes][devanagari-one][rphf=yes,half=yes]
\definefontfeature[devno][devanagari-one][rphf=no,half=no]

\definefont [DevaWith] [file:chandas.ttf*devyes at 14pt]
\definefont [DevaWithout] [file:chandas.ttf*devno at 14pt]

\starttext

{\bf When rphf=yes (current default)}

r-first conjucts ([r]+[half]+\{consonant\}) work:

{\DevaWith [U+0930 \char"0930][U+094D \char"094D][U+0915 \char"0915]: 
\char"0930 \char"094D \char"0915 ~(correct)}

but r-second conjucts (\{consonant\} +[half]+[r]) don't:

{\DevaWith [U+0915 \char"0915][U+094D \char"094D][U+0930 \char"0930]: 
\char"0915 \char"094D \char"0930 ~(incorrect)}

\blank[big]

{\bf When rphf=no}

r-first conjucts ([r]+[half]+\{consonant\}) stop working:

{\DevaWithout [U+0930 \char"0930][U+094D \char"094D][U+0915 \char"0915]: 
\char"0930 \char"094D \char"0915 ~(incorrect)}

but r-second conjucts (\{consonant\} +[half]+[r]) now work properly:

{\DevaWithout [U+0915 \char"0915][U+094D \char"094D][U+0930 \char"0930]: 
\char"0915 \char"094D \char"0930 ~(correct)}


\blank[3*big]


{\bf When half=yes (current default)}

consonant clusters (\{consonant\}+[half]+\{consonant\}) work:

{\DevaWith [U+0915 \char"0915][U+094D \char"094D][U+0915 \char"0915]: 
\char"0915 \char"094D \char"0915 ~(correct)}

but word-final viramas (\{consonant\} +[half]) don't:

{\DevaWith [U+0915 \char"0915][U+094D \char"094D] : \char"0915 \char"094D 
~(incorrect)}

\blank[big]

{\bf When half=no}

consonant clusters (\{consonant\}+[half]+\{consonant\}) stop working:

{\DevaWithout [U+0915 \char"0915][U+094D \char"094D][U+0915 \char"0915]: 
\char"0915 \char"094D \char"0915 ~(incorrect)}

but word-final viramas (\{consonant\} +[half]) work properly:

{\DevaWithout [U+0915 \char"0915][U+094D \char"094D] : \char"0915 \char"094D 
~(correct)}


\blank[2*big]

With careful bracketing, it's possible to produce correct devanagari.

On: {\DevaWith 
\char"092E\char"0915\char"094D\char"0915\char"092E\char"0915\char"094D} (no 
good)

Off: {\DevaWithout 
\char"092E\char"0915\char"094D\char"0915\char"092E\char"0915\char"094D} (no 
good)

Mixed: {\DevaWith 
\char"092E\char"0915\char"094D\char"0915\char"092E{\DevaWithout 
\char"0915\char"094D}} (perfect)

That's not sustainable for long texts, perhaps, but it's a great move in that 
direction.

\blank[big]

Note: I've used the consonant [U+0915: {\DevaWith \char"0915}] here throughout, 
but you can substitute any consonant \{U+0915--U+0939, U+0958--U+095F\} and see 
the same patterns.

\stoptext
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to