[XeTeX] Issue with CJK in pdf build

Chris Jones cjns1989 at gmail.com
Tue Nov 17 23:56:35 CET 2009


On Tue, Nov 17, 2009 at 09:59:47AM EST, Jonathan Kew wrote:
> On 17 Nov 2009, at 01:54, Chris Jones wrote:
>
>> On Mon, Nov 16, 2009 at 06:25:31PM EST, Jonathan Kew wrote:

>>> It looks to me like xetex just hasn't been told to use a suitable  
>>> font.

[..]

>> That's probably what was confusing me. I somehow assumed that xetex
>> would detect that I needed a CJK font, e.g. and ask fontconfig to
>> provide one.
>
> No, it won't. (You're not the first person to be caught by this!)
>
> To me, there's a big difference between xetex and typical GUI
> applications such as word processors or browsers. There, it may be
> helpful if "the system" (via fontconfig) magically finds a font that
> can display whatever character happens to occur in the text. You don't
> want .notdef boxes all over your web pages, and the author doesn't
> know what fonts you may happen to have, so cannot necessarily specify
> them explicitly.

Yes, that's pretty much what happens when I'm generating an .html
version of the document.

> But in a typesetting application, the program should use exactly the
> fonts you as author/designer ask for, and no others. If you ask it to
> typeset character X in font Y, you should be confident that's what it
> will do.... if you don't have font Y, it should report an error, not
> substitute something more-or-less similar; and if the result is the
> .notdef glyph, that's for you as the (human) typesetter to deal with,
> by *choosing* (not "magically" getting) an appropriate font.

That's probably what I would have done without giving it too much
thought if the input document had been TeX/LaTeX because I would have
expected something like this in the first place.

But this is a trickier context where I have little control, since I'm
using asciidoc's a2x tool chain (I'm tidying up an prettifying a fairly
large collection of personal notes, mini-howto's, cheat sheets, etc.
and since it only takes minutes to convert raw text to the asciidoc
input format...).

As a result, I cannot just modify the intermediate formats that are
built by the tool chain: I either need to pass build options to the
programs that are executed as part of the tool chain via command line
flags where they exist, or provide the build options via configuration
files that these programs will automatically look for at run time.

Since I didn't find anything that looked anywhere near relevant either
on the a2x or on the dblatex man pages, my guess is that I have to ask
the a2x command to direct dblatex to use a certain style sheet, maybe
via the --dblatex-opts flag but I have no clue as to its content.

Tool chains are great when everything works, less so when there is a
problem :-)

> Note that if you turn on TeX's \tracinglostchars option, your .log
> file will include warning messages for any characters that appeared to
> be missing in the fonts you were using. Perhaps that should be turned
> on by default in the Unicode world, where the chances of this
> happening are much greater than in the old 7- or 8-bit world where
> encodings and fonts were generally "full", so virtually every
> character code would print something, even if it wasn't necessarily
> the right thing (if you got encodings mixed up).

For the record, it looks like I'm not the only asciidoc user who asked
about this:

http://groups.google.com/group/asciidoc/browse_thread/thread/cc30202b235ecaab

As you will notice, this was posted back in May, and well.. mum's the
word.

Thank you for your comments.

CJ


More information about the XeTeX mailing list