[XeTeX] xetexref updated

François Charette firmicus at ankabut.net
Mon Jun 25 22:28:56 CEST 2007


Jonathan Kew a écrit :
> That's a fun example -- except that unfortunately the Pak Nastaleeq  
> font doesn't render well in XeTeX. (I'm not sure at this point  
> whether this is due to limitations of the ICU layout code, font  
> weirdness, or both!) 

Fun indeed! (Especially for me, historian of Islamic mathematical 
sciences...)
I had tried to typeset sample Urdu text with Nafees Nastaleeq 
(http://www.crulp.org/nafeesNastaleeq.html) without much success. With 
earlier versions of XeTeX/xdvipdfmx, this font lead to a crash. Now it 
compiles fine, but certain glyphs are often missing in the output (see 
example). I did not know Pak Nastaleeq, but the webpage says it is beta. 
However I would not be surprised if nastaʿlīq fonts are not handed well 
by ICU...

***

In a different matter, I see how \XeTeXcharclass could be useful for 
other things... For example, someone wrote an extension to ArabTeX to 
colorize certain categories of graphemes, e.g. vowel signs. This can be 
done manually with XeTeX as follows:

\usepackage{xltxtra,fontspec}
\usepackage{arabxetex}
\newcommand{\colorblue}{\addfontfeature{Color=0000FF}}
\newcommand{\colorred}{\addfontfeature{Color=FF0000}}
\newcommand{\colorblack}{\addfontfeature{Color=FFFFFF}}
\setmainfont{Junicode}
\newfontfamily\arabicfont[Script=Arabic]{Scheherazade}
\begin{document}
\begin{Arabic}[voc]\Large % The name Muṣṭafā مُصطَفَى ...
m\char"200D\colorred\char"200D u\char"200D\colorblack\char"200D% 
.s.t\char"200D\colorred\char"200D a\char"200D\colorblack\char"200D% 
f\char"200D\colorred\char"200D a\char"200D\colorblack\char"200D "Y
\end{Arabic}
\end{document}

If the insertion of font features at the level of font mappings were 
possible (is this at all feasible, Jonathan?), this could be implemented 
quite easily with TECkit...

Now I have tried to achieve the same with \XeTeXcharclass ...

\usepackage{bidi,fontspec}
\makeatletter
% Arabic vowels are class 5:
\@tempcnta="064B
\loop \XeTeXcharclass\@tempcnta=5 \ifnum\@tempcnta<"065F
\advance\@tempcnta by 1 \repeat
% Arabic letters are class 6:
\@tempcnta="0621
\loop \XeTeXcharclass\@tempcnta=6 \ifnum\@tempcnta<"064B
\advance\@tempcnta by 1 \repeat
\XeTeXinterchartoks6 5 = {\char"200D\addfontfeature{Color=FF0000}}
\XeTeXinterchartoks5 6 = {\char"200D\addfontfeature{Color=FFFFFF}\char"200D}
\setmainfont{Junicode}
\newfontfamily\arabicfont[Script=Arabic]{Scheherazade}

\begin{document}\arabicfont
\XeTeXinterchartokenstate=1
مُصطَفَى
\end{document}

Unfortunately, as you can see in the attached output 
(xetexcharclass.pdf), the insertion of tokens within an Arabic word cuts 
it into many disconnected pieces... Is there any way to avoid this?

Thanks,
François

-------------- next part --------------
A non-text attachment was scrubbed...
Name: nastaleeq.pdf
Type: application/pdf
Size: 47020 bytes
Desc: not available
Url : http://tug.org/pipermail/xetex/attachments/20070625/a45333a2/attachment-0002.pdf 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xetexcharclass.pdf
Type: application/pdf
Size: 15722 bytes
Desc: not available
Url : http://tug.org/pipermail/xetex/attachments/20070625/a45333a2/attachment-0003.pdf 


More information about the XeTeX mailing list