[NTG-context] Minimal example for Cyrillic

Thomas A. Schmitz thomas.schmitz at uni-bonn.de
Fri Apr 1 00:14:56 CEST 2011


Your example is very nice, and I appreciate that you took the time to comment all this. But actually, all you need is:

\setupbodyfont[gentium,12pt]

and then your text. Explanation: gentium is in the minimal distribution, there's a typescript for it (context/tex/texmf/tex/context/third/gentium/type-gentium.tex), and if the bodyfont and the typescript have the same name, context will find it automagically. Mojca, did we add something about this to the wiki? 

Thomas

On Mar 31, 2011, at 4:44 PM, mathew wrote:

> Here's a full working Cyrillic (and Greek) example, with comments:
> 
> %&context
> %
> % Example of Cyrillic in ConTeXt.
> %
> % For plain text, I'm using Gentium Plus, which has more glyphs but doesn't yet
> % have bold and italic variants.
> %
> % You can obtain Gentium Plus from http://scripts.sil.org/gentium
> %
> \starttypescript [serif][gentium][name]
>  \definefontsynonym [Serif]        	  [name:gentiumplus]
>  \definefontsynonym [SerifBold]		    [name:gentiumbasicbold]
>  \definefontsynonym [SerifItalic]      [name:gentiumbasicitalic]
>  \definefontsynonym [SerifSlanted]     [name:gentiumplus]
>  \definefontsynonym [SerifBoldItalic]  [name:gentiumbasicbolditalic]
>  \definefontsynonym [SerifBoldSlanted] [name:gentiumbasicbold]
>  \definefontsynonym [SerifCaps]        [name:gentiumplus]
> \stoptypescript
> 
> % Now define a typescript which groups together the three chosen fonts, and
> % sets their relative sizes.
> % Two arguments: 'myfonts' is the name, 'default' is the character encoding.
> \starttypescript [myfonts][default]
>    % For each typeface definition:
>    % - The first parameter is the name for the typeface collection, which
>    %   may be a font family, or just a set of fonts that work well together.
>    %   Whatever the case, it's the name we'll use to select this set of
>    %   fonts later.
>    % - The next parameter is a basic style; typically we'll have one line
>    %   for each basic style, but I'm skipping mm (math mode) in this example.
>    % - Then there are three arguments which are used to locate a typescript
>    %   defined earlier. Note that [default] matches our earlier definitions
>    %   because they were all implicitly in the default text encoding.
>    % - Finally, any options, most commonly adjustments to relative scaling
>    %   so the fonts work together.
>    \definetypeface [nicefonts][rm][serif][gentium] [default]
> \stoptypescript
> 
> % Now tell ConTeXt to actually execute the typescript we defined immediately
> % above, and hence any typescripts it depends on.
> %
> % This executes the \definetypeface calls to define our typeface set.  Again,
> % myfonts is the name of the typescript, default is the character encoding.
> \usetypescript[myfonts][default]
> 
> % Finally, use that typeface set, at 10pt base size.
> % Calling setupbodyfont changes headers and footers as well as body text;
> % switchtobodyfont just changes body text.
> \setupbodyfont[nicefonts,10pt]
> 
> % And finally, the actual document
> \starttext
> 
> Улице найденных совершенно на тд. Можно статьи команды он без. Одну филипа
> обычно по вот. Мои статьи человек процессе те, могу фирме всё он, ну над никто
> размере русском. Опа до раздавая правильно, нейманом содержимое об над. Те
> взяться плохого код, свой осуществлять все не.
> 
> Here's some Greek too:
> 
> Αν σωστά νόμιζες της, έτσι γραμμής βασανίζουν να πως, κι εκτός μάλλον όσο.
> Πετούν παραγωγικής οι σας, έξι τελικά κάνεις σε. Μέρος υπέροχα τελειώσει όρο
> δε. Δε νέο πάτο διακοπή, επί αφού κειμένων αποφάσισε πω. Τέτοιο βασανίζουν από
> ως. Σας σχεδιαστής χρησιμοποιήσει τι, γέλασαν διάσημα δημιουργείς το που.
> 
> \showbodyfont[gentium]
> 
> \stoptext
> 
> 
> mathew
> -- 
> http://www.pobox.com/~meta/
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context at 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
> ___________________________________________________________________________________



More information about the ntg-context mailing list