[OS X TeX] scaling fonts in latex

Herb Schulz herbs at wideopenwest.com
Wed Mar 23 09:14:35 EST 2005

>Le 23 mars 05, à 09:59, Thomas A.Schmitz a écrit :
>>NOW the question: I would like to have a second option to the 
>>package that would scale the font in relation to the main bodyfont 
>>of the document, something similar to what the helvet.sty package 
>>e.g., to scale the Gentium font to 95 %. I tried and looked in the 
>>helvet.sty to see how it is done there, but my latex knowledge just 
>>isn't sufficient to do this (I usually use context). I think I need 
>>the keyval package, but I can't see where the scale-declaration 
>>would go. Can anybody help?
>It's done through the conjunction of helvet.sty and the accompanying 
>.fd files, and does indeed require the package keyval.sty. In 
>essence, the code inside helvet.sty defines \Hv at scale as <number> 
>when the package is called with the option [scale=<number>], and 
>then the .fd files use that value as a scale multiplier when calling 
>the .tfm font metric files. For example, inside ot1phv.fd you have:
>>\expandafter\ifx\csname Hv at scale\endcsname\relax
>>  \let\Hv@@scale\@empty
>>  \edef\Hv@@scale{s*[\csname Hv at scale\endcsname]}%
>>    <-> \Hv@@scale phvr7t
>which defines \Hv@@scale as the scale multiplier (in LaTeX's 2e 
>low-level font syntax) s*[\Hv at scale], and defines the phv font 
>family in medium series and normal shape to refer to the metrics 
>phvr7t.tfm preceded by \Hv@@scale. For this low-level syntax, see 
>section 4 of 
>I think Herb Schulz from this list has written a custom package 
>extending this mechanism to other fonts than Helvetica.
>Hope this helps,
>Bruno Voisin


As usual, Bruno said it better than I could. You can take a look at 
the couriers package on CTAN and see the parallel work I did to make 
a scalable Courier font. Just emulate that and it should work.

Good Luck,
Herb Schulz

Herb Schulz
(herbs at wideopenwest.com)
--------------------- Info ---------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
           & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>

More information about the MacOSX-TeX mailing list