Hi, Le 6 août 2011 à 20:28, Jean-Philippe Rey a écrit :
Hi everybody,
I have an almost finished report inside which I need to typeset some russian words. I am using ConTeXt Standalone current (2011.05.18 18:04 MKII). Reading the wiki, it seems that there are no more fonts with cyrillic glyphs in this distribution. So I switched to XeTeX in order to use my system fonts. Unfortunately I stumbled into a problem when combining my fr settings with a font switching command.
Here is a minimal example.
\mainlanguage[fr] \useencoding[ffr]
\definefontsynonym[CyrF][name:Lucida Grande] \definefont[Russian][CyrF sa 1]
\starttext Quelques caractères cyrilliques {\Russian Мама и Папа} et on continue tranquillement. \stoptext
If I delete either line \mainlanguage[fr] or \useencoding[ffr] everything works fine (for the font switching, but obviously not for the other part of my report :-).
I think I found an explanation of the problem stated above. ":" is made active by \mainlanguage[fr] AND \useencoding[ffr]. I initially thought that only the latter activates :, but obviously both are needed in order to change the status of :. I've found three workarounds : 1) don't use the "name:" prefix, if a font file is not found, a system font with that name will be selected. However, this doesn't work for fonts with spaces in their name. 2) deactivate the colon character before calling \definefontsynonym and reactivate it after (quite ugly in my opinion) \catcode`\:=12 \definefontsynonym[TNR][name:Times New Roman] \catcode`\:=13 3) reorder the instructions (not always easy for complex documents) \definefontsynonym[TNR][name:Times New Roman] \definefont[MyFont][TNR] \mainlanguage[fr] \useencoding[ffr] \starttext Text in the default font. {\MyFont This is Times New Roman.} Back to the default font. \stoptext -- Jean-Philippe Rey jean-philippe.rey@ecp.fr