[Tex/LaTex] How to install a Chinese font in a Ubuntu 13.10 in a way that xelatex can see it

cjkfontsxetex

I am trying to make the second example from the answer here work. It is copied here below:

% Compile with xelatex
% UTF-8 encoding
\documentclass{article}
\usepackage{xeCJK}
\setCJKmainfont{SimSun}
\begin{document}
文章内容
\end{document}

When I compile with xelatex Test.tex, I get the following error indicating that it cannot find the font.

The font "SimSun" cannot be found.

I can think of two possible solutions, but I am unclear about how to proceed with either of them, and Google has not been helpful.

1) Install SimSun. What is the correct command in Ubuntu 13.10 to do this so that xelatex can see it?

2) Change to a different Chinese font that xelatex will work with. I can type Chinese in my Ubuntu install, so I must have some kind of Chinese font on my system. How can I find out the names of all fonts which are valid arguments to \setCJKmainfont?

Note that I already have msttcorefonts package installed.

Best Answer

As you said, there are two options. Both involve downloading a font. You can double-click to install or move/copy them to ~/.fonts.

Just check the name of the font and then include it in your Latex document as your example. You can download Chinese fonts using your package manager.

There are some fonts you can download if you have Adobe Reader at:

http://www.adobe.com/support/downloads/product.jsp?product=10&platform=Unix

Search for Chinese.

If you want to know the name of the font to use with XeLaTeX, the easiest way is to open LibreOffice and scroll down the font menu. LibreOffice will show Chinese characters (or any other non-Latin characters) next to the name of the font if it is supported.

Here, for instance, I get: AR PL SungtiL GB and others (Chinese), IPAPGothic and IPAPMincho for Japanese, and NanumMyeongjo etc. for Korean.

A MWE:

\documentclass{article}
\usepackage{xeCJK}
\setCJKmainfont{AR PL SungtiL GB}

\begin{document}

\Huge 

文章内容


\end{document}
Related Question