[XeTeX] fontspec and languages

Georg A. Duffner g.duffner at gmail.com
Wed Sep 11 11:52:59 CEST 2013


I'd suggest to use \defaultfontfeatures only in the preamble and change features in the body either with  \fontspec[feature]{font} or, as Ulrike suggests, with \addfontfeatures{}. At least for me this has always worked perfectly.

Georg

Ulrike Fischer <news3 at nililand.de> schrieb:

>Am Tue, 10 Sep 2013 19:45:24 +0200 schrieb Javier Bezos:
>
>> This is in fact a question about fontspec, but since it is
>> used mainly with xetex (and luatex) I think I'll get better
>> answers here.
>> 
>> The question is: Does fontspec provide a way to set the
>> language so that it's always active even if other default
>> features are changed.
>
>Not that I know (and the code doesn't look as if it does). 
>
>One could perhaps change the default language DFLT, but this will
>disable the fallback to DFLT for fonts which don't know a language
>and I have some doubts this is a good idea.
>
>Imho the best way to change/set the language is to use
>\addfontfeatures *and* defaultfontsfeatures (and hope that the user
>doesn't use a \defaultfontfeatures afterwards):
>
>\documentclass{article}
>\usepackage{fontspec}
>\defaultfontfeatures{Color=FF0000}
>\setmainfont{lmroman10-regular.otf}
>\begin{document}
>
>123 test fi
>
>\ExplSyntaxOn
>\expandafter\defaultfontfeatures\expandafter{\g_fontspec_default_fontopts_tl,Language=Turkish}
>\ExplSyntaxOff
>\addfontfeatures{Language=Turkish,Numbers=OldStyle,Color=CCCCCC}
>123 test fi
>
>\fontspec{lmroman10-regular.otf}
>123 test fi
>\end{document}
>
>
>
>
>-- 
>Ulrike Fischer 
>http://www.troubleshooting-tex.de/
>
>
>
>--------------------------------------------------
>Subscriptions, Archive, and List information, etc.:
>  http://tug.org/mailman/listinfo/xetex



More information about the XeTeX mailing list