[OS X TeX] Scaling xipa font

Bruno Voisin bvoisin at mac.com
Fri Apr 9 16:46:00 EDT 2004


Le 9 avr. 04, à 18:33, Stephen Anderson a écrit :

> But one thing I would like to fix: the xipa font is a bit too big, and 
> I'd like to scale it by a factor of about .9 or so.  I know you can 
> scale Helvetica for use as the sans serif font together with others by 
> invoking it with "\usepackage[scale=.92]{helvet}" but the tipa package 
> doesn't understand that option.  I can't really figure out how to get 
> tipa.sty to work like helvet.sty in this regard - the relevant code at 
> the top of helvet.sty clearly does it, but it's too obscure for me.

The actual scaling is done not in the style file helvet.sty, but in the 
font definition files 8rphv.fd, ot1phv.fd, t1phv.fd and ts1phv.fd.

The trickery in helvet.sty essentially defines \Hv at scale to be empty if 
no option is given when calling the helvet package:

	\usepackage{helvet}

or to be .95 if the [scaled] option is given:

	\usepackage[scaled]{helvet}

or to be <num> if the [scaled=<num>] option is given:

	\usepackage[scaled=<num>]{helvet}

It's based on the keyval package 
/Library/teTeX/share/texmf.tetex/doc/latex/graphics/keyval.dvi.

Then all of the .fd files for the Helvetica fonts start with:

> \expandafter\ifx\csname Hv at Scale\endcsname\relax
>  \let\Hv@@Scale\@empty
> \else
>  \edef\Hv@@Scale{s*[\csname Hv at Scale\endcsname]}%
> \fi

which defines \Hv@@scale to be empty if \Hv at scale is empty, or the 
sequence of letters formed by the concatenation of "s*[" + the value of 
\Hv at scale + "]" if \Hv at scale isn't empty.

Then the .fd files, through declarations such as:

> \DeclareFontShape{T1}{phv}{m}{n}{
>    <-> \Hv@@scale phvr8t
> }{}

define the phv fonts to be the original Helvetica fonts, called with 
the modifier \Hv@@scale = s*[\Hv at scale] which means a scaling factor 
\Hv at scale.

To make things clearer, assume you said:

	\usepackage[scaled=.95]{helvet}

This defines \Hv at scale to be .95, and hence \Hv@@scale to be s*[.95]. 
The line defining phv in T1 encoding, medium series and normal shape 
becomes:

> \DeclareFontShape{T1}{phv}{m}{n}{
>    <-> s*[.95] phvr8t
> }{}

which is LaTeX 2e's jargon for telling the font phv in T1 encoding, 
medium series and normal shape corresponds to the metrics file 
phvr8t.tfm with size scaled by a factor .95, see 
/Library/teTeX/share/texmf.tetex/doc/latex/base/fntguide.dvi, section 
4.

Back to your problem: either you can customize the .fd file to include 
the scaling factor that you'd like to apply, or you can modify both .fd 
and .sty files to create a scaling option mechanism similar to the one 
for helvet. Specifically, you can append to the .sty files the lines:

> \RequirePackage{keyval}
> \define at key{xip}{scaled}[.9]{%
>   \def\xp at scale{#1}}
> \def\ProcessOptionsWithKV#1{%
>   \let\@tempc\relax
>   \let\xp at tempa\@empty
>   \@for\CurrentOption:=\@classoptionslist\do{%
>     \@ifundefined{KV@#1@\CurrentOption}%
>     {}%
>     {\edef\xp at tempa{\xp at tempa,\CurrentOption,}}%
>   }%
>   \edef\xp at tempa{%
>     \noexpand\setkeys{#1}{%
>       \xp at tempa\@ptionlist{\@currname.\@currext}%
>     }%
>   }%
>   \xp at tempa
> }
> \ProcessOptionsWithKV{xip}
> \AtEndOfPackage{%
>   \let\@unprocessedoptions\relax
> }

then start the .fd files by:

> \expandafter\ifx\csname xp at scale\endcsname\relax
>  \let\xp@@scale\@empty
> \else
>  \edef\xp@@scale{s*[\csname xp at scale\endcsname]}%
> \fi

and prefix in the rest of this file all metrics names by \xp@@scale.

Sorry I can't be more specific, I don't use tipa nor xipa, and I'm 
short of time (as usual!). Hope this helps though,

Bruno Voisin
-----------------------------------------------------
Please see <http://www.esm.psu.edu/mac-tex/> for list
guidelines, information, and LaTeX/TeX resources.





More information about the MacOSX-TeX mailing list