Minimal example for Cyrillic
Hello! Cyrillic characters get transliterated after being processed by "texexec". The following example: \enableregime[utf] \useencoding[cyr] \definetypeface[russian][rm][serif][computer-modern][default][encoding=t2a] \setupbodyfont[russian,24pt] \starttext Немного русского текста для пробы. \stoptext produces this result: Nemnogo russkogo teksta dlya probery. Solution posted at "http://www.ntg.nl/pipermail/ntg-context/2008/035330.html" no longer works with context version "ConTeXt ver: 2010.09.09 23:45 MKII fmt: 2010.9.10 int: english/english" but produces the following message: ! Font \*russian12ptrmtfrm*:=larm1000 at 12.0pt not loadable: Metric (TFM) file not found. <to be read again> Thank you for help. -- http://www.fastmail.fm - Faster than the air-speed velocity of an unladen european swallow
On Thu, Mar 31, 2011 at 12:22, Aleksandr Sinicyn wrote:
Hello!
Cyrillic characters get transliterated after being processed by "texexec".
The following example:
\enableregime[utf] \useencoding[cyr] \definetypeface[russian][rm][serif][computer-modern][default][encoding=t2a] \setupbodyfont[russian,24pt] \starttext Немного русского текста для пробы. \stoptext
produces this result:
Nemnogo russkogo teksta dlya probery.
Solution posted at "http://www.ntg.nl/pipermail/ntg-context/2008/035330.html" no longer works with context version
"ConTeXt ver: 2010.09.09 23:45 MKII fmt: 2010.9.10 int: english/english"
but produces the following message:
! Font \*russian12ptrmtfrm*:=larm1000 at 12.0pt not loadable: Metric (TFM) file not found. <to be read again>
If nothing else the minimals don't ship with cm-super or lh (or whatever font is needed to get the basic cyrillic work in CM style). What TeX distribution do you use? Mojca
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/
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@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 ___________________________________________________________________________________
On Thu, Mar 31, 2011 at 17:14, Thomas A. Schmitz
Explanation: gentium is in the minimal distribution
Aha. I didn't notice that because LuaTeX found my OS-installed one first, and so used that. mathew -- URL:http://www.pobox.com/~meta/
On Fri, Apr 1, 2011 at 00:14, Thomas A. Schmitz
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?
That was a rhetorical question, right? :) Mojca
participants (4)
-
Aleksandr Sinicyn
-
mathew
-
Mojca Miklavec
-
Thomas A. Schmitz