1

I'm now using XeLaTeX and fontspec(also uses xeCJK). I use

\setmainfont{Georgia}

to set my default English font, and

\setCJKmainfont{cwTeX Q Ming}

to set my default Chinese font.

However, if I want to use the commands, such like \DeclareSymbolFont {<sym-font-name>} {<encoding>} {<family>} {<series>} {<shape>}, and assign the current font family I'm using. What name of the family should I fill into? (Also, what's the proper font-encoding? OT1?) I'd looked up the fontspec document, but didn't find the solution.

Eric
  • 1,665
  • (for reference, you can use \commandtoselectthefont \expandafter\string\the\font to view the internal font name https://tex.stackexchange.com/questions/14377/how-can-i-test-for-the-current-font) – user202729 Jan 24 '23 at 05:05

1 Answers1

2

The internal font family name is not usable, it contains a number which can change. But you can give your font a family name (if your fontspec is not too old). The encoding with a current fontspec/LaTeX is TU, in older versions EU1.

\documentclass{article}
\usepackage{fontspec}
\setsansfont{Georgia}[NFSSFamily=Georgia]

\begin{document}
blblb \fontfamily{Georgia}\fontencoding{TU}\selectfont blblb

\end{document}
Ulrike Fischer
  • 327,261