Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xelatex Invalid fontname

Tags:

latex

cjk

tex

xetex

I want to use the openoffice chinese fonts, eg AR PL SungtiL GB, but the xelatex tells me that it is an invalid name (as shown below). It seems like the font name has spaces and so it doesn't recognize it? How should I get around this?

(/usr/share/texmf-texlive/tex/latex/base/syntonly.sty)kpathsea: Invalid fontname `AR PL SungtiL GB', contains ' '

I am using the xeCJK package in XeTeX 3.1415926-2.2-0.9995.2 (TeX Live 2009/Debian) on Ubuntu.

like image 324
user176121 Avatar asked Apr 18 '10 05:04

user176121


1 Answers

Have you tried using the fontspec package?

I can use any installed font, even if there are spaces in their names. Note that I use a Mac, but according to the package documentation it should work on any xetex-based system. In the following example the Chinese font is "Apple LiSung". (The file's encoding is UTF-8, of course.)

\usepackage{fontspec}% provides font selecting commands
\usepackage{xunicode}% provides unicode character macros
\usepackage{xltxtra} % provides some fixes/extras
\newfontfamily\zh{Apple LiSung}

\begin{document}
And then she asked: {\zh 今天你还好吗?} But I couldn't answer ...

See the excellent package documentation here.

like image 107
glts Avatar answered Oct 27 '22 03:10

glts