[XeTeX] access to composite characters

Will Robertson will at guerilla.net.au
Wed Nov 2 04:56:05 CET 2005


02/11/2005, 1pm - musa furber wrote:

> Every once in a while I ask for a hint on how to adjust the  
> placement of the dot when I switch back and forth between regular  
> and italic, but so far no luck.

You can query this sort of information with various NFSS control  
sequences. In this case \f at shape will contain n,it,sl,sc,... for  
upright, italic, slanted, small caps... ("si" if using fontspec for  
italic small caps)

Try something like:

\documentclass[12pt]{article}
\begin{document}
\makeatletter
\newcommand\uprightornot{%
   \edef\@tempa{n}%
   \ifx\@tempa\f at shape
     UPRIGHT%
   \else
     NOT UPRIGHT%
   \fi}
\makeatother
this text is \uprightornot. \textit{this text is \uprightornot}.
\end{document}

How to use this for your purposes is left as an exercise...note that  
when XeTeX gets font slant information, you should be able to use  
that to adjust the position of the accent more automatically.

Will



More information about the XeTeX mailing list