[XeTeX] Mixed Roman and Indian alphabets for Sanskrit (was: what is \setmainfont used for?)

ShreeDevi Kumar shreeshrii at gmail.com
Sat Feb 11 02:37:37 CET 2017


I use Polyglossia with a modified version of ucharclasses to automatically
switch font based on script. The preamble has the following :

% mainfont, englishfont, sanskritfont, romanfont, devanagarifont,
englishfont, vedafont
\defaultfontfeatures{Mapping=tex-text}
%Polyglossia
%Script (default = Devanagari) passed to Fontspec for Sanskrit language if
\devanagarifont or \sanskritfont not defined
\defaultfontfeatures{Mapping=tex-text}
\setmainlanguage{english}
\setotherlanguage{sanskrit}
%
%Fontspec
\setmainfont[Color=teal]{FreeSerif}
\setmonofont[Path=/home/shree/sanskritdocuments-git/fonts/,Scale=0.7]{mplus-1m-regular.ttf}
%
\newfontfamily{\englishfont}{FreeSerif}
%
\newfontfamily{\devanagarifont}[Scale=1]{Lohit Devanagari}
\newfontfamily{\tamilfont}[Script=Tamil,Scale=0.9]{Lohit Tamil Classical}
\newfontfamily{\telugufont}[Path=/home/shree/sanskritdocuments-git/fonts/,Script=Telugu,Scale=1.1]{Pothana2000Vedic_1_2_1.ttf}
\newfontfamily{\gujaratifont}[Path=/home/shree/sanskritdocuments-git/fonts/,Scale=1,Script=Gujarati]{Rasa-Regular.ttf}
\newfontfamily{\vedafont}[Scale=1.2,Color=purple]{Siddhanta}
\newfontfamily{\vedablackfont}[Scale=1.1]{Siddhanta}
%
\usepackage[Latin, GeneralPunctuation, DevanagariMarks, DevanagariPreMarks,
DevanagariExtended, DevanagariPostMarks, Gujarati, Tamil, Telugu,
VedicExtensions, SuperscriptsAndSubscripts]{ucharclasses}
\setTransitionsForLatin{\englishfont}{}
\setTransitionTo{GeneralPunctuation}{\englishfont}
\setTransitionTo{SuperscriptsAndSubscripts}{\englishfont}
\setTransitionTo{DevanagariPreMarks}{\devanagarifont}
\setTransitionTo{DevanagariPostMarks}{\devanagarifont}
\setTransitionTo{DevanagariMarks}{\vedafont}
\setTransitionTo{DevanagariExtended}{\vedablackfont}
\setTransitionTo{VedicExtensions}{\vedafont}
\setTransitionTo{Gujarati}{\gujaratifont}
\setTransitionTo{Tamil}{\tamilfont}
\setTransitionTo{Telugu}{\telugufont}
%
\setTransitionsFor{Latin}
  {\hyphenrules{english}\englishfont}
  {\hyphenrules{sanskrit}\devanagarifont}
\setTransitionsFor{Devanagari}
  {\hyphenrules{sanskrit}\devanagarifont}
  {\hyphenrules{english}\englishfont}
%


ShreeDevi
____________________________________________________________
भजन - कीर्तन - आरती @ http://bhajans.ramparivar.com

On Sat, Feb 11, 2017 at 3:11 AM, Dominik Wujastyk <wujastyk at gmail.com>
wrote:

> This discussion reminds me of a long-standing question in my mind.
>  hyph-sa.tex contains hyphenation rules for Sanskrit in several different
> scripts, including Latin script.
>
> The Polyglossia file gloss-sanskrit.ldf contains codes for invoking many
> of the scripts in which the Sanskrit language is written, such as
> Devanagari, Gujarati, Malayalam and so on.  But there isn't a rule for
> saying, for Sanskrit, [Script=Latin].
>
> How would this be done?  I've been looking at commands like \xpg at fontsetup@latin,
> but it's quite hard (for me) to see what's going on.  (I should get the doc
> file.)
>
> Has someone already solved or addressed this, or am I wrong about it in
> some way?
>
> The idea would be to be able to say
>
> \setmainfont{FreeSans}[Script=Latin]
> \newfontfamily\sanskGujarati{Code2000}[Script=Gujarati]
>
> etc.
>
> Actually, the more I play with this, the less I understand what's going
> on.  I thought I had Polyglossia nailed, but I don't.   Why doesn't
> \sanskGujarati set my text in Gujarati script?
>
> Dominik
>
>
>
> On 10 February 2017 at 03:10, Ulrike Fischer <news3 at nililand.de> wrote:
>
>> Am Fri, 10 Feb 2017 08:54:09 +0100 schrieb Zdenek Wagner:
>>
>> > OK, I have a newer version. Maybe the bug is known and was fixed just a
>> few
>> > days ago.
>>
>> What do mean by that you have newer version? Your fontspec is from
>> 2016 and mine from 2017.
>>
>> And yes the bug is known. I discussed it two weeks ago with Will.
>>
>>
>> --
>> Ulrike Fischer
>> http://www.troubleshooting-tex.de/
>>
>>
>>
>> --------------------------------------------------
>> Subscriptions, Archive, and List information, etc.:
>>   http://tug.org/mailman/listinfo/xetex
>>
>
>
>
>
> --------------------------------------------------
> Subscriptions, Archive, and List information, etc.:
>   http://tug.org/mailman/listinfo/xetex
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/xetex/attachments/20170211/a313d8b9/attachment.html>


More information about the XeTeX mailing list