Michal Ondrejáš
4. April 2016 um 15:17
Hello

I need some help regarding font definitions.

The situation is like this:

\definefont
[issuefont]
[SansRegular at 14pt]
....
{\issuefont \labeltext{issue} \crlf \documentvariable{issue}}

I need to get chinese text into the issue variable, but for that I need to change the font. I need something like this:

\def\chooseissufont{%
\translate
[zh={Sim Sun},
 en={SansRegular}]}

\definefont
[issuefont]
[\chooseissuefont at 14pt]

Using "zh" is ok, I managed to somehow make ConTeXt accept the "zh" language code. It's not perfect but it's for another topic. I get the text in this way, but the sizing doesn't work. The text is too small in all languages.
You can use ConTeXt’s fallback mechanism to pull missing glyphs from other fonts.

\definefallbackfamily [mainface] [rm] [MS Mincho] [range=cjkunifiedideographs]
\definefontfamily     [mainface] [rm] [Latin Modern Roman]

\setupbodyfont[mainface]

\starttext
People’s Republic of China (中华人民共和国)
\stoptext

Wolfgang