Changes

Jump to navigation Jump to search
3,724 bytes added ,  20:51, 12 October 2008
no edit summary
< [[Fonts]] | [[Encodings and Regimes]] >
 
== Using cyrillic with ConTeXt MkIV ==
 
'''''Note:''''' ''The examples in this section were tested on recent (2008-10) ConTeXt minimals. If something does not work as written feel free to change them.''
 
After installing the latest and greatest ConTeXt distribution and especially while trying to use MkiV you may notice that your old typescript definitions does not work anymore. For guidance about adjusting typescripts see upcoming ConTeXt manual (especially chapters about [http://context.aanhet.net/svn/contextman/context-reference/en/co-fonts.pdf fonts] and [http://context.aanhet.net/svn/contextman/context-reference/en/co-typography.pdf typography]). Here are examples for writing cyrillic using only fonts that comes with ConTeXt. For quick start try:
 
<texcode>
\usetypescript[postscript]
\setupbodyfont[postscript,10pt]
\starttext
Немного русского текста для пробы.
\stoptext
</texcode>
 
Please note that in ConTeXt MkIV UTF-8 input encoding is the default, so writing <code>\enableregime[utf]</code> is no longer necessary (an least works for me).
 
Nowadays the ConTeXt minimals distribution includes TeX Gyre fonts. Most of them contain cyrillic characters and all low-level mappings are already predefined (see [[source:type-otf.tex|type-otf.tex]]), so to use TeX Gyre fonts a few simple typeface definitions would suffice.
 
<texcode>
\starttypescript[gyre]
\definetypeface [gyre-pala] [rm] [serif] [pagella]
\definetypeface [gyre-pala] [ss] [sans] [heros]
\definetypeface [gyre-pala] [tt] [mono] [courier]
\definetypeface [gyre-pala] [mm] [math] [palatino]
 
\definetypeface [gyre-book] [rm] [serif] [bonum]
\definetypeface [gyre-book] [ss] [sans] [adventor]
\definetypeface [gyre-book] [tt] [mono] [courier]
\definetypeface [gyre-book] [mm] [math] [palatino]
\stoptypescript
 
\definetypeface [gyre-schol] [rm] [serif] [schola]
\definetypeface [gyre-schol] [ss] [sans] [adventor]
\definetypeface [gyre-schol] [tt] [mono] [courier]
\definetypeface [gyre-schol] [mm] [math] [palatino]
\stoptypescript
 
\definetypeface [gyre-termes] [rm] [serif] [termes]
\definetypeface [gyre-termes] [ss] [sans] [adventor]
\definetypeface [gyre-termes] [tt] [mono] [courier]
\definetypeface [gyre-termes] [mm] [math] [palatino]
 
\definetypeface [gyre-pala] [rm] [serif] [pagella]
\definetypeface [gyre-pala] [ss] [sans] [heros]
\definetypeface [gyre-pala] [tt] [mono] [courier]
\definetypeface [gyre-pala] [mm] [math] [palatino]
\stoptypescript
</texcode>
 
''If someone tell me why small-caps doesn't work with these definitions, this would be perfect!''
 
Put these in <code>type-loc.tex</code> file, place it somewhere luatex can find it (texml-local tree is a good candidate), regenerate filename cache (<code>luatools --generate</code>), and use as:
 
<texcode>
\usetypescript[gyre]
\setupbodyfont[gyre-pala] % can be gyre-termes, gyre-book, etc.
\startext
Ещё немного кириллицы.
\stoptext
</texcode>
 
Note that I don't use cursor font here as it seem to not have cyrillic characters. If you don't like these combinations modify the definitions as you see fit.
 
For complete russian language typesetting a few adjustments to config files are needed:
 
* Uncomment <code>\installlanguage [\s!ru] [\c!state=\v!start]</code> in [[source:cont-usr.tex|cont-usr.tex]] (can be found in tex/texmf-context/tex/context/config in minimals.
* Add <code>\input lang-cyr</code> somewhere in [[source:cont-usr.tex|cont-usr.tex]] (for russian month names, translated labels like "table of contents", etc.; found in tex/texmf-context/tex/context/user in minimals).
* Don't forget to change your language in documents (<code>\mainlanguage[ru]</code> for mainly russian documents).
== Russian (Cyrillic) fonts and UTF ==
1

edit

Navigation menu