[NTG-context] Define font based on language

Wolfgang Schuster schuster.wolfgang at gmail.com
Sun May 8 19:05:43 CEST 2016


> Michal Ondrejáš <mailto:michal.ondrejas at dlubal.cz>
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20160508/02206fae/attachment.html>


More information about the ntg-context mailing list