1

I am having some trouble using the new Source Han Sans font (SourceForge; Github) released by Google and Adobe in latex documents. I compile using XeLaTeX and have the TeX Live installation. I have spent the last 4 hours or so looking for a solution but couldn't find one.

My code is the following:

\documentclass{article}
\usepackage{xeCJK}
\setCJKmainfont{Source Han Sans J Normal}
\renewcommand{\arraystretch}{1.5}
\setlength\parindent{0pt} % Removes all indentation from paragraphs
\topmargin=-0.45in
\evensidemargin=0in
\oddsidemargin=0in
\textwidth=6.5in
\textheight=28cm
\headsep=0.25in 
\footskip = 20pt
\begin{document}
\thispagestyle{empty}
日本
\end{document}

Now when I run this it doesn't give me an outright error. However when I try to open the compiled pdf it tells me it is broken. When I look at the log file I find this at the bottom (the file name is "Core 1000 1-10.tex"):

Error 1 (driver return code) generating output;
file Core 1000 1-10.pdf may not be valid.

The complete .log file can be found here: .log file

When I comment out the line \setCJKmainfont{Source Han Sans J Normal} it works correctly again.

I have installed all the fonts in the family and did the procedure to load new fonts into LaTeX using TeX Live-manager.

Is this font maybe just not supported by xeCJK or am I doing something wrong?

Leo Liu
  • 77,365
  • The old (x)dvipdfmx does not support Source Han Sans (or Noto Sans CJK) font well. A patched verson of xdvipdfmx is needed. And the problem is not related to xeCJK package. – Leo Liu Sep 22 '14 at 02:42

0 Answers0