summaryrefslogtreecommitdiff
path: root/macros/ytex/yfonts.mac
blob: 499fbb6e9b64eaa8d9de6e4094154537514cc915 (plain)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
% Copyright (c) 1985, 1986 Daniel C. Brotsky.  All rights reserved.
% Font macros for yTeX.  See the file YTEX.MAC for details.

% CONTENTS

% ^L-page       contents
% ----------------------------------------------------------------------
% 1             %% Font macros for YTEX
% 2             %% typesize
% 3             %% usersize
% 4             %% initialization

\message{typesize,}

\newif\ifmagscaling
\newif\ifexactsizes
\newdimen\typesiz@
\newtoks\baselinefactor

\def\typesize {\afterassignment\typ@size\dimen@}
\def\typ@siz@ {%
  \let\typ@size=\siz@rr
  \ymessage{{\string\typesize=\the\dimen@}}
  \ifdim       10\p@=\dimen@ \tenp@int    \csname usersizeten\endcsname
  \else \ifdim 11\p@=\dimen@ \elevenp@int \csname usersizeeleven\endcsname
  \else \ifdim 12\p@=\dimen@ \twelvep@int \csname usersizetwelve\endcsname
  \else \let\typ@size=\typ@siz@
        \errhelp={Insert `\string\typesize=<dimen>'
                  where <dimen> is 10pt, 11pt, or 12pt.}%
        \errmessage{Unrecognized size (\the\dimen@) in \string\typesize.
                    Try again.}\fi\fi\fi}
\def\siz@rr {%
  \errhelp={Just continue and I'll ignore the size switch.}%
  \errmessage{You can't change sizes in the middle of a document.}%
  \relax}
\def\fixsiz@ {%
  \ifx\typ@size\siz@rr
    \else \global\let\typ@size=\siz@rr \global\let\fixsiz@=\relax
          \errhelp={Too late now.  Just continue and I'll assume you want }%
          \addtotoks\errhelp\expandafter{\the\typesiz@.}%
          \errmessage{You never gave a \string\typesize\space command.}%
    \fi}
\let\typ@size=\typ@siz@

\def\tenp@int {%
  \typesiz@=10pt
  \s@tten \mag=\magstep\z@}

\def\elevenp@int {%
  \typesiz@=11pt
  \ifmagscaling
    \s@tten \ifexactsizes \mag=1100 \else \mag=\magstephalf \fi
  \else
    \s@televen \mag=\magstep\z@
  \fi}

\def\twelvep@int {%
  \typesiz@=12pt
  \ifmagscaling
    \s@tten \ifexactsizes \mag=1200 \else \mag=\magstep\@ne \fi
  \else
    \s@ttwelve \mag=\magstep\z@
  \fi}

\def\s@tten {%
  \let\regsize=\tenpoint
  \let\smlsize=\ninepoint
  \let\smllsize=\eightpoint
  \let\smlllsize=\eightpoint
  \let\bigsize=\twelvepoint
  \let\biggsize=\fourteenpoint
  \let\bigggsize=\eighteenpoint
  \regsize}

\def\s@televen {%
  \let\regsize=\elevenpoint
  \let\smlsize=\tenpoint
  \let\smllsize=\ninepoint
  \let\smlllsize=\eightpoint
  \let\bigsize=\twelvepoint
  \let\biggsize=\fourteenpoint
  \let\bigggsize=\eighteenpoint
  \regsize}

\def\s@ttwelve {%
  \let\regsize=\twelvepoint
  \let\smlsize=\tenpoint
  \let\smllsize=\ninepoint
  \let\smlllsize=\eightpoint
  \let\bigsize=\fourteenpoint
  \let\biggsize=\eighteenpoint
  \let\bigggsize=\eighteenpoint
  \regsize}

\message{usersize,}

% new def of \setnormalspa@cing that leaves displayskips alone
\def\setnormalsp@cing{%  SIDE EFFECT is to go into \rm
  \rm   % set the em properly
  \normalbaselineskip=\the\baselinefactor em%
  \normalbaselines}

% user hook to \setnormalsp@cing
\def\setnormalbaselines {\setnormalsp@cing}

\def\normalbaselines{%
  \lineskip\normallineskip
  \baselineskip\normalbaselineskip
  \lineskiplimit\normallineskiplimit
  \setbox\strutbox=\hbox{\vrule height .7\baselineskip
                                depth .3\baselineskip width\z@}}

\def\usereighteenpointmacro {%
  \let\smllrm=\twelverm
  \let\smlrm=\fourteenrm\let\smlit=\fourteenit
  \let\smlbf=\fourteenbf\let\smltt=\fourteentt}

\def\userfourteenpointmacro {%
  \let\smllrm=\tenrm
  \let\smlrm=\twelverm\let\smlit=\twelveit
  \let\smlbf=\twelvebf\let\smltt=\twelvett}

\def\usertwelvepointmacro {%
  \let\smllrm=\ninerm
  \let\smlrm=\tenrm\let\smlit=\tenit
  \let\smlbf=\tenbf\let\smltt=\eleventt}

\def\userelevenpointmacro {%
  \let\smllrm=\eightrm
  \let\smlrm=\tenrm\let\smlit=\tenit
  \let\smlbf=\tenbf\let\smltt=\tentt}

\def\usertenpointmacro {%
  \let\smllrm=\eightrm
  \let\smlrm=\ninerm\let\smlit=\nineit
  \let\smlbf=\ninebf\let\smltt=\ninett}

\def\userninepointmacro {%
  \let\smllrm=\sevenrm
  \let\smlrm=\eightrm\let\smlit=\eightit
  \let\smlbf=\eightbf\let\smltt=\eighttt}

\def\usereightpointmacro {%
  \let\smllrm=\sevenrm
  \let\smlrm=\eightrm\let\smlit=\eightit
  \let\smlbf=\eightbf\let\smltt=\eighttt}

\message{initialization,}

% parameters
\magscalingtrue
\baselinefactor={1.3}

% default type size
\tenp@int