Am 22.02.2025 um 11:59 schrieb autumnus:
I've been writing bilingual documentation lately.
When I switched the font class, I found that it was back to
the default size. How should I just switch the font class
without changing the font size or other attributes.
%%%%%%
\starttext
\section{A\textbar A}
\section{A\textbar{\switchtobodyfont[pagella]A}}% fontsize changed to default
fontsize
{\tfa A}\textbar{\tfa \switchtobodyfont[pagella]A}\textbar{A}% not work
{\tfa A}\textbar{\switchtobodyfont[pagella]\tfa A}\textbar{A} % work but not
handy
\stoptext
%%%%%%
1. Preload all typescripts at the start of the document.
\usebodyfont[pagella]
\setupbodyfont[modern]
2. Set a fixed size for the heading.
\setuphead[section][style={\switchtobodyfont[14.4pt]}]
3. Use the fallback mechanism for fonts.
more about this issue, I don't know if context contains
a command to switch fonts with the language.
%%%%%% not work
\starttext
\appendtoks
\usebodyfontparameter\languageparameter
\languageparameter{bodyfont}
\to \everylanguage
\setuplanguage[cn][bodyfont={pagella,12pt}]
A \the\font \textbar \cn A \the\font
\stoptext
%%%%%%
You can use the setups mechanism.
\startsetups [language:cn]
\switchtobodyfont[pagella]
\stopsetups
\setuplanguage[cn][setups=language:cn]
Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : ntg-context@ntg.nl /
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________