[XeTeX] beginners trouble

Jonathan Kew jonathan_kew at sil.org
Sat Nov 12 05:32:01 CET 2005


On 11 Nov 2005, at 1:33 pm, Martin Henning wrote:
>
> The problem rather seem to be the right fontspec commands. I found  
> some really ugly solution in the archiv of macosx-tex mailing list,  
> but it doesn't make use of the fontspec package and only imports  
> Lucida Font, which is awful for my taste. I would like to have  
> style like default LaTeX font for both languages. Will read some  
> mor einto the fontspec-package documentation, but it's all pretty  
> cryptic or a beginner...
>
> The working solution i have at the moment looks like that:
>
> === begin test.tex  
> =====================================================
>
> %&program=xelatex
> %&encoding=UTF-8 Unicode
>
> \documentclass[a4paper]{scrreprt}
> \usepackage{ngerman}
>
> \DeclareFontFamily{U}{lucida}{}
> \DeclareFontShape{U}{lucida}{m}{n}
>    {<-> "Lucida\space Grande:mapping=tex-text"}{}
> \DeclareFontShape{U}{lucida}{b}{n}
>    {<-> "Lucida\space Grande\space Bold:mapping=tex-text"}{}
> \DeclareFontShape{U}{lucida}{bx}{n}
>    {<-> ssub * lucida/b/n}{}
> \renewcommand{\sfdefault}{lucida}
> \renewcommand{\familydefault}{\sfdefault}
> \renewcommand{\encodingdefault}{U}
>
> \begin{document}
>
> Hallo aus Moskau
>
> Привет из Москвы
>
> \end{document}
>
> === end test.tex =====================================================

You could achieve the same result more simply by using fontspec and  
saying something like:

% - - - - -
\documentclass[a4paper]{scrreprt}
\usepackage{ngerman} % or "\usepackage[ngerman]{babel}" ... I don't  
know the difference

\usepackage{fontspec}
\defaultfontfeatures{Mapping=tex-text}
\setromanfont{Lucida Grande}

\begin{document}

Hallo aus Moskau

Привет из Москвы

\end{document}
% - - - - -

You can substitute any other font you wish for Lucida Grande here;  
but if you want to use the font for both Latin and Cyrillic text,  
then you do need to choose a font that supports the characters of  
both scripts, otherwise there will be characters missing from your  
output.

I believe only a few of the fonts that ship with Mac OS X include  
Cyrillic characters, so you might want to look for additional Unicode  
fonts that support both Latin and Cyrillic (like the Doulos SIL,  
Charis SIL, and Gentium fonts available from scripts.sil.org, for  
example).

JK



More information about the XeTeX mailing list