[XeTeX] Font scaling problem

Ross Moore ross at maths.mq.edu.au
Mon Oct 18 10:57:33 CEST 2004


Hi Jonathan and Will,

On 18/10/2004, at 5:32 PM, Jonathan Kew wrote:

> To demonstrate that this is the problem, you can wrap your \mkfont 
> **definition** so that the proper NFSS catcodes are in effect:
>
> {\makeatletter \nfss at catcodes \globaldefs=1
>  \newcommand\mkfont{
>  \DeclareFontFamily{U}{fontB}{}%
>  \DeclareFontShape{U}%
>     {fontB}{m}{n}{<-> s*[0.5] "Didot"}{}%
>  }
> }
>
> Then it will work as expected.

Uh uh -- no it won't ...

   ... since \mkfont is undefined upon leaving that last '}'
closing the \makeatletter grouping.


What you need is:

{\makeatletter \nfss at catcodes \globaldefs=1
  \newcommand\tmpmkfont{%  <------------  beware this space
   \DeclareFontFamily{U}{fontB}{}%
   \DeclareFontShape{U}%
     {fontB}{m}{n}{<-> s*[0.5] "Didot"}{}%
  }
  \global\let\mkfont\tmpmkfont  % <-------- keep a \global pointer
}


The extra space is probably harmless, especially if the font
definitions are read when in the LaTeX preamble --- but that's
not always the case, so best to avoid it.

The need for a \global macro name is *vital*.
Now \tmpmkfont goes away, but \mkfont remains.


Cheers,

	Ross


>
> (How to actually build this into your larger package is left as an 
> exercise....)
>
> HTH,
>
> JK
>
> _______________________________________________
> XeTeX mailing list
> postmaster at tug.org
> http://tug.org/mailman/listinfo/xetex
>
------------------------------------------------------------------------
Ross Moore                                         ross at maths.mq.edu.au
Mathematics Department                             office: E7A-419
Macquarie University                               tel: +61 +2 9850 8955
Sydney, Australia                                  fax: +61 +2 9850 8114
------------------------------------------------------------------------



More information about the XeTeX mailing list