[XeTeX] Using different fonts for devanagari and latin characters

Zdenek Wagner zdenek.wagner at gmail.com
Sun Feb 12 13:47:41 CET 2012


2012/2/12 Vikas Rawal <vikaslists at agrarianresearch.org>:
>>
>> Here's some text in the default font,
>> Charis, and {\sanskritfont
>> अत्र देवनागरीलिप्युदाहरणम् वर्तते| \par}
>> \end{document}
>
>
> Isn't there a way to do it document-wide? So different fonts are
> automatically used depending on the script.
>
Another possibility is to use ucharclasses. This package is non-free,
you can freely download it from CTAN and use it but you are not
allowed to distribute it. This is the reason why you cannot find it in
TeX distributions. This is a small sample (no need to change fonts
manually):

\documentclass[12pt]{article}
\usepackage{fontspec}
\usepackage[Devanagari]{ucharclasses}
\setmainfont{Charis SIL}
\setTransitionTo{Devanagari}{\fontspec[Script=Devanagari]{Nakula}}
\begin{document}
I can write in English और वाक्य का एक भाग हिंदी में हो सकता है।
\end{document}

> Vikas
>
>
>
>>
>>
>> --------------------------------------------------
>> Subscriptions, Archive, and List information, etc.:
>>   http://tug.org/mailman/listinfo/xetex
>
>
>
> --------------------------------------------------
> Subscriptions, Archive, and List information, etc.:
>  http://tug.org/mailman/listinfo/xetex



-- 
Zdeněk Wagner
http://hroch486.icpf.cas.cz/wagner/
http://icebearsoft.euweb.cz



More information about the XeTeX mailing list