Debian Codegraph @

texmf-dist/tex/latex/seminar/npsfont.sty

raw
1 %% BEGIN npsfont.sty
2 %%
3 \def\fileversion{v1.0}
4 \def\filedate{91/11/20}
5 %%
6 %% Style option npsfont.sty, for use with LaTeX 2.09
7 %% and the New Font Selection Scheme.
8 %%
9 %% COPYRIGHT 1992, by Timothy Van Zandt, [email protected]
10 %%
11 %%
12 %% This file may be distributed and/or modified under the conditions of
13 %% the LaTeX Project Public License, either version 1.2 of this license
14 %% or (at your option) any later version. The latest version of this
15 %% license is in:
16 %%
17 %% http://www.latex-project.org/lppl.txt
18 %%
19 %% and version 1.2 or later is part of all distributions of LaTeX version
20 %% 1999/12/01 or later.
21 %%
22 %%
23 % DESCRIPTION:
24 %
25 % Defining new PostScript fonts with the New Font Selection Scheme is easy,
26 % but these macros make it easier. They save on keystrokes, and most
27 % importantly, they make it easy to change the file names used for fonts
28 % because you only have to type the file name once instead of 12 times (for
29 % the 12 standard LaTeX sizes). An optional argument lets you scale the fonts.
30 %
31 % These macros are substitutes for the NFSS's \new@fontshape command. For
32 % information on the purpose of this command, and on how to select fonts that
33 % are defined with it, see the documentation of the NFSS. If you don't have
34 % the NFSS, it is available from
35 % rusmv1.rus.uni-stuttgart.de
36 % in
37 % soft/tex/latex-style-supported/New-Font-Selection
38 % and from
39 % ymir.claremont.edu
40 % in
41 % [.anonymous.tex.inputs.latex-mainz]
42 % The NFSS is undoubtably the best way to use PostScript fonts (or any non-
43 % standard fonts) with LaTeX, and is well worth upgrading to.
44 %
45 % USAGE:
46 %
47 % \newpsfont[<scaling>]{<family>}{<series>}{<shape>}{<filename>}
48 %
49 % \newpsfamily[<scaling>]{<family>}{
50 % {<series 1>}{<shape 1>}{<filename 1>},
51 % {<series 2>}{<shape 2>}{<filename 2>},
52 % . . .
53 % {<series n>}{<shape n>}{<filename n>}}
54 %
55 % The scaling argument is optional. Like the \new@fontshape command, these
56 % commands can only be used in the preamble.
57 %
58 % EXAMPLE:
59 %
60 % Suppose the Helvetica-Oblique virtual font on your system has the name
61 % phvro.vf. The following defines the <helvetica> family, <m>edium series, and
62 % <it>alic shape to be the Helvetica-Oblique font, at the standard LaTeX
63 % font sizes, scaled by .82:
64 %
65 % \newpsfont[.82]{helvetica}{m}{it}{phvro}
66 %
67 % This is equivalent to:
68 %
69 % \new@fontshape{helvetica}{m}{it}{%
70 % <5>phvro at 4.1pt%
71 % <6>phvro at 4.92pt%
72 % <7>phvro at 5.74pt%
73 % <8>phvro at 6.56pt%
74 % <9>phvro at 7.38pt%
75 % <10>phvro at 8.2pt%
76 % <11>phvro at 8.979pt%
77 % <12>phvro at 9.84pt%
78 % <14>phvro at 11.808pt%
79 % <17>phvro at 14.1696pt%
80 % <20>phvro at 17.0068pt%
81 % <25>phvro at 20.4016pt}{}
82 %
83 % The following command sets up the standard Helvetica family:
84 %
85 % \newpsfamily[.82]{helvetica}{%
86 % {m}{n}{phvr}, %Helvetica
87 % {m}{it}{phvro}, %Helvetica-Oblique
88 % {m}{sl}{phvro}, %Helvetica-Oblique
89 % {bx}{n}{phvb}, %Helvetica-Bold
90 % {bx}{it}{phvbo}, %Helvetica-BoldOblique
91 % {bx}{sl}{phvbo}} %Helvetica-BoldOblique
92 %
93 % (Don't forget the commas.) It is equivalent to:
94 %
95 % \newpsfont[.82]{helvetica}{m}{n}{phvr} %Helvetica
96 % \newpsfont[.82]{helvetica}{m}{it}{phvro} %Helvetica-Oblique
97 % \newpsfont[.82]{helvetica}{m}{sl}{phvro} %Helvetica-Oblique
98 % \newpsfont[.82]{helvetica}{bx}{n}{phvb} %Helvetica-Bold
99 % \newpsfont[.82]{helvetica}{bx}{it}{phvbo} %Helvetica-BoldOblique
100 % \newpsfont[.82]{helvetica}{bx}{sl}{phvbo} %Helvetica-BoldOblique
101 % \extra@def{helvetica}{}{}
102 %
103 % WHY SCALE FONTS?:
104 %
105 % Disclaimer: The suggestions that follow come from someone who doesn't know
106 % anything about fonts.
107 %
108 % Mixing fonts that are not designed to be used together is not for purists,
109 % but many of us do it anyway. Scaling the fonts can at least correct for
110 % differences in the x-heights. This is important if you use Computer
111 % Modern fonts for in-line math and some other fonts for text.
112 %
113 % To find out the x-height of the 10pt size of a font, load this style and
114 % use the command
115 %
116 % \showxheight{<filename>}
117 %
118 % E.g., \showxheight{phvr} and \showxheight{cmr10} displays
119 %
120 % x-height of cmr10 at 10pt is 4.30554pt
121 % x-height of phvr at 10pt is 5.24998pt
122 %
123 % on the terminal. Scaling the Helvetica fonts by 4.30554/5.24990 = .82
124 % gets the x-heights of these fonts in line. It is best to set the x-heights
125 % the same for the medium weight, normal shaped fonts, and then scale the
126 % rest of the fonts in the same family by the same amount.
127 %
128 % David Jones has a psfonts.sty that sets up the standard PostScript fonts,
129 % all scaled so that the x-heights match that of the Computer Modern medium
130 % roman font. It is available via anonymous ftp from theory.lcs.mit.edu in
131 % /pub/dmjones.
132 %
133 % IMPLEMENTATION:
134 %
135 % \scale@stdsizes has at its argument a scaling factor. It uses \font@scale
136 % to define \scaled@sizes to be the macro whose argument is the name of a
137 % font, and which expands to the definitions of the standard \LaTeX{} sizes
138 % for New Font Selection Schemes \new@fontshape command.
139 %
140 \message{\space\space\fileversion\space\space\filedate
141 \space\space<tvz>}
142 \@ifundefined{new@psfontshape}{}{\endinput}
143 \def\font@scale#1#2#3{\dimen@=#2\dimen@=#3\dimen@
144 \edef\scaled@sizes##1{\scaled@sizes{##1}<#1>##1 at\number\dimen@ sp}}
145 \def\scale@stdsizes#1{%
146 \edef\scaled@sizes##1{}%
147 \font@scale{5}{5pt}{#1}%
148 \font@scale{6}{6pt}{#1}%
149 \font@scale{7}{7pt}{#1}%
150 \font@scale{8}{8pt}{#1}%
151 \font@scale{9}{9pt}{#1}%
152 \font@scale{10}{10pt}{#1}%
153 \font@scale{11}{10.95pt}{#1}%
154 \font@scale{12}{12pt}{#1}%
155 \font@scale{14}{14.4pt}{#1}%
156 \font@scale{17}{17.28pt}{#1}%
157 \font@scale{20}{20.74pt}{#1}%
158 \font@scale{25}{24.88pt}{#1}}
159 \def\new@psfontshape#1#2#3#4{%
160 \new@fontshape{#1}{#2}{#3}{\scaled@sizes{#4}}{}}
161 \def\new@psfont[#1]#2#3#4#5{%
162 \scale@stdsizes{#1}%
163 \new@psfontshape{#2}{#3}{#4}{#5}}
164 \def\newpsfont{%
165 \@ifnextchar [{\new@psfont}{\new@psfont[1]}}
166 \def\newpsfamily{%
167 \@ifnextchar [{\new@psfamily}{\new@psfamily[1]}}
168 \def\new@psfamily[#1]#2#3{%
169 \scale@stdsizes{#1}%
170 \@for\@tempa:=#3\do{%
171 \edef\@tempb{\noexpand\new@psfontshape{#2}\@tempa}
172 \@tempb}%
173 \extra@def{#2}{}{}}
174 \def\showxheight#1{%
175 \font\@tempfont=#1 at 10pt%
176 \typeout{^^J x-height of #1 at 10pt is \the\fontdimen5\@tempfont}}
177 % The commands are added to \@preamblecmds to save memory.
178 \begingroup
179 \def\do{\noexpand\do\noexpand}
180 \xdef\@preamblecmds{\@preamblecmds
181 \do\font@scale
182 \do\scale@stdsizes
183 \do\scaled@sizes
184 \do\new@psfontshape
185 \do\new@psfont
186 \do\newpsfont
187 \do\newpsfamily
188 \do\new@psfamily}
189 \endgroup
190 \endinput
191 %% END npsfont.sty