On 2011-09-29, Lisa wrote:
> Guenter Milde <milde <at> users.berlios.de> writes:

>> If this main font contains Chinese characters, it should work for Chinese.

> Thanks Günter, yes, if the person I installed Lyx for, sets a main font
> that can also display Chinese then they will have no problem. I should
> have mentioned that they do not want to use a Unicode / Chinese font as
> their default text font.

However, currently there is no other coice (see below for a workaround).

> Lyx displays most languages nicely on the screen even when a more
> limited default font that does not carry those codepoints is used. It
> still displays them nicely with "view in html", and on a Mac for
> instance, if you save this as a pdf without doing anything else you
> will see those languages rendered nicely. So its a shame that it can't
> use that font substitution information that it must know about at some
> level (in Qt?) to generate some Latex for the Chinese/Arabic/Russian if
> the user hasn't supplied any her/himself.

The font substitution for "exotic" characters in LyX is done by QT, with
"view in HTML", its a feature of the browser (I suppose that not all
browsers will do it).

However, with "use-non-tex-fonts", for the printout, LyX relies on the
external XeTeX or LuaTeX engines which do not have such an
auto-replacement feature. What is worse, LyX does not even give feedback
when a character cannot be found in the font! I don't know whether there is
some hint in the XeTeX/LuaTeX log files.

XeTeX development is stalled/completed. Asking for auto-replacement of
missing chars at the luatex developers list might be an idea.

> (p.s. its exactly for occasional use, in our global world, that it
> would be nice to have this, rather than for regular multilingual users
> of Lyx who can choose their preferred fonts). 

For this occasional use, you cannot get around the need to set a
comprehensive font as default. My recommendation is DejaVu (the OpenOffice
default, suitable for both screen and print).

> (Polyglossia is still at 2010/7/27 (CTAN) which has no Chinese support,
> is that right?)

Yes. (However, as it is a modular system, you can add support for any
language by writing a language file modelled on the existing ones.)

As Chinese is not supported by polyglossia, you could consider setting up
a font for the other languages. Unfortunately, there is no generic "hook"
for the Latin script (like for cyrillic). I.e. you need to define a
"languagefont" for every language you are going to use in
Document>Settings>LaTeX preamble, e.g.

\newfonfamily\englishfont\{Linux Libertine O}
\newfonfamily\germanfont\{Linux Libertine O}
\newfonfamily\spanishhfont\{Linux Libertine O}
\newfonfamily\dutchfont\{Linux Libertine O}
\newfonfamily\danishfont\{Linux Libertine O}

(Do this once and save as template or document defaults.)

Then, whenever a document uses one these languages (as main document
language or for a text part), polyglossia will select the <language>font.
This also means, the main font is only used *outside* any of the
above-defined languages -- you still need to set Chinese document parts
or other "exotic" symbols to Chinese (or some dummy language).

Günter

Reply via email to