[XeTeX] Automatic font selection - SOLVED

Anuradha Ratnaweera anuradha at taprobane.org
Sat Apr 19 14:53:49 CEST 2008


On Fri, Apr 18, 2008 at 10:13 AM, Anuradha Ratnaweera
<anuradha at taprobane.org> wrote:
>
>  Is there a way to set the font automatically depending on the character.

Finally, I managed to get this using character classes.

------------
\newfontinstance{\sifont}[Script=Sinhala]{LKLUG}
\newcommand\latinfont{\fontfamily{lmr}\selectfont}

\XeTeXinterchartokenstate = 1
\newcount\cnt\cnt="0D80
\loop
   \XeTeXcharclass\cnt=10 \ifnum\cnt<"0DFF \advance\cnt1
\repeat
\XeTeXcharclass "200C = 10
\XeTeXcharclass "200D = 10

\XeTeXinterchartoks 0 10 = {\sifont}
\XeTeXinterchartoks 255 10 = {\sifont}
\XeTeXinterchartoks 10 0 = {\latinfont}
\XeTeXinterchartoks 10 255 = {\latinfont}
------------

        Anuradha
-- 
http://www.sayura.net/anuradha/


More information about the XeTeX mailing list