[XeTeX] fontspec and kpfonts

Ulrike Fischer news2 at nililand.de
Fri Jun 6 11:10:19 CEST 2008


Am Fri, 6 Jun 2008 18:14:49 +0930 schrieb Will Robertson:

> On 06/06/2008, at 6:07 PM, Ulrike Fischer wrote:
> 
>> E.g. to declare an additional Shape for the Latin Modern fonts one has
>> to use
>>
>> \DeclareFontShape {EU1}{LatinModernRoman(0)}{m}{sl}
>>  {<->"Latin\space Modern\space Roman\space Slanted"}{}
>>
>> It would be fine, if there were a command to get the
>> "LatinModernRoman(0)".
> 
> That's a good point...I'll see if there's a diagnostic that I could  
> add that wouldn't take up too much space in the log file or the  
> transcript, or maybe look into a [verbose] mode that printed this sort  
> of information.

I think something like this would be enough:

\documentclass{scrartcl}

\usepackage{xltxtra}
\setmainfont{Arial}
\makeatletter
\newcommand\currentfontfamily{}
\newcommand\getfontfamily[1][\currentfontfamily]{\let#1\f at family}
\makeatother
\begin{document}
\getfontfamily
\currentfontfamily
\getfontfamily[\storefamily]
\storefamily

\sffamily
\getfontfamily
\currentfontfamily
\getfontfamily[\storefamily]
\storefamily


\end{document}

(and it works fine for every font, so it is not fontspec specific.) 

-- 
Ulrike Fischer 



More information about the XeTeX mailing list