summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/plain/typespec/TypeSp03.tex
blob: 3fd2eedbc7a71af0e1a5bdebbc84e54a2d87e49f (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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
%%% Stephen Moye
%%% Stephen_Moye@brown.edu
%%% Brown University
%%% Graphic Services

% Much of the math in this example is simple modular arithmetic,
% and gets around the fact that \TeX can only do integer math.
%
% This sort of typesetting project is probably better suited to 
% TrueType or PostScript typefaces.

\newtoks\dspfont
%%% Fill in the \TeX name of the font here:
\dspfont={cmr12} 

%%% Fill in the name of the typeface as you want it at the top of the page
\def\fontname{Computer Modern 12}

%%% The following is for notes in the comments at the bottom
%%% of the page following the type stats.
%%% Just leave it empty if you have nothing to say...
\def\comment{Drawn by Donald Knuth.}

%\hsize7.5in \hoffset-.5in
\parindent0pt
\nopagenumbers
\voffset-.5in
\advance\vsize by 1in

\font\text=\the\dspfont\space at 10pt
\font\tiny=\the\dspfont\space at 8pt
\font\name=\the\dspfont\space at 24pt

\newtoks\ntext
\newtoks\pantext
\newtoks\loremtext
%
\newbox\testbox 
%
\newdimen\bigger 
\newdimen\dspsize 
\newdimen\dspsizeincr 
\newdimen\habcwd
\newdimen\ctextsz
\newdimen\leading 
\newdimen\xheight 
\newdimen\ascheight
\newdimen\kernone 
\newdimen\kerntwo
\newdimen\adjust  \adjust0pt 
\newdimen\dist
\newdimen\scratchdim
%
\newcount\dsplineno
\newcount\picawd
\newcount\pointwd
\newcount\spconv
\newcount\measure 
\newcount\divisor 
\newcount\scratch
\newcount\sscratch
\newcount\xascrnum
\newcount\intgp
\newcount\fracp
\newcount\scppt \scppt=65536

\ntext={Typography may be defined as both
an art and a craft. It is an art in that what it does, it does for its
own sake, according to its own internal sense of what is beautiful and
right. It is a craft in that what it does, it does for a purpose
outside itself: it provides a means of storing, shaping and conveying
information. Typography is, therefore, a selfless art -- a
contradiction in terms, perhaps -- and is at its best when it is least
perceived to be doing anything, indeed when there is no active
awareness of perceiving it, directly, at all, but rather perceiving,
through it, the knowledge which animates the type on the page. Quality
in typography results from an effortless perfection of conception and
execution in the creation of a balance between beauty \& utility:
compromising neither, calling attention to neither, yet achieving
both.\thinspace\nobreak\leaders\hrule\hfill\null\par}

%%% The following pangrams were collected by David Lemon of Adobe Systems, Inc.
%%% This is just a small sample from the entire collection.
\pantext={Brick quiz whangs jumpy veldt fox.
Nymphs vex, beg quick fjord waltz.
Quick wafting zephyrs vex bold Jim.
West quickly gave Bert handsome prizes for six juicy plums.
Freight to me sixty dozen quart jars and twelve black pans.
My help squeezed back in again and joined the weavers after six.
Turgid saxophones blew over Mick's jazzy quiff.
Five wine experts jokingly quizzed sample chablis.
My grandfather picks up quartz and valuable onyx jewels.
Mix Zapf with Veljovic and get quirky Beziers.
All questions asked by five watch experts amazed the judge.
Back in June we delivered oxygen equipment of the same size.
We have just quoted on nine dozen boxes of grey lamp wicks.
A large fawn jumped quickly over white zinc boxes.
The exodus of jazzy pigeons is craved by squeamish walkers.\thinspace\nobreak\leaders\hrule\hfill\hbox{}\par}

\loremtext={Lorem ipsum
dolor sit amet, consectetuer adipiscing elit, sed diam
nonummy nibh eusi\-mod tincidunt ut laor\-eet dolore magna
ali\-quam erat volutpat. Ut wisi enim ad minim veniam, quis
nostrud exerci tation ullamcorper suscipit la\-bortis nisl
ut ali\-quip exea commodo consequat.
Quousque tandem abutere, Catilina, patientia nostra? Quamdiu nos etiam furor iste tuus eludet?
quem ad finem sese effrenata jactibit audicia? nihilne te nocturnum pr\ae sidium palatii, nihil
urbis vigil\ae .
Lorem ipsum
dolor sit amet, consectetuer adipiscing elit, sed diam
nonummy nibh eusi\-mod tincidunt ut laor\-eet dolore magna
ali\-quam erat volutpat. Ut wisi enim ad minim veniam, quis
nostrud exerci tation ullamcorper suscipit la\-bortis nisl
ut ali\-quip exea commodo consequat.
Quousque tandem abutere, Catilina, patientia nostra? Quamdiu nos etiam furor iste tuus eludet?
quem ad finem sese effrenata jactibit audicia? nihilne te nocturnum pr\ae sidium palatii, nihil
urbis vigil\ae .\thinspace\nobreak\leaders\hrule\hfill\null\par}

\def\abc{abcdefghijklmnopqrstuvwxyz}
\def\habc{\abc\abc abcdefghijklm}
\def\dabc{AGQMstaefgpy1234?!\&}
\def\ucabc{ABCDEFGHIJKLMNOPQRSTUVWXYZ\&}
\def\freqabc{\text  zjqx%
       kkvv%
       bbbbppppyyyywwwwgggg%
       mmmmmmffffffccccccuuuuuu%
       lllllllldddddddd%
       hhhhhhhhhhhhrrrrrrrrrrrrssssssssssss%
       ooooooooooooooiiiiiiiiiiiiiinnnnnnnnnnnnnn%
       aaaaaaaaaaaaaaaatttttttttttttttttt%
       eeeeeeeeeeeeeeeeeeeeeeee}% 204 chars

\def\ast{*} \def\per{.}

%%% Convert from TeX's bulky 4-decimal point measurements to 1
\def\prettypt#1{\dist=#1
\multiply\dist10
\scratch=\number\dist
\divide\scratch\scppt
\intgp=\scratch \divide\intgp10
\sscratch=\intgp 
\multiply\sscratch10 \advance\scratch-\sscratch
\fracp=\scratch
\hbox{\the\intgp.\the\fracp}pt\ }

