Closed cykerway closed 4 years ago
FreeSerif
is not a valid CJK font. So please replace it by AR PL UMing CN
in your code.
\documentclass[]{article}
\usepackage[AutoFallBack=true]{xeCJK}
\setmainfont{DejaVu Serif}
\setCJKmainfont{AR PL UMing CN}
\setCJKfallbackfamilyfont{\CJKrmdefault}{Noto Serif CJK KR}
\begin{document}
にほんご?한국어!简体中文:繁體中文;English。
\CJKfamilydefault == rm
\end{document}
You can also assign the font of punctuations individually via option PunctFamily
.
No, you didn't get my point. I know FreeSerif
is not a CJK font and that is the reason I put it there.
My point is, I have installed 2 fallback fonts in case FreeSerif
is not enough. But these fallback fonts are not working as expected. In practice, the CJK main font is set by my users, and my job is to provide sane fallbacks in case my users misconfigure. As you can see, these fallbacks didn't successfully guard my users, giving them tofu.
I may consider PunctFamily
but I hope puncts can go along with main font fallbacks, so that users don't feel discrepancy between language characters and puncts.
I did know your point. But I won't fix this issue since it is an edge case. You can raise a warning to your users in that case.
God. This isn't an edge case but a true bug. The problem happens because AutoFallBack
only redefines \CJKsymbol
but not \CJKpunctsymbol
. It is the latter one that is being used to output punctuations. It is safe to say the current implementation doesn't have fallbacks for punctuations. That would surprise users.
After I duplicated some functions from \CJKsymbol
to \CJKpunctsymbol
, the problem disappears. Result from the same program:
I already made a patch for this. Not necessarily optimized at its best, but I believe is solving the problem in the right way.
Code:
Result:
CJK and English characters are displayed corrrectly, but all punctuations are tofu.