[XeTeX] new font question: is this possible?

Zdenek Wagner zdenek.wagner at gmail.com
Mon Mar 17 13:11:00 CET 2014


2014-03-17 12:51 GMT+01:00 Dominik Wujastyk <wujastyk at gmail.com>:
> Dear François,
>
> In my view, it would be altogether better to spend available time on
> improving the French features of Polyglossia than on making compromises in
> order to stay with Babel.
>
It would be even better to implement properly French features in the
OpenType fonts. You can look at my Devanagari (Hindi) test page:

http://hroch486.icpf.cas.cz/freefont-devanagari/

The PDF file shows tha question and exclamation marks have proper
spacing in the GNU FreeFont if language is switched to Hindi. The
spacing depends on language so that in principle the spacing of double
punctuation can be adjusted to the French rules if language is set. I
have not tested whether OpenType fonts support French typography
properly. If the support is missing, it can be replaced with
\XeTeXinterchartoks.

> Best,
> Dominik
>
>
>
>
>
> On 14 March 2014 11:54, François Patte <francois.patte at mi.parisdescartes.fr>
> wrote:
>>
>> Le 14/03/2014 01:39, Zdenek Wagner a écrit :
>> > 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}
>> >
>> >
>>
>> Thank you!
>>
>> I must use babel instead of polyglossia because the features concerning
>> French language are very poor in polyglossia when we compare with those
>> in babel.
>>
>> --
>> 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
>>
>
>
>
>
> --------------------------------------------------
> 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