\def\cvptin#1{\dist=#1
\multiply\dist by 10
\scratch=\number\dist
\divide\scratch\scppt
\multiply\scratch100
\fracp=\scratch
\divide\scratch72270
\intgp=\scratch
\multiply\scratch72270
\advance\fracp-\scratch
\multiply\fracp10
\divide\fracp7227
\hbox{\the\intgp.\ifnum\fracp<10 0\the\fracp \else\the\fracp\fi in}}

%%% Type factor = ([Type size] * [# of characters in a sample])/(linear length of sample)
%%% Based on {\it Brown's Index}, Bruce Brown, Greenwood Publishing, Great Britain 1983
\def\typefact{%
\dist=10pt
\spconv=\number\dist
\multiply\spconv by 12
\multiply\spconv by 204
\setbox1=\hbox{\text\freqabc}%
\divisor=\number\wd1
\divide\divisor by 100
\divide\spconv by \divisor
\scratch=\spconv 
	\divide\scratch100
 \divisor=\scratch
 \multiply \scratch100
 \advance\spconv-\scratch
 \hbox{\number\divisor.\ifnum\spconv<10 0\the\spconv \else \the\spconv\fi}}

\setbox0=\hbox{\tiny 0}
\kernone=.5\wd0 \kerntwo=\wd0
\def\k{\kern-\kernone}
\def\kk{\kern-\kerntwo}

\def\endline{\hbox to 0pt{\vrule width1pt height\baselineskip%
														depth.25\baselineskip\hss}}

\def\iline{\hbox to 0pt{\vrule width.25pt height\baselineskip\hss}}
\def\hline{\hbox to 0pt{\vrule width.25pt height.75\baselineskip\hss}}
\def\qline{\hbox to 0pt{\vrule width.25pt height.55\baselineskip\hss}}
\def\eline{\hbox to 0pt{\vrule width.25pt height.35\baselineskip\hss}}
\def\sline{\hbox to 0pt{\vrule width.25pt height.15\baselineskip\hss}}

\def\itick{\hbox to 1in{\iline\hfill}}
\def\htick{\hbox to .5in{\hline\hfill}}
\def\qtick{\hbox to .25in{\qline\hfill}}
\def\etick{\hbox to .125in{\eline\hfill}}
\def\stick{\hbox to .0625in{\sline\hfill}}

\def\dhtick{\hbox to .5in{\hline\hfill}}
\def\dttick{\hbox to .1in{\qline\hfill}}
\def\dftick{\hbox to .05in{\eline\hfill}}

\def\pctick{\hbox to 1pc{\iline\hss}}
\def\hpctick{\hbox to .5pc{\qline\hss}}

\def\druler#1 {\hbox to #1{\endline\hfill\endline}
\kern-\baselineskip \bigger=#1 \advance\bigger by .5in
\hbox to #1{\hrulefill}\kern-\baselineskip
\hbox to \bigger{\leaders\itick\hfill}\kern-\baselineskip
\hbox to #1{\leaders\dhtick\hfill}\kern-\baselineskip
\hbox to #1{\leaders\dttick\hfill}\kern-\baselineskip
\hbox to #1{\leaders\dftick\hfill}}

\def\pcruler#1 {\hbox to #1{\endline\hfill\endline}
\kern-\baselineskip
\hbox to #1{\hrulefill}\kern-\baselineskip
\hbox to #1{\leaders\pctick\hfill}\kern-\baselineskip
\hbox to #1{\leaders\hpctick\hfill}}

%%% Calculates the largest display typesize to fit \hsize
%%% First typeset it very small (.5pt) then calculate a
%%% scale factor to get it to fit to \hsize
\font\dsp=\the\dspfont\space at .1pt
\setbox0=\hbox{\dsp \ucabc}%
\dspsize=\hsize 
\scratch=\dspsize \multiply\scratch10 \divisor=\wd0
\divide\scratch by \divisor
\dspsize=\scratch pt \divide\dspsize by 100

%%% Calculates the increment such that smallest display size is 12pt
\dspsizeincr=\dspsize \advance\dspsizeincr by -12pt
\divide\dspsizeincr by 3 \dsplineno4

\kern-1\baselineskip

{\name \fontname\par}
\hbox to \hsize{\hrulefill}\kern-.25\baselineskip

%%% Display Type
\bgroup
\loop\font\dsp=\the\dspfont\space at \dspsize \dsp \baselineskip1em
		\hbox to\hsize{\ucabc\hfill\rlap{\text\prettypt{\the\dspsize}}}
  \hbox{\abc}\vskip.075in
		\ifnum\dsplineno>1 \global\advance\dsplineno by-1
			\advance\dspsize by -\dspsizeincr \font\dsp=\the\dspfont\space at \dspsize\repeat
\egroup

\setbox0=\hbox{\text x}
\xheight=\ht0

%%% Leading calculations
\setbox0=\hbox{\text Ilpgy}
\ascheight=\ht0
\leading=\ht0
\adjust=\xheight \advance\adjust-.5\leading
\advance\leading\dp0
\leading=1.175\leading  
\ifdim\dp0<.05\ht0 \advance\adjust.5\xheight\fi
\advance\leading by \adjust
\baselineskip\leading

%%% Calculates ratio of x-height to ascender height
\dimen0=\the\fontdimen5\text
\xascrnum=\dimen0%
\divisor=\number\ascheight
\multiply\xascrnum by 100\relax
\divide\xascrnum by\ascheight

%%% Calculates width of 2.5 lc alphabets in picas and points
\setbox0=\hbox{\text\habc} \habcwd=\wd0
\def\showhabcwd{%
\scratchdim=\habcwd \scratchdim=\scratchdim
\scratch=\number\scratchdim 
\divide\scratch\scppt \sscratch=\scratch
\divide\scratch12
\picawd=\scratch
\multiply\scratch by 12
\advance\sscratch-\scratch
\pointwd=\sscratch
\hbox{\the\picawd pc\the\pointwd}}

%%% Calculates the largest typesize to fit 70 characters to 4.5in.
%%% First typeset it very small (.5pt) then calculate a
%%% scale factor to get it to fit to 4.5in.
\font\calcfont=\the\dspfont\space at .5pt
\setbox0=\hbox{\calcfont \habc}%
\dspsize=4.5in 
\scratch=\dspsize \multiply\scratch10 \divisor=\wd0
\divide\scratch by \divisor
\ctextsz=\scratch pt \divide\ctextsz by 20

\vskip.2in

\text

\vbox{\baselineskip1.2\baselineskip%
\druler{6.51in}
%
{\hsize6in \settabs 6\columns\tiny
\+Decimal Inches&\k 1&\k 2&\k 3&\k 4&\k 5&\k 6\cr}
%
\text 1234567890\$\%\&?(``\thinspace'')\par
\habc\par
\uppercase\expandafter{\abc}\vskip.5em
%
\pcruler{38pc}
%
{\hsize35pc \settabs 7\columns\tiny
\+Picas&\k 5&\kk 10&\kk 15&\kk 20&\kk 25&\kk 30&\kk 35\cr}\vfill}

\vskip.25in

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%
%%% Change the text sample here.
%%% The choices are \ntext, \pantext and \loremtext
%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\vbox{%
\hsize\habcwd \baselineskip\leading \the\loremtext}

\vfill

\hbox to \hsize{\hrulefill}
\smallskip
\vbox{%
\emergencystretch1em\tiny \hsize.8\habcwd  \baselineskip.9\leading
%
\halign to \hsize{#\hfil\tabskip0pt plus 1fill&\hfil#\tabskip0pt\cr
Type stats:\cr
\noalign{\smallskip\hrule\smallskip}
Text sample (10pt) leading&\prettypt{\the\leading}\unskip\cr 
\noalign{\smallskip\hrule\smallskip}
Width of 2.5 lowercase 10pt alphabets&\showhabcwd\ or \cvptin{\the\habcwd}\unskip\cr
\noalign{\smallskip\hrule\smallskip}
Type size required for a 4.5in measure&\prettypt{\the\ctextsz}\unskip\cr
\noalign{\smallskip\hrule\smallskip}
Ratio of x-height to ascender height&\hbox{0.\the\xascrnum}\cr
\noalign{\smallskip\hrule\smallskip}
Typefactor&\typefact\cr
\noalign{\smallskip\hrule}}
\smallskip
\comment}%

\eject\end