[NTG-context] new upload

kauśika citturs at gmail.com
Sat Jan 22 13:31:42 CET 2022


On Saturday, January 22, 2022 12:58:05 AM IST Hans Hagen via ntg-context 
wrote:
> - initial indic transliteration support .. recent indic (font)
> experiences and transliteration tricks will be eplained by kauśika

Recently when we were troubled by incorrect rendering of certain conjuncts in 
malayalam, Hans added a new font-feature. More below*, but first some 
background: from my testing, the main reason for the problems with fonts seems 
to come from the varied interpretations and/or implementations of OTF 
specification. To add to this complexity there are two script tags (v1, v2 in 
OTF and -one, -two in ConTeXt) for each writing system (script). While there 
are fonts which work very well right away many others have issues and the 
feature was added to somewhat alleviate these issues.

*The feature is 'indic'. It has two aspects: 'movematra' and 'conjuncts'.

conjuncts takes values: mixed | continue | quit | auto
movematra takes values: default | leftbeforebase | auto

By default 
indic=auto 
for indic scripts. So this "should work" in most cases. 

In case there are issues, I have seen that the following approach usually 
yields best result in debugging:
 • try to switch between the -one and -two version of the features (i.e. use 
the v1 or v2 OTF script tag): some fonts may have some rules defined only under 
one of the script tags. (I am not an expert in fonts but with my testing of 
free fonts I have seen this). 
 • if that does not fix (the particular issue), revert to a working feature and 
then set the indic feature as indic={movematra=default,conjuncts=quit} to see
 • Please see:
 https://www.mail-archive.com/ntg-context@ntg.nl/msg99691.html
 issues usually have a pattern (across languages/scripts so some hacks might 
work)

For conjuncts, 'mixed' and 'auto' are synonymous. Setting conjuncts=mixed 
ensures that for some fonts conjuncts with the reph forms are rendered 
correctly. (This was tested with a relatively new font in malayalam using the 
mlm2 script tag).

For problematic fonts, if one can identify which conjuncts work under which 
script tag and/or with what settings for indic, then, using ConTeXt feature 
sets one can easily fix rendering in documents by doing, for instance
 {\feature[=][devanagari-two] …}, and/or
 {\feature[=][devanagari-one] …} accordingly
 See the comprehensive wiki page: 
 https://wiki.contextgarden.net/Featuresets 
for more details on how such feautresets might be built and applied.

Now, a brief note on the transliterations macros. First, one specifies that 
indic transliteration is desired with:
\usetransliteration[indic]

Now, one can transliterate sanskrit to and from various forms by using

\transliterate[scheme]{ … }
where scheme is one of:
    • iast to deva
    • deva to iast
    • deva to mlym
which are respectively the following schemes :
    • IAST → Devanagari
    • Devanagari → IAST
    • Devanagari → Malayalam
More schemes will be added in the near future for various other indic scripts 
as well. Currently there is only support for sanskrit language, which we can 
extend to other languages (wherever the script allows).

Additionally, there is also 
\definetransliteration[…][…]
which can be used to define a specific transliteration block.

So, one just sets vector accordingly to get the desired transliteration block. 
Please see below a minimal example for both:

% SOF
\usetransliteration[indic]
\definetransliteration
    [MyIASTtoDeva]
    [color=blue,
     style=bold,
     language=sa,
     vector={iast to deva}]

\starttransliteration[MyIASTtoDeva]%[color=green]   can set a new color here 
idaṁ śarīraṁ kaunteya kṣetramityabhidīyate.
etadyo vetti taṁ prāhuḥ kṣetrajña iti tadvidaḥ. 
\stoptransliteration

\transliteration[MyIASTtoDeva]{idaṁ śarīraṁ kaunteya kṣetramityabhidīyate}

% or directly 
\transliterate[iast to deva]{idaṁ śarīraṁ kaunteya kṣetramityabhidīyate}
% EOF

kauśika




More information about the ntg-context mailing list