Changes

Jump to navigation Jump to search
4,800 bytes added ,  03:47, 8 February 2022
In early 2022, Hans made some nice improvements to the indic font system in ConTeXt. This was accompanied by some testing with various available fonts for some indic languages. As a result, there is an improved support for Indic fonts in ConTeXt. Various typescripts were then bundled into the ConTeXt distribution for easy use in documents.
The following table lists fonts that have been tested for use with ConTeXt. The list is by no means extensive: most of the fonts are relatively new and some (ubiquitous) old fonts are absent. If you find a font missing in this list and that works well in ConTeXt, please add it to the list.To use indic fonts place <texcode>\usetypescriptfile[indic]</texcode>in the document head and use {{cmd|definetypeface}} and/or {{cmd|setupbodyfont}} with the following typescripts:
{|cellpadding="5"
|}
= Supported Scripts and Font Features =
The list One can of Indic scripts supported by ConTeXt MkIV and LMTX are:course use fonts not listed above. This section provides some details to this end.
* Devanagari* Bengali* Gujarati* Gurmukhi* Kannada* Malayalam* Oriya* Tamil* Telugu== Font feaures ==
In order to get The OTF specification has two shaping implementations for the proper OpenType features, you need to select indic scripts: the proper feature from 'older' v1 and the following list'newer' v2. [https://docs.microsoft.com/en-us/typography/script-development/devanagari See here] for further details.
* <code>devanagari-one</code>* <code>bengali-one</code>* <code>gujarati-one</code>* <code>gurmukhi-one</code>* <code>kannada-one</code>* <code>malayalam-one</code>* <code>oriya-one</code>* <code>tamil-one</code>* <code>telugu-one</code> Depending on your font, you might need instead: * <code>devanagari-two</code>* <code>bengali-two</code>* <code>gujarati-two</code>* <code>gurmukhi-two</code>* <code>kannada-two</code>* <code>malayalam-two</code>* <code>oriya-two</code>* <code>tamil-two</code>* <code>telugu-two</code> == Script Versions == [https://docs.microsoft.com/en-us/typography/opentype/spec/scripttags Script tags from the OpenType specification] contains second versions for what might be some (or all [I’m afraid I don’t know]) Indic scripts.
Why are those second versions available? From their own explanation:
Features ending in <code>-one</code> use the older OpenType implementation, while the ones ending in <code>-two</code> deploy the newer implementation.
 
These are specified in ConTeXt by the following font features:
 
{| cellpadding="5"
! style="text-align:left;" | Script
! style="text-align:left;" | OTF v1 script tag
! style="text-align:left;" | OTF v2 script tag
|-
| Devanagari
| <code>devanagari-one</code>
| <code>devanagari-two</code>
|-
| Malayalam
| <code>malayalam-one</code>
| <code>malayalam-two</code>
|-
| Telugu
| <code>telugu-one</code>
| <code>telugu-two</code>
|-
| Kannada
| <code>kannada-one</code>
| <code>kannada-two</code>
|-
| Bengali
| <code>bengali-one</code>
| <code>bengali-two</code>
|-
|}
 
Please note that these font features also activate other font features as mandated in the OTF specification. These features can then be used to write typescripts for a font or to use the font directly in documents {{cmd|definefontfamily}} and/or {{cmd|definedfont}}.
 
One of the common problems one might encounter with indic fonts is that of incorrect rendering of conjuncts involving the rakaar. In case any problems are encountered, one can try setting the <code>indic</code> feature (in addition to relevant <code>-one</code> or <code>-two</code> features above) appropriately as follows:
<texcode>
\definefontfeature
[…]
[…]
[indic={matra=auto,conjuncts=quit}]
</texcode>
 
== Sanitizer ==
Sometimes, some fonts might still have issues with certain conjuncts. To overcome this a <code>sanitizer</code> option may be used in defining font features. A goodies file accompanies this option. An example is illustrated below:
 
<texcode>
return {
name = "myfont",
version = "1.00",
comment = "Goodies that complement myfont.",
sanitizers = {
dev2rkrf = {
mapping = {
["के्र"] = "क्रे",
["कै्र"] = "क्रै",
["खे्र"] = "ख्रे",
["खै्र"] = "ख्रै",
["गे्र"] = "ग्रे",
["गै्र"] = "ग्रै",
["घे्र"] = "घ्रे",
["घै्र"] = "घ्रै",
["चे्र"] = "च्रे",
["चै्र"] = "च्रै",
["छे्र"] = "छ्रे",
["छै्र"] = "छ्रै",
["जे्र"] = "ज्रे",
["जै्र"] = "ज्रै",
["झे्र"] = "झ्रे",
["झै्र"] = "झ्रै",
["ञे्र"] = "ञ्रे",
["ञै्र"] = "ञ्रै",
["णे्र"] = "ण्रे",
["णै्र"] = "ण्रै",
["ते्र"] = "त्रे",
["तै्र"] = "त्रै",
["थे्र"] = "थ्रे",
["थै्र"] = "थ्रै",
["दे्र"] = "द्रे",
["दै्र"] = "द्रै",
["धे्र"] = "ध्रे",
["धै्र"] = "ध्रै",
["ने्र"] = "न्रे",
["नै्र"] = "न्रै",
["पे्र"] = "प्रे",
["पै्र"] = "प्रै",
["फे्र"] = "फ्रे",
["फै्र"] = "फ्रै",
["बे्र"] = "ब्रे",
["बै्र"] = "ब्रै",
["भे्र"] = "भ्रे",
["भै्र"] = "भ्रै",
["मे्र"] = "म्रे",
["मै्र"] = "म्रै",
["ये्र"] = "य्रे",
["यै्र"] = "य्रै",
["वे्र"] = "व्रे",
["वै्र"] = "व्रै",
["से्र"] = "स्रे",
["सै्र"] = "स्रै",
["शे्र"] = "श्रे",
["शै्र"] = "श्रै",
["षे्र"] = "ष्रे",
["षै्र"] = "ष्रै",
["हे्र"] = "ह्रे",
["है्र"] = "ह्रै",
}
}
}
}
</texcode>
 
Suppose that for a certain font (say <code>myfont</code>), using <code>devanagari-two</code> features, the above listed ra + consonant + vowel forms are not rendered properly. The above goodies file is then saved as <code>myfont.lfg</code> and used while defining the features thus:
<texcode>
\definefontfeature
[myfontfeatures]
[devanagari-two]
[goodies=myfont.lfg,
sanitizer=dev2rkrf,
indic={movematra=auto,conjuncts=quit}]
</texcode>
Now, <code>myfontfeatures</code> can be used with {{cmd|definedfont}} and/or while writing typescripts for the font.
= Script and language features =
|IAST to Devanagari
|<code>iast to deva</code>
|-
|ITrans to Devanagari
|<code>itrans to deva</code>
|-
|Devanagari to Malayalam
\stoptext
</texcode>
 
Please note that there is also {{cmd|resettransliteration}} which can be used in stream to (temporarily) prevent any transliteration.
== Exceptions ==
107

edits

Navigation menu