[XeTeX] new font question: is this possible?

Dominik Wujastyk wujastyk at gmail.com
Mon Mar 17 12:47:26 CET 2014


Dear Zdenek, that's very cool indeed!  Thank you!

Dominik



On 14 March 2014 01:39, Zdenek Wagner <zdenek.wagner at gmail.com> wrote:

> 2014-03-13 19:09 GMT+01:00 François Patte <
> francois.patte at mi.parisdescartes.fr>:
> > Bonjour,
> >
> > When writing a Sanskrit text, there are (at least) two ways: roman
> > transliteration, or devanagari.
> >
> > In a transliterated text, there are much more blank spaces between
> > "words" than in a devanagari text. I would like to be able to have only
> > one file for a text and choose either transliteration or devanagari.
> >
> > Is it possible to have some active character which separates "words" in
> > the file and this character will give a blank space, if I choose
> > tranliteration, and will give a null space if I choose devanagari, but a
> > null space which allows ligature if necessary.
> >
> > For instance, in the file we have: tasmād_dhetor_bijasya and we get,
> > after compilation:
> >
> > tasmād dhetor bījasya (in transliteration)
> >
> > or
> >
> > तस्माद्धेतोर्बीजस्य (in devanagari)
> >
> > (I have chosen underscore as the active character, but it is not the
> > best idea...)
> >
> The TECkit mapping is applied after all macros are expanded, just
> before the horizontal list is built. You have to decide in advance
> whether _ will expand to \space or to nothing. Thus you can do the
> following:
>
> \documentclass[a4paper,11pt]{report}
>
> \usepackage{xltxtra}
>
> \setmainfont[Mapping=tex-text]{%
>   FreeSerif%
> }
>
> \usepackage{polyglossia}% I prefer polyglossia to babel
> \setdefaultlanguage{sanskrit}
>
> \newfontfamily\sanskritfont[%
> Script=Devanagari,Language=Sanskrit,AutoFakeSlant=0.2]{FreeSerif}
>
> \begin{document}
>
> \catcode`\_=13
> \def\MyText{tat_sat śrī_bhagavān_uvāca}% _ not expanded here
>
> % Sanskrit is the default language, no need to change the font
>
> % As default, we have the transliteration, we have to define _
> \def_{\space}
>
> \MyText
>
> {% Devanagari, redefine _ and add mapping
> \def_{}
> \addfontfeature{Mapping=RomDev}
> \MyText
>
> }
>
> % Transliteration again
> \MyText
>
> \end{document}
>
> The PDF is attached.
>
> > Thank you for any light!
> >
> > --
> > François Patte
> > UFR de mathématiques et informatique
> > Laboratoire CNRS MAP5, UMR 8145
> > Université Paris Descartes
> > 45, rue des Saints Pères
> > F-75270 Paris Cedex 06
> > Tél. +33 (0)1 8394 5849
> > http://www.math-info.univ-paris5.fr/~patte
> >
> >
> >
> >
> >
> > --------------------------------------------------
> > 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
>
>
>
> --------------------------------------------------
> 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/20140317/c22b9f84/attachment.html>


More information about the XeTeX mailing list