File: scalefnt.sty

package info (click to toggle)
tetex-base 1.0-10
  • links: PTS
  • area: main
  • in suites: potato
  • size: 103,120 kB
  • ctags: 3,687
  • sloc: xml: 23,602; perl: 781; sh: 729; makefile: 168; lisp: 29
file content (44 lines) | stat: -rw-r--r-- 1,360 bytes parent folder | download | duplicates (22)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44

% scalefnt package
%%%%%%%%%%%%%%%%%%

% Copyright 1997 David carlisle
% This file may be distributed under the terms of the LPPL.
% See 00readme.txt for details.

% 1997/09/28  David Carlisle

% This package defines a command \scalefont. After \scalefont{.75} then
% the current font and baselineskip will be scaled to 75% of their
% original size. Any scale factor may be specified.

% If you are using traditional fd files based on bitmap font sizes,
% LaTeX's font system will round the requested font size to the nearest
% available size. If you are using scalable fonts, such as the psnfss
% or type1cm packages, then the requested font size will be used exactly.

% Almost all of the code here is in fact dealing with scaling the stretch
% components of \baselineskip. This is a bit odd as 99% of documents
% have a rigid \baselineskip, however the technique may be useful in
% some contexts, and is left here as an example.

\DeclareRobustCommand\scalefont[1]{%
  \dimen@\z@
  \dimen@ii\z@
  \afterassignment\@scalefont
              \@tempdima\the\baselineskip\relax\relax\relax\relax\relax
  \skip@#1\@tempdima\@plus#1\dimen@\@minus#1\dimen@ii
  \dimen@\f@size\p@
  \dimen@#1\dimen@
  \fontsize\dimen@\skip@\selectfont}

\def\@scalefont#1#2#3#4#5{%
 \if#1p%
    \afterassignment\@scalefont\dimen@#5%
 \else
   \if#1m%
     \dimen@ii
   \fi
  \fi}