Debian Codegraph @

texmf-dist/source/latex/trajan/trajan.dtx

raw
1 % \iffalse meta-comment
2 %
3 % trajan.dtx
4 %
5 % Author: Peter Wilson (Herries Press) herries dot press at earthlink dot net
6 % Copyright 1999--2005 Peter R. Wilson
7 %
8 % This work may be distributed and/or modified under the
9 % conditions of the Latex Project Public License, either
10 % version 1.3 of this license or (at your option) any
11 % later version.
12 % The latest version of the license is in
13 % http://www.latex-project.org/lppl.txt
14 % and version 1.3 or later is part of all distributions of
15 % LaTeX version 2003/06/01 or later.
16 %
17 % This work has the LPPL maintenance status "author-maintained".
18 %
19 % This work consists of the files listed in the README file.
20 %
21 %
22 %<*driver>
23 \documentclass[twoside]{ltxdoc}
24 \usepackage{url}
25 \usepackage[draft=false,
26 plainpages=false,
27 pdfpagelabels,
28 bookmarksnumbered,
29 hyperindex=false
30 ]{hyperref}
31 \providecommand{\phantomsection}{}
32 \OnlyDescription %% comment this out for the full glory
33 \EnableCrossrefs
34 \CodelineIndex
35 \setcounter{StandardModuleDepth}{1}
36 \makeatletter
37 \@mparswitchfalse
38 \makeatother
39 \renewcommand{\MakeUppercase}[1]{#1}
40 \pagestyle{headings}
41 \newenvironment{addtomargins}[1]{%
42 \begin{list}{}{%
43 \topsep 0pt%
44 \addtolength{\leftmargin}{#1}%
45 \addtolength{\rightmargin}{#1}%
46 \listparindent \parindent
47 \itemindent \parindent
48 \parsep \parskip}%
49 \item[]}{\end{list}}
50 \begin{document}
51 \raggedbottom
52 \DocInput{trajan.dtx}
53 \end{document}
54 %</driver>
55 %
56 %
57 % \fi
58 %
59 % \CheckSum{37}
60 %
61 % \DoNotIndex{\',\.,\@M,\@@input,\@addtoreset,\@arabic,\@badmath}
62 % \DoNotIndex{\@centercr,\@cite}
63 % \DoNotIndex{\@dotsep,\@empty,\@float,\@gobble,\@gobbletwo,\@ignoretrue}
64 % \DoNotIndex{\@input,\@ixpt,\@m}
65 % \DoNotIndex{\@minus,\@mkboth,\@ne,\@nil,\@nomath,\@plus,\@set@topoint}
66 % \DoNotIndex{\@tempboxa,\@tempcnta,\@tempdima,\@tempdimb}
67 % \DoNotIndex{\@tempswafalse,\@tempswatrue,\@viipt,\@viiipt,\@vipt}
68 % \DoNotIndex{\@vpt,\@warning,\@xiipt,\@xipt,\@xivpt,\@xpt,\@xviipt}
69 % \DoNotIndex{\@xxpt,\@xxvpt,\\,\ ,\addpenalty,\addtolength,\addvspace}
70 % \DoNotIndex{\advance,\Alph,\alph}
71 % \DoNotIndex{\arabic,\ast,\begin,\begingroup,\bfseries,\bgroup,\box}
72 % \DoNotIndex{\bullet}
73 % \DoNotIndex{\cdot,\cite,\CodelineIndex,\cr,\day,\DeclareOption}
74 % \DoNotIndex{\def,\DisableCrossrefs,\divide,\DocInput,\documentclass}
75 % \DoNotIndex{\DoNotIndex,\egroup,\ifdim,\else,\fi,\em,\endtrivlist}
76 % \DoNotIndex{\EnableCrossrefs,\end,\end@dblfloat,\end@float,\endgroup}
77 % \DoNotIndex{\endlist,\everycr,\everypar,\ExecuteOptions,\expandafter}
78 % \DoNotIndex{\fbox}
79 % \DoNotIndex{\filedate,\filename,\fileversion,\fontsize,\framebox,\gdef}
80 % \DoNotIndex{\global,\halign,\hangindent,\hbox,\hfil,\hfill,\hrule}
81 % \DoNotIndex{\hsize,\hskip,\hspace,\hss,\if@tempswa,\ifcase,\or,\fi,\fi}
82 % \DoNotIndex{\ifhmode,\ifvmode,\ifnum,\iftrue,\ifx,\fi,\fi,\fi,\fi,\fi}
83 % \DoNotIndex{\input}
84 % \DoNotIndex{\jobname,\kern,\leavevmode,\let,\leftmark}
85 % \DoNotIndex{\list,\llap,\long,\m@ne,\m@th,\mark,\markboth,\markright}
86 % \DoNotIndex{\month,\newcommand,\newcounter,\newenvironment}
87 % \DoNotIndex{\NeedsTeXFormat,\newdimen}
88 % \DoNotIndex{\newlength,\newpage,\nobreak,\noindent,\null,\number}
89 % \DoNotIndex{\numberline,\OldMakeindex,\OnlyDescription,\p@}
90 % \DoNotIndex{\pagestyle,\par,\paragraph,\paragraphmark,\parfillskip}
91 % \DoNotIndex{\penalty,\PrintChanges,\PrintIndex,\ProcessOptions}
92 % \DoNotIndex{\protect,\ProvidesClass,\raggedbottom,\raggedright}
93 % \DoNotIndex{\refstepcounter,\relax,\renewcommand,\reset@font}
94 % \DoNotIndex{\rightmargin,\rightmark,\rightskip,\rlap,\rmfamily,\roman}
95 % \DoNotIndex{\roman,\secdef,\selectfont,\setbox,\setcounter,\setlength}
96 % \DoNotIndex{\settowidth,\sfcode,\skip,\sloppy,\slshape,\space}
97 % \DoNotIndex{\symbol,\the,\trivlist,\typeout,\tw@,\undefined,\uppercase}
98 % \DoNotIndex{\usecounter,\usefont,\usepackage,\vfil,\vfill,\viiipt}
99 % \DoNotIndex{\viipt,\vipt,\vskip,\vspace}
100 % \DoNotIndex{\wd,\xiipt,\year,\z@}
101 %
102 % \changes{v1.0}{1999/04/02}{First public release}
103 % \changes{v1.0a}{2001/01/02}{Fixed missing * in .fd files}
104 % \changes{v1.1}{2005/06/29}{Added map file}
105 % \changes{v1.1}{2005/06/29}{Changed contact details}
106 %
107 % \def\fileversion{v1.0} \def\filedate{1999/04/02}
108 % \def\fileversion{v1.0a} \def\filedate{2001/01/02}
109 % \def\fileversion{v1.1} \def\filedate{2005/06/29}
110 %
111 % \newcommand*{\Lpack}[1]{\textsf {#1}} ^^A typeset a package
112 % \newcommand*{\Lopt}[1]{\textsf {#1}} ^^A typeset an option
113 % \newcommand*{\file}[1]{\texttt {#1}} ^^A typeset a file
114 % \newcommand*{\Lcount}[1]{\textsl {\small#1}} ^^A typeset a counter
115 % \newcommand*{\pstyle}[1]{\textsl {#1}} ^^A typeset a pagestyle
116 % \newcommand*{\Lenv}[1]{\texttt {#1}} ^^A typeset an environment
117 %
118 % \title{The \Lpack{Trajan} fonts\thanks{This
119 % file has version number \fileversion, last revised
120 % \filedate.}}
121 %
122 % \author{%
123 % Peter Wilson\thanks{\texttt{herries dot press at earthlink dot net}}\\
124 % Herries Press
125 % }
126 % \date{\filedate}
127 % \maketitle
128 % \begin{abstract}
129 % The \Lpack{trajan} package provides a set of uppercase fonts as
130 % carved on the Trajan column in Rome in 114 \textsc{ad}.
131 % \end{abstract}
132 % \tableofcontents
133 %
134 %
135 %
136 % \section{Introduction}
137 %
138 % Around the beginning of the 16th century several authors published designs
139 % for uppercase characters. The more well known among these were Albrecht
140 % D\"{u}rer who wrote \textit{On the Just Shaping of Letters} which was
141 % published in Nuremberg in 1525, and Geofroy
142 % Tory who wrote \textit{Champ Fleury} which was published in Paris in 1529.
143 % Fra Luca Bartolomeo de Pacioli preceeded by of these by developing his
144 % recipe for uppercase characters in 1497 and which was published in
145 % \textit{De Divina Proportione} at Venice in 1509. Metafont versions
146 % of the D\"{u}rer and Pacioli fonts are available\footnote{In directories
147 % \texttt{duerer} and \texttt{pacioli} respectively, in the font area.}
148 % from CTAN.
149 %
150 % Many typographers rank the capitals carved on the Trajan column in
151 % Rome, dated at 114~\textsc{ad}, as the high point of the Roman's
152 % artistic legacy. These letter shapes were the best basic form in the
153 % subsequent development of uppercase fonts. The top line of the letters
154 % on the Trajan column are about six feet above eye level, with the letters
155 % being about four and a half inches tall. There are six lines of text
156 % and the letter height on the lowest line has been reduced to about 75\%
157 % of the those at the top of the inscription.
158 %
159 % Fortunately, Jan Tschichold~\cite{TSCHICHOLD92} provides
160 % a more accessible source for the Trajan characters, and I have used
161 % his work in developing this rendition of the lettering.
162 %
163 % This manual is typeset according to the conventions of the
164 % \LaTeX{} \textsc{docstrip} utility which enables the automatic
165 % extraction of the \LaTeX{} macro source files~\cite{GOOSSENS94}.
166 %
167 % Section~\ref{sec:usc} describes the usage of the package.
168 % Commented code for the fonts and source code for the package is in
169 % later sections.
170 %
171 %
172 % \section{The \Lpack{trajan} package} \label{sec:usc}
173 %
174 % The Romans did not have the J, U or W letters in their abecedary, and
175 % rarely used H, K or Z. Jan Tschichold designed glyphs for these six
176 % letters to complement the character set on the Trajan column.
177 %
178 % I have also added modified versions of Knuth's Computer Modern punctuation
179 % characters so that, perhaps, the Trajan font could be used as a
180 % titling font.
181 %
182 % Trajan's font as provided here consists of the uppercase letters,
183 % the punctuation marks !.,;:`'?,
184 % the hyphen together with the en- and em-dash,
185 % and the analphabetic characters ()[]\&.
186 % All the chacters are accessed by typing them as you usually do in \LaTeX.
187 %
188 % \DescribeEnv{trjnfamily}
189 % The family name is \texttt{trjn}. Use the \texttt{trjnfamily} environment
190 % for long stretches of text.
191 %
192 % \DescribeMacro{\texttrjn}
193 % Use \verb?\texttrjn{a word or two}? to typeset a \texttt{word or two} in
194 % the Trajan font.
195 %
196 % \StopEventually{
197 % \bibliographystyle{alpha}
198 % \begin{thebibliography}{GMS94}
199 %
200 % \bibitem[GMS94]{GOOSSENS94}
201 % Michel Goossens, Frank Mittelbach, and Alexander Samarin.
202 % \newblock \emph{The LaTeX Companion}.
203 % \newblock Addison-Wesley Publishing Company, 1994.
204 %
205 % \bibitem[Tsc92]{TSCHICHOLD92}
206 % Jan Tschichold.
207 % \newblock \emph{Treasury of Alphabets and Lettering}.
208 % \newblock W.~W.~Norton, 1992.
209 %
210 % \end{thebibliography}
211 % \PrintIndex
212 % }
213 %
214 %
215 % \section{The Metafont code} \label{sec:mf}
216 %
217 % \subsection{The parameter file}
218 %
219 % We deal with the two parameter files first, and start by announcing
220 % what they are for.
221 % \begin{macrocode}
222 %<*up|sl>
223 %<up> %%% TRJNR10.MF Computer Trajan Roman at 10 point design size.
224 %<sl> %%% TRJNSL10.MF Computer Trajan Slanted at 10 point design size.
225 %
226 % \end{macrocode}
227 % Parameters from CMR10.MF are used as much as possible. We also
228 % make sure that \Lpack{cmbase} is loaded as well as plain Metafont.
229 % \begin{macrocode}
230 if unknown cmbase: input cmbase fi
231
232 %<up>font_identifier:="TRJNR"; font_size 10pt#;
233 %<sl>font_identifier:="TRJNSL"; font_size 10pt#;
234
235 % \end{macrocode}
236 %
237 %
238 % \begin{macro}{u}
239 % \begin{macro}{hstretch}
240 % \begin{macro}{vstretch}
241 % \begin{macro}{width-adj}
242 % \begin{macro}{serif-fit}
243 % \begin{macro}{cap-serif-fit}
244 % \begin{macro}{letter-fit}
245 % The majority of the parameters and values are the same for both
246 % fonts.
247 % \begin{macrocode}
248 u#:=20/36pt#; % unit width
249 hstretch:=1; % horizontal stretching factors; in lieu of u
250 vstretch:=1; % vertical stretching factor
251 width_adj#:=0pt#; % width adjustment for certain characters
252 serif_fit#:=0pt#; % extra sidebar near lowercase serifs
253 cap_serif_fit#:=5/36pt#; % extra sidebar near uppercase serifs
254 letter_fit#:=0pt#; % extra space added to all sidebars
255
256 % \end{macrocode}
257 % \end{macro}
258 % \end{macro}
259 % \end{macro}
260 % \end{macro}
261 % \end{macro}
262 % \end{macro}
263 % \end{macro}
264 %
265 % \begin{macro}{body-height}
266 % \begin{macro}{asc-height}
267 % \begin{macro}{cap-height}
268 % \begin{macro}{fig-height}
269 % \begin{macro}{x-height}
270 % \begin{macro}{math-axis}
271 % \begin{macro}{bar-height}
272 % \begin{macro}{comma-depth}
273 % \begin{macro}{desc-depth}
274 % \begin{macro}{half-height}
275 % \begin{macrocode}
276 body_height#:=270/36pt#; % height of tallest characters
277 asc_height#:=250/36pt#; % height of lowercase ascenders
278 cap_height#:=246/36pt#; % height of caps
279 fig_height#:=232/36pt#; % height of numerals
280 x_height#:=155/36pt#; % height of lowercase without ascenders
281 math_axis#:=90/36pt#; % axis of symmetry for math symbols
282 bar_height#:=87/36pt#; % height of crossbar in lowercase e
283 comma_depth#:=70/36pt#; % depth of comma below baseline
284 desc_depth#:=70/36pt#; % depth of lowercase descenders
285 half_height#:=1/2cap_height#; % half the height of caps
286
287 % \end{macrocode}
288 % \end{macro}
289 % \end{macro}
290 % \end{macro}
291 % \end{macro}
292 % \end{macro}
293 % \end{macro}
294 % \end{macro}
295 % \end{macro}
296 % \end{macro}
297 % \end{macro}
298 %
299 % \begin{macro}{side}
300 % \begin{macro}{thickfudge}
301 % \begin{macro}{mediumfudge}
302 % \begin{macro}{thinfudge}
303 % \begin{macro}{thick}
304 % \begin{macro}{medium}
305 % \begin{macro}{thin}
306 % At the `design size' of the Trajan font, the thickest parts of the letters
307 % were 1/10 of the height. I have increased the thickness a bit to make
308 % the font look a bit more substantial at the more common printing sizes.
309 % \begin{macrocode}
310 side#:=cap_height#; % Height and width of the square
311 thickfudge:=1/9; mediumfudge:=1/2; thinfudge:=1/3;
312 thick#:=thickfudge*side#; % thickness of all thick limbs in Roman font
313 medium#:=mediumfudge*thick#; % width of medium limbs
314 thin#:=thinfudge*thick#; % thinness of all thin limbs
315
316 % \end{macrocode}
317 % \end{macro}
318 % \end{macro}
319 % \end{macro}
320 % \end{macro}
321 % \end{macro}
322 % \end{macro}
323 % \end{macro}
324 %
325 % \begin{macro}{eta}
326 % \begin{macro}{serif-darkness}
327 % \begin{macro}{sadj}
328 % \begin{macro}{crisp}
329 % \begin{macro}{tiny}
330 % \begin{macro}{fine}
331 % \begin{macro}{rule-thickness}
332 % \begin{macrocode}
333 eta:=2-sqrt2; % darkness for serifs; $\eta \approx 0.58$
334 serif_darkness:=eta;
335 sadj:=0.6; % serif darkness adjustment
336 crisp#:=0pt#; % diameter of serif corners
337 tiny#:=0pt#; % diameter of rounded corners
338 fine#:=7/36pt#; % diameter of sharply rounded corners
339 rule_thickness#:=.4pt#; % thickness of lines in math symbols
340
341 % \end{macrocode}
342 % \end{macro}
343 % \end{macro}
344 % \end{macro}
345 % \end{macro}
346 % \end{macro}
347 % \end{macro}
348 % \end{macro}
349 %
350 % \begin{macro}{cap-stem}
351 % \begin{macro}{stem}
352 % \begin{macro}{dish}
353 % \begin{macro}{bracket}
354 % \begin{macro}{jut}
355 % \begin{macro}{cap-jut}
356 % \begin{macro}{beak-jut}
357 % \begin{macro}{slab}
358 % \begin{macro}{dslab}
359 % \begin{macrocode}
360 cap_stem#:=thick#; % thickness of majuscule stems
361 stem#:=thick#; % thickness of minuscule stems
362 dish#:=1/36pt#; % amount erased at top or bottom of serifs
363 bracket#:=thick#; % vertical distance from serif base to tangent
364 jut#:=thick#; % protrusion of lowercase serifs
365 cap_jut#:=thick#; % protrusion of uppercase serifs for I
366 beak_jut#:=10/36pt#; % horizontal protrusion of beak serifs
367 slab#:=eps*1pt#; % serif and arm thickness
368 dslab#=0; %slab value used in Trajan fonts
369
370 % \end{macrocode}
371 % \end{macro}
372 % \end{macro}
373 % \end{macro}
374 % \end{macro}
375 % \end{macro}
376 % \end{macro}
377 % \end{macro}
378 % \end{macro}
379 % \end{macro}
380 %
381 % \begin{macro}{hair}
382 % \begin{macro}{vair}
383 % |hair| is the lowercase hairline breadth, and |vair| is the vertical
384 % diameter of hairlines.
385 % \begin{macrocode}
386 hair#:=vair#:=thin#;
387
388 % \end{macrocode}
389 % \end{macro}
390 % \end{macro}
391 %
392 % \begin{macro}{o}
393 % \begin{macro}{apex-o}
394 % \begin{macro}{apex-corr}
395 % These deal with fine tuning of some aspects of the glyphs.
396 % \begin{macrocode}
397 o#:=8/36pt#; % amount of overshoot for curves
398 apex_o#:=thin#; % amount of overshoot for diagonal junctions
399 apex_corr#=0pt#; % fine tuning of overshoot
400
401 % \end{macrocode}
402 % \end{macro}
403 % \end{macro}
404 % \end{macro}
405 %
406 % \begin{macro}{slant}
407 % |slant| is the amount the font slopes to the right. It is different
408 % for the two fonts.
409 % \begin{macrocode}
410 %<up>slant:=0; % tilt ratio $(\Delta x/\Delta y)$
411 %<sl>slant:=1/6; % tilt ratio $(\Delta x/\Delta y)$
412
413 % \end{macrocode}
414 % \end{macro}
415 %
416 % \begin{macro}{fudge}
417 % \begin{macro}{superness}
418 % \begin{macro}{superpull}
419 % \begin{macro}{beak-darkness}
420 % \begin{macrocode}
421 fudge:=1; % factor applied to weights of heavy characters
422 superness:=1/sqrt2; % parameter for superellipses
423 superpull:=0; % extra openness inside bowls
424 beak_darkness:=11/30; % fraction of triangle inside beak serifs
425
426 % \end{macrocode}
427 % \end{macro}
428 % \end{macro}
429 % \end{macro}
430 % \end{macro}
431 %
432 % \begin{macro}{serifs}
433 % \begin{macro}{monospace}
434 % We are generating a seriffed, variable-width font.
435 % \begin{macrocode}
436 serifs:=true; % should serifs and bulbs be attached?
437 monospace:=false; % should all characters have the same width?
438
439 % \end{macrocode}
440 % \end{macro}
441 % \end{macro}
442 %
443 % \begin{macro}{dot-size}
444 % \begin{macro}{square-dots}
445 % \begin{macro}{hefty}
446 % \begin{macro}{ligs}
447 % These parameters are required for the punctation glyphs.
448 % \begin{macrocode}
449 dot_size#:=38/36pt#; % size of dots
450 square_dots:=false; % should dots be square?
451 hefty:=false; % should we try hard not to be overweight?
452 ligs:=2; % level of ligatures to be included
453
454 % \end{macrocode}
455 % \end{macro}
456 % \end{macro}
457 % \end{macro}
458 % \end{macro}
459 %
460 % \begin{macro}{flare}
461 % \begin{macro}{stem-corr}
462 % \begin{macro}{curve}
463 % These parameters are required for the ampersand and question mark.
464 % \begin{macrocode}
465 flare#:=33/36pt#; % diameter of bulbs or breadth of terminals
466 stem_corr#:=1/36pt#; % small refinement of stem breadth
467 curve#:=30/36pt#; % lowercase curve breadth
468
469 % \end{macrocode}
470 % \end{macro}
471 % \end{macro}
472 % \end{macro}
473 %
474 % \begin{macro}{whole-font}
475 % We are not generating a complete font.
476 % \begin{macrocode}
477 boolean whole_font; % try generating a complete font?
478 whole_font:=false;
479
480 % \end{macrocode}
481 % \end{macro}
482 %
483 % Finally, call the driver file for the Trajan font.
484 % \begin{macrocode}
485 generate trjntitle %% switch to the driver file---Trajan title
486
487 %</up|sl>
488 % \end{macrocode}
489 %
490 %
491 % \subsection{The driver file}
492 %
493 % To a large extent the driver file is based on Alan Hoenig's
494 % \Lpack{dtitle.mf}.
495 %
496 %
497 % \begin{macrocode}
498 %<*mfd>
499 % This is TRJNTITLE.MF, adapted from my Pacioli cpctitle.mf
500 % This makes a short font.
501 % This file also contains special macros universally needed in the
502 % Trajan font but either not in the cmbase.mf file or
503 % modifications of this.
504 %
505 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
506 %% MACRO SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%
507 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
508 %
509 % \end{macrocode}
510 %
511 % \begin{macro}{makebox}
512 % This is a new version of the \Lpack{cmbase.mf} |makebox| macro.
513 % Essentially, as we are only generating an uppercase font, we don't
514 % need all the horizontals for the lowercase characters.
515 %
516 % \begin{macrocode}
517 % A new version of cmbase.mf makebox macro
518 def makebox(text rule) =
519 for y=0,half_height,cap_height,body_height,x_height,-desc_depth,-body_depth:
520 rule((l,y)t_,(r,y)t_); endfor % horizontals
521 for x=l,r: rule((x,-body_depth)t_,(x,body_height)t_); endfor % verticals
522 for x=u*(1+floor(1/u)) step u until r-1:
523 rule((x,-body_depth)t_,(x,body_height)t_); endfor % more verticals
524 if charic<>0:
525 rule((r+charic*pt,h.o_),(r+charic*pt,.5h.o_)); fi % italic correction
526 enddef;
527
528 % \end{macrocode}
529 % \end{macro}
530 %
531 % \begin{macro}{proofpcbb}
532 % The macro |proofpcbb(S, xoff, yoff)| draws crosses at the corners of
533 % Pacioli's
534 % square, and at the bottom and top midpoints, where the point |zS| is at
535 % position |(xoff,yoff)| in the square.
536 % \begin{macrocode}
537
538 % A macro to delineate Trajan's bounding square in proof mode.
539 % Point z$ is at (xoff,yoff) in the bounding square.
540 def proofpcbb(suffix $)(expr xoff, yoff) =
541 if proofing > 0:
542 x$bl = x$ - xoff; y$bl = y$ - yoff; % Bottom Left Hand Corner
543 z$br = (x$bl+cap_height, y$bl); % BRHC
544 z$tr = (x$bl+cap_height, y$bl+cap_height); % TRHC
545 z$tl = (x$bl, y$bl+cap_height); % TLHC
546 z$bc = 1/2[z$bl,z$br]; z$tc = 1/2[z$tl,z$tr]; % horizontal mid points
547 pair hc, vc;
548 hc = (2u,0); vc = (0,2u);
549 pickup pensquare scaled 2;
550 for s = z$bl, z$br, z$tr, z$tl, z$bc, z$tc:
551 draw s-hc--s+hc;
552 draw s-vc--s+vc;
553 endfor
554 fi
555 enddef;
556
557 % \end{macrocode}
558 % \end{macro}
559 %
560 %
561 % \begin{macro}{cm-arm}
562 % \begin{macro}{arm}
563 % Hoenig's modification to Knuth's |arm| macro.
564 % \begin{macrocode}
565
566 let cm_arm=arm;
567
568 vardef arm(suffix $,$$,@)(expr darkness, armjut) = % arm from |z$| to |z$$|
569 numeric vjut_; vjut_= abs(bot y$l-bot y$$);
570 x@0=good.x(x$$r-armjut); y@0=y$r;
571 if serifs: y@1=y$l; z@1=z$$l+whatever*(z$$r-z@0);
572 if x$$>=x$: x@2=x@1 - vjut_; else: x@2=x@1+vjut_; fi y@2=y$l;
573 filldraw z$$l{z@1-z$$l}...darkness[z@1,.5[z@2,z$$l]]{z@2-z$$l}...
574 z@2if x$$>=x$: {left} else: {right} fi
575 ---z$l--z$r--z@0--z$$r..cycle; % arm and beak
576 else: filldraw z$l--z$r--z@0--z$$r--cycle; fi % sans-serif arm
577 penlabels(@0,@1,@2); enddef;
578
579 % \end{macrocode}
580 % \end{macro}
581 % \end{macro}
582 %
583 % \begin{macro}{foot}
584 % A macro to draw the bottom arm of the E, L and Z characters.
585 % |$|, |$l| and |$r| are points at LH end of the foot, with |$r| at
586 % the bottom. |$$|, |$$l| and
587 % |$$r| are points at the tip. |armjut| is the horizontal distance between
588 % the tip and the flat part of the foot. |@| is a letter (not used elsewhere
589 % as a point suffix).
590 % \begin{macrocode}
591
592 vardef foot(suffix $, $$, @)(expr darkness, armjut) = % bottom arm on E and L
593 numeric vjut_; vjut_= abs(bot y$-bot y$$);
594 x@0=good.x(x$$r-armjut); y@0=y$r;
595 if serifs:
596 y@1=y$l; z@1=z$$l+whatever*(z$$r-z@0);
597 x@2=x@1-vjut_; y@2=y$l;
598 filldraw z$$l{z@1-z$$l}...darkness[z@1,.5[z@2,z$$l] ]...z@2
599 ---z$l--z$r--z@0--z$$r--cycle; % arm and beak
600 else:
601 filldraw z$l--z$r--(x$$r,y$r)--(x$$r,y$l)--cycle;
602 fi
603 penlabels(@0,@1,@2); enddef;
604
605 % \end{macrocode}
606 % \end{macro}
607 %
608 % \begin{macro}{pulled-super-arc}
609 % \begin{macro}{pulled-arc}
610 % Hoenig's rewrite of Knuth's macros.
611 % \begin{macrocode}
612
613 vardef pulled_super_arc.l(suffix $, $$)(expr darkness)=
614 pair corner;
615 if y$=y$r: corner=(x$l, y$$l);
616 else: corner=(x$$l,y$l); fi
617 z$l{corner-z$l}...(darkness)[corner, .5[z$l, z$$l]]{z$$l-z$l}
618 ...{z$$l-corner}z$$l enddef;
619
620 vardef pulled_super_arc.r(suffix $, $$)(expr darkness)=
621 pair corner;
622 if y$=y$r: corner=(x$r,y$$r);
623 else: corner=(x$$r, y$r); fi
624 z$r{corner-z$r}...(darkness)[corner, .5[z$r, z$$r]]{z$$r-z$r}
625 ...z$$r{z$$r-corner} enddef;
626
627 vardef pulled_arc@#(suffix $, $$)=
628 pulled_super_arc@#($,$$)(eta) enddef;
629
630 % \end{macrocode}
631 % \end{macro}
632 % \end{macro}
633 %
634 % \begin{macro}{cm-font-setup}
635 % \begin{macro}{slim-font-setup}
636 % The basic font set up.
637 % \begin{macrocode}
638
639 let cm_font_setup=font_setup; % Knuth's original font_setup
640
641 def slim_font_setup = % trimmed font_setup for use with Trajan caps only
642 if monospace: let adjust_fit=mono_adjust_fit;
643 def mfudged=fudged enddef;
644 mono_charic#:=body_height#*slant;
645 if mono_charic#<0: mono_charic#:=0; fi
646 mono_charwd#:=9u#; define_whole_pixels(mono_charwd);
647 else: let adjust_fit=normal_adjust_fit;
648 def mfudged= enddef; fi
649 define_pixels(u,width_adj,serif_fit,cap_serif_fit,jut,cap_jut,bar_height,
650 dish,bracket,beak_jut,apex_o,apex_corr);
651 define_whole_pixels(letter_fit,fine,crisp,tiny);
652 define_whole_vertical_pixels(body_height,asc_height,
653 cap_height,x_height,comma_depth,desc_depth);
654 define_whole_blacker_pixels(hair,stem,cap_stem);
655 define_whole_vertical_blacker_pixels(vair,dslab,slab);
656 if slab<eps: slab:=eps fi;
657 define_corrected_pixels(o);
658 forsuffixes $=hair,stem,cap_stem:
659 fudged$.#:=fudge*$.#; fudged$:=hround(fudged$.#*hppp+blacker);
660 forever: exitif fudged$>.9fudge*$; fudged$:=fudged$+1; endfor endfor
661 rule_thickness:=ceiling(rule_thickness#*hppp);
662 heavy_rule_thickness:=ceiling(3rule_thickness#*hppp);
663 oo:=vround(.5o#*hppp*o_correction)+eps;
664 apex_oo:=vround(.5apex_o#*hppp*o_correction)+eps;
665 lowres_fix(stem) 1.3;
666 ess:=(ess#/stem#)*stem; cap_ess:=(cap_ess#/cap_stem#)*cap_stem;
667 dw:=(curve#-stem#)*hppp; bold:=curve#*hppp+blacker;
668 dh#:=.6designsize;
669 more_super:=max(superness,sqrt .77superness);
670 hein_super:=max(superness,sqrt .81225258superness); % that's $2^{-.3}$
671 clear_pen_memory;
672 if fine=0: fine:=1; fi
673 forsuffixes $=fine,crisp,tiny:
674 %%% fine $ %%%% temporary formatting convention for MFT
675 if $>fudged.hair: $:=fudged.hair; fi
676 $.breadth:=$;
677 pickup if $=0: nullpen else: pencircle scaled $; $:=$-eps fi;
678 $.nib:=savepen; breadth_[$.nib]:=$;
679 forsuffixes $$=lft,rt,top,bot: shiftdef($.$$,$$ 0); endfor endfor
680 %%% @ $ %%%% restore ordinary formatting for $
681 min_Vround:=max(fine.breadth,crisp.breadth,tiny.breadth);
682 if min_Vround<vround min_Vround: min_Vround:=vround min_Vround; fi
683 pickup pencircle scaled rule_thickness; rule.nib:=savepen;
684 currenttransform:=identity slanted slant
685 yscaled aspect_ratio scaled granularity;
686 if currenttransform=identity: let t_=relax
687 else: def t_ = transformed currenttransform enddef fi;
688 numeric paren_depth#; .5[body_height#,-paren_depth#]=math_axis#;
689 numeric asc_depth#; .5[asc_height#,-asc_depth#]=math_axis#;
690 body_depth:=desc_depth+body_height-asc_height;
691 shrink_fit:=1+hround(2letter_fit#*hppp)-2letter_fit;
692 if not string mode: if mode<=smoke: shrink_fit:=0; fi fi
693 enddef;
694
695 % \end{macrocode}
696 % \end{macro}
697 % \end{macro}
698 %
699 % \begin{macro}{trajan-font-setup}
700 % This macro contains additional set up for the Trajan fonts.
701 % \begin{macrocode}
702
703 def trajan_font_setup= % contains special stuff for Trajan fonts
704 define_pixels(side,thick,thin,medium,half_height);
705 define_pixels(dot_size,math_axis,flare,stem_corr,curve);
706 if not known dslab#: dslab=eps; fi
707 enddef;
708
709 % \end{macrocode}
710 % \end{macro}
711 %
712 %
713 % \begin{macrocode}
714
715 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
716 %% END OF MACROS %%%%%%%%%%%%%%%%%%%%%%%%%%
717 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
718
719 % \end{macrocode}
720 %
721 % Set the mode and font setup.
722 % \begin{macrocode}
723
724 font_coding_scheme:="ASCII caps and punctuation";
725
726 mode_setup;
727
728 trajan_font_setup;
729 if whole_font: font_setup; %slab:=eps;
730 define_whole_vertical_blacker_pixels(dslab,slab);
731 else: slim_font_setup; fi
732
733 % \end{macrocode}
734 %
735 %
736 % We generate Trajan's uppercase letters, together with (matching)
737 % Computer Modern Roman punctuation and some analphabetics.
738 % \begin{macrocode}
739
740 input trjnromanu; % Trajan upper case (majuscules)
741 input trjnpunct; % punctuation
742 input trjnlig; % the several dashes
743 input trjnromanp % ampersand and ?mark
744
745 % \end{macrocode}
746 %
747 % Finally, do the uppercase ligtable.
748 %
749 % \begin{macrocode}
750
751 font_slant slant; font_x_height x_height#;
752 if monospace: font_normal_space 9u#; % no stretching or shrinking
753 font_quad 18u#;
754 font_extra_space 9u#;
755 else: font_normal_space 6u#+2letter_fit#;
756 font_normal_stretch 3u#; font_normal_shrink 2u#;
757 font_quad 18u#+4letter_fit#;
758 font_extra_space 2u#;
759 k#:=-.5u#; kk#:=-1.5u#; kkk#:=-2u#; % three degrees of kerning
760 ligtable "P": "T": "Y": "A" kern kk#;
761 ligtable "F": "V": "W": "A" kern if serifs: kkk# else: kk#fi,
762 "K": "X": "O" kern k#, "C" kern k#, "G" kern k#, "Q" kern k#;
763 ligtable "O": "D": "X" kern k#, "W" kern k#, "A" kern k#,
764 "V" kern k#, "Y" kern k#;
765 ligtable "A": if serifs: "R": fi
766 "C" kern k#, "O" kern k#, "G" kern k#, "U" kern k#, "Q" kern k#,
767 "L": "T" kern kk#, "Y" kern kkk#, "V" kern kk#, "W" kern kkk#;
768 ligtable "I": "I" kern -k#; fi % Richard III
769
770 bye.
771
772 %</mfd>
773 % \end{macrocode}
774 %
775 % \subsection{The majuscule code}
776 %
777 % The following code is based on the code for the Pacioli
778 % characters. The geometry, of course, is different for Trajan's characters.
779 %
780 % \begin{macrocode}
781 %<*maj>
782 % TRJNROMANU.MF Program files for formal Computer Trajan fonts.
783 %
784
785 def checkthin=
786 if thin-currentbreadth<eps: thin:=currentbreadth+eps; fi;
787 if thin-currentbreadth<eps: thin:=currentbreadth+eps; fi enddef;
788
789 pair xeps, yeps; xeps=(eps,0); yeps=(0,eps);
790 numeric tail_corr; tail_corr=1/8;
791 numeric cap_jut_factor; cap_jut_factor=8/7;
792
793 numeric pcshiftx#; % x value of LHS of Trajan box wrt origin of char box
794 define_pixels(pcshiftx);
795
796 % \end{macrocode}
797 %
798 % \begin{macro}{A}
799 % The letter A. The right and left legs are |thick| and |medium|
800 % respectively, while the cross-bar is |medium|. With serifs, it just fits
801 % inside the square. The apex is at the top of the square on the centerline
802 % and the top of the bar is |medium| below the half-height.
803 % \begin{macrocode}
804
805 cmchar "Trajan's letter A";
806 beginchar("A", 2u#+side#, cap_height#, 0);
807 adjust_fit(cap_serif_fit#, cap_serif_fit#);
808 pcshiftx := u;
809 y100 = h/2; x100 = pcshiftx+y100; % center point
810 top y3= top y2=h;
811 % for left leg
812 numeric alpha[]; alpha1=(h++(0.5h - cap_jut))/(h);
813 penpos1(alpha1*medium,0); penpos2(alpha1*medium,0);
814 % and for the right leg
815 alpha2=(h++(0.5h - cap_jut))/(h);
816 penpos3(alpha2*thick,0); penpos4(alpha2*thick,0);
817 lft x1l=pcshiftx+cap_jut; rt x4r=x1l+h-2cap_jut;
818 bot y1=bot y4=0;
819 x3r=x2l = 0.5h + pcshiftx;
820 z0=whatever[z1r,z2r]=whatever[z3l,z4l];
821 % draw the legs
822 fill z0--diag_end(0,4l,1,1,4r,3r)--z3r..z2l--diag_end(2l,1l,1,1,1r,0)
823 --z0..cycle; % diagonals
824 % now for the bar
825 top y5r=top y6r=hround(h/2 - medium);
826 top y5r-bot y5l=top y6r-bot y6l=medium;
827 penpos5(whatever, angle(z2-z1)); penpos6(whatever, angle(z3-z4));
828 z5=whatever[z1,z2]; z6=whatever[z3,z4];
829 penstroke z5e--z6e; % bar line
830 if serifs:
831 bracket:=10/7 bracket; cap_jut:=cap_jut_factor*cap_jut;
832 pickup tiny.nib; numeric jut_factor;
833 jut_factor:=3/4;
834 serif(1,2,a,sadj*serif_darkness,-cap_jut);
835 serif(4,3,d,sadj*serif_darkness, cap_jut);
836 bracket:=jut_factor*bracket;
837 serif(1,2,b,sadj*serif_darkness,jut_factor*cap_jut);
838 serif(4,3,c,sadj*serif_darkness,-jut_factor*cap_jut);
839 fi
840 proofpcbb(100, y100, y100);
841 penlabels(0,1,2,3,4,5,6,100); endchar;
842
843 % \end{macrocode}
844 % \end{macro}
845 %
846 % \begin{macro}{B}
847 % The letter B. At the original size, with serifs it fills 60\% of
848 % the square width. I have increased the width for the printing size otherwise
849 % the bowls appear too dark.
850 % \begin{macrocode}
851
852 cmchar "Trajan's letter B";
853 beginchar("B",u#+0.625side#+o#, cap_height#, 0);
854 adjust_fit(cap_serif_fit#,0); pickup tiny.nib;
855 pcshiftx := 0.5u;
856 y100=h/2; x100=pcshiftx+y100; % square center
857 numeric alpha; alpha := 0.75;
858 pos1(thick,0); pos2(thick,0); lft x1l=lft x2l=pcshiftx+cap_jut;
859 bot y2=0; top y1=h;
860 filldraw stroke z1e--z2e; % vertical stem
861 % prepare for the bottom bowl
862 pos3(thin,-90); pos5(thick,0); pos7(thin,90);
863 z3r=z2;
864 y4l=y3l; x4l=x3l+2thick; y4r=y3r; x4r=x4l;
865 z4=0.5[z4l,z4r];
866 y7l=y100+thin; x7=x1;
867 y6l=y7l; x6l=x4l-0.5thick; top y6r- bot y6l= thin; x6r=x6l;
868 z6=0.5[z6l,z6r];
869 rt x5r=w-pcshiftx; % bottom bowl takes max space
870 y5=0.5[y7l,y2];
871 % draw the bottom bowl
872 filldraw stroke z3e--z4e..pulled_arc.e(4,5)&pulled_arc.e(5,6)..z6e--z7e;
873 % prepare for the top bowl
874 pos7'(thin,-90); pos8(alpha*thick,0); pos10(thin,90);
875 z7'=z7; z6'=z6;
876 x6'r=x6r; x6'l=x6l; y6'r=y7'r; y6'l=y7'l;
877 z10r=z1;
878 x9r=x6'r; x9l=x6'l; y9r=y10r; top y9r-bot y9l=thin;
879 z9=0.5[z9r,z9l];
880 rt x8r=x100+o; y8=0.5[y7l,y1];
881 % draw the top bowl
882 filldraw stroke z7'e--z6'e..pulled_arc.e(6',8)&pulled_arc.e(8,9)..z9e--z10e;
883
884 if serifs:
885 serif(1,2,a, sadj*serif_darkness,-cap_jut); % top LL
886 serif(2,1,b, sadj*serif_darkness,-cap_jut); % bottom LL
887 numeric tempa_, tempb_; tempa_=slab; tempb_=bracket;
888 slab:=thin; bracket:=cap_jut;
889 serif(2,1,c,serif_darkness,cap_jut); % bottom LR
890 slab:=tempa_; bracket:=tempb_;
891 fi
892 proofpcbb(100, y100, y100);
893 penlabels(1,2,3,4,5,6,7,8,9,10,11,12,100);
894 penlabels(6',7'); endchar;
895
896 % \end{macrocode}
897 % \end{macro}
898 %
899 % \begin{macro}{C}
900 % The letter C. The thicness of the bowl varies between |thick| and |thin|.
901 % It is slightly narrower than a full square, by a distance |thick|.
902 % \begin{macrocode}
903
904 cmchar "Trajan's letter C";
905 beginchar("C",2u#+side#-thick#, cap_height#, 0);
906 adjust_fit(0, 0); pickup tiny.nib;
907 pcshiftx := u;
908 y100 = h/2; x100 = pcshiftx + y100; % center point
909 numeric alpha; alpha=w-u-thick;
910 numeric beta; beta=pcshiftx+(side-thick); % rightmost Xcoord of letter
911 pos2(thin, 90); x2=x100; top y2r=h+o; % topmost point
912 pos3(thick,180); lft z3r=(pcshiftx,y100); % leftmost point
913 pos4(thin, 270); x4=x2+thick; bot y4r=-o; % bottommost point
914 pos0(thick,0); lft z0l=(w+thick-2pcshiftx,h/2);
915 path p, p', line.u, line.b; line.u=(alpha,1.5h)--(alpha,h/2);
916 line.b=(.5[alpha,x0],0)--(.5[alpha,x0],h/2);
917 p=pulled_arc.r(0,2)&pulled_arc.r(2,3)&pulled_arc.r(3,4)
918 &pulled_arc.r(4,0)&cycle;
919 p'=pulled_arc.l(0,2)&pulled_arc.l(2,3)&pulled_arc.l(3,4)
920 &pulled_arc.l(4,0)&cycle;
921 z'1l=line.u intersectionpoint p'; z'1r=line.u intersectionpoint p;
922 z1r = (beta, h-thin); z1l = (x1r, y1r-1.5thick);
923 z1 = 0.5[z1r, z1l];
924 z'5l=line.b intersectionpoint p'; z'5r=line.b intersectionpoint p;
925 z5l = (x1, 2thick); z5r = (x1-thin, medium); z5 = 0.5[z5l,z5r];
926 % adjust to have a better opening
927 numeric slope_factor; slope_factor=3/4;
928 filldraw
929 z1r{-1,slope_factor}...{left}z2r..pulled_arc.r(2,3)&
930 pulled_arc.r(3,4)..{right}z4r..tension 0.9..z5r--
931 reverse
932 (z1l{z2-z4}..{left}z2l..pulled_arc.l(2,3)&pulled_arc.l(3,4)..{right}z4l..z5l)
933 ..(z1l+(eps,0))--(z1r+(eps,0))..cycle;
934 proofpcbb(100, y100, y100);
935 penlabels(0,1,2,3,4,5,100); endchar;
936
937 % \end{macrocode}
938 % \end{macro}
939 %
940 % \begin{macro}{D}
941 % The letter D. With serifs, it fills the square.
942 % \begin{macrocode}
943
944 cmchar "Trajan's letter D";
945 beginchar("D", u#+side#, cap_height#, 0);
946 adjust_fit(cap_serif_fit#,0);
947 pcshiftx:=0.5u;
948 y100=h/2; x100=pcshiftx+y100; % square center
949 pickup tiny.nib; pos1(thick,0); pos2(thick,0);
950 lft x1l=.5u+cap_jut; x2=x1; bot y2=0; top y1=h;
951 filldraw stroke z1e--z2e; % stem
952 pos3(thin, 90); pos5(thick, 0); pos7(5/4thin, -90);
953 x3=x7=x1; top y3r=h; bot y7r=0;
954 y5=good.y h/2;
955 rt x5r=w-pcshiftx;
956 x4r=x6r=hround(w/2); top y4r=h; bot y6r=0;
957 bot y4l=vround(h-thin); top y6l=vround 5/4thin;
958 x4l=x6l; 2(lft x5l-x4l)=y4l-y6l;
959 z4=.5[z4l, z4r]; z6=.5[z6l, z6r];
960 filldraw stroke z3e{right}...pulled_super_arc.e(4,5,eta)&
961 pulled_super_arc.e(5,6,eta)...{left}z7e; % lobe
962 if serifs:
963 serif(1, 2, a, serif_darkness, -cap_jut);
964 serif(2, 1, b, serif_darkness, -cap_jut);
965 numeric temp_; temp_=slab; slab:=5/4thin;
966 serif(2, 1, c, serif_darkness, cap_jut);
967 slab:=temp_;
968 fi
969 proofpcbb(100, y100, y100);
970 penlabels(1,2,3,4,5,6,7,100); endchar;
971
972 % \end{macrocode}
973 % \end{macro}
974 %
975 % \begin{macro}{E}
976 % The letter E. Including serifs it is half the width of the square,
977 % but the bottom arm is slighty longer by the |medium| amount.
978 % \begin{macrocode}
979
980 cmchar "Trajan's letter E";
981 beginchar("E", u#+0.5side#+medium#, cap_height#,0);
982 adjust_fit(cap_serif_fit#,0);
983 pcshiftx := 0.5u;
984 y100=h/2; x100=pcshiftx+y100; % center point
985 pickup tiny.nib;
986 pos1(thick,0); pos2(thick,0);
987 lft x1l=lft x2l=pcshiftx+cap_jut; top y1=h; bot y2=0;
988 filldraw stroke z1e--z2e; % stem
989 pickup crisp.nib; % prepare for arms and serifs
990 pos3(medium,90); pos4(dslab,0);
991 x1=x3; top y3r=h; rt x4l=x100;
992 bot y4=vround(h-vstretch*thick);
993 arm(3,4,d,serif_darkness,0); % top arm and beak
994 pos5(thin,-90); pos0(thin,90); pos6(dslab,0); pos7(dslab,0);
995 x5=x0=x1; y5=y0=hround(h/2); rt x6r=rt x7r= rt x4l - medium;
996 top y6-bot y7= thin+2thick; y5=.5[y6,y7];
997 arm(5,6,e,sadj*eta,0); arm(0,7,f,sadj*eta,0); % middle arm and beaks
998 % now do the bottom arm
999 pos8(medium,-90); pos9(dslab,0); x8=x2; bot y8r=0;
1000 rt x9r=hround(x4l+medium);
1001 y9=1.5thick;
1002 foot(8,9,g,serif_darkness,medium); % lower arm
1003 if serifs:
1004 serif(1,2,a,sadj*serif_darkness,-cap_jut);
1005 serif(2,1,b,sadj*serif_darkness,-cap_jut);
1006 temp_:=slab; slab:=medium; tmp_:=bracket; bracket:=cap_jut+medium;
1007 serif(2,1,c,serif_darkness,cap_jut);
1008 slab:=temp_; bracket:=tmp_;
1009 fi
1010 proofpcbb(100, y100, y100);
1011 penlabels(0,1,2,3,4,5,6,7,8,9,100); endchar; % end of "E"
1012
1013 % \end{macrocode}
1014 % \end{macro}
1015 %
1016 % \begin{macro}{F}
1017 % The letter F. This is an E without the bottom arm.
1018 % \begin{macrocode}
1019
1020 cmchar "Trajan's letter F";
1021 beginchar("F", u#+0.5side#, cap_height#,0);
1022 adjust_fit(cap_serif_fit#,0);
1023 pcshiftx := 0.5u;
1024 y100=h/2; x100=pcshiftx+y100; % square center
1025 pickup tiny.nib;
1026 pos1(thick,0); pos2(thick,0);
1027 lft x1l=lft x2l=pcshiftx+cap_jut; top y1=h; bot y2=0;
1028 filldraw stroke z1e--z2e; % stem
1029 pickup crisp.nib; % prepare for arms and serifs
1030 pos3(medium,90); pos4(dslab,0);
1031 x1=x3; top y3r=h; rt x4l= x100;
1032 bot y4=vround(h-if monospace: 2 fi vstretch*thick);
1033 arm(3,4,d,serif_darkness,0); % top arm and beak
1034 pos5(thin,-90); pos0(thin,90); pos6(dslab,0); pos7(dslab,0);
1035 x5=x0=x1; y5=y0=hround(h/2); rt x6r=rt x7r= rt x4l-medium;
1036 top y6-bot y7= thin+2thick; y5=.5[y6,y7];
1037 arm(5,6,e,eta,0); arm(0,7,f,eta,0); % middle arm and beaks
1038 if serifs:
1039 serif(1,2,a,sadj*serif_darkness,-cap_jut);
1040 serif(2,1,b,sadj*serif_darkness,-cap_jut);
1041 serif(2,1,c,serif_darkness, cap_jut);
1042 fi
1043 proofpcbb(100, y100,y100);
1044 penlabels(0,1,2,3,4,5,6,7,100); endchar; % end of "F"
1045
1046 % \end{macrocode}
1047 % \end{macro}
1048 %
1049 %
1050 % \begin{macro}{G}
1051 % The letter G. This is based on the C and has optical adjustments.
1052 % \begin{macrocode}
1053
1054 cmchar "Trajan's letter G";
1055 beginchar("G",2u#+side#-thick#+cap_jut#, cap_height#, 0);
1056 adjust_fit(0, cap_serif_fit#);
1057 pcshiftx := u;
1058 y100=h/2; x100=pcshiftx+y100; % square center
1059 pickup tiny.nib;
1060 % This code is almost identical to that for the letter C.
1061 numeric alpha; alpha=w-pcshiftx-thick-cap_jut;
1062 numeric beta; beta= pcshiftx+side-thick; % rightmost Xcoord of letter (w/o serifs)
1063 pos2(thin, 90); x2=x100; top y2r=h+o; % topmost pen position
1064 pos3(thick,180); lft z3r=(pcshiftx,y100); % leftmost point
1065 pos4(thin, 270); x4=x2+thick; bot y4r=-o; % bottommost point
1066 pos0(thick,0); lft z0l=(x100+0.5side-thick,y100);
1067 path p, p', line.u, line.b; line.u=(alpha,1.5h)--(alpha,h/2);
1068 line.b=(.5[alpha,x0],0)--(.5[alpha,x0],h/2);
1069 p=pulled_arc.r(0,2)&pulled_arc.r(2,3)&pulled_arc.r(3,4)
1070 &pulled_arc.r(4,0)&cycle;
1071 p'=pulled_arc.l(0,2)&pulled_arc.l(2,3)&pulled_arc.l(3,4)
1072 &pulled_arc.l(4,0)&cycle;
1073 z'1l=line.u intersectionpoint p'; z'1r=line.u intersectionpoint p;
1074 z1r=(beta, h-thin); z1l=(x1r,y1r-1.5thick);
1075 z1=0.5[z1r,z1l];
1076 z'5l=line.b intersectionpoint p'; z'5r=line.b intersectionpoint p;
1077 z5l = (x1+0.1thin, 2thick); z5r=(x5l,medium);
1078 z5=0.5[z5r,z5l];
1079 % readjust to have a better opening in CDTT
1080 numeric slope_factor; slope_factor=3/4;
1081 % Addtional G work (preceding program is similar to that for letter C)!
1082 path p,p',line.o, line.i;
1083 p=z1r{-1,slope_factor}..{left}pulled_arc.r(2,3)&
1084 pulled_arc.r(3,4){right}..tension 0.9..z5r;
1085 p'= reverse
1086 (z1l{z2-z4}..{left}z2l..pulled_arc.l(2,3)&pulled_arc.l(3,4)..{right}z4l..z5l);
1087 pos7(thick,0);
1088 x7r=x1; y7r=7/2thick;
1089 numeric counter; counter=0;
1090 forever:
1091 counter:=counter+1;
1092 line.o:=z7r--(x7r,-2o); line.i:=(z7r-(thick,0))--(x7r-thick,-2o);
1093 numeric t[],tt[];
1094 (t1,tt1)=p intersectiontimes line.o; (t2,tt2)=p' intersectiontimes line.i;
1095 exitif t1*t2>0; forsuffixes $$=l, r: x7$$:=x7$$-.1u; endfor
1096 x7:=x7-.1u; endfor
1097 x6r=x7r; x6l=x7l; bot y6r=ypart point t1 of p; bot y6l=ypart point t2 of p';
1098 z6=.5[z6r,z6l];
1099 p:= subpath(0,t1) of p..(z6r-xeps+yeps)--(z6l+xeps+yeps)..
1100 subpath(t2,infinity) of p'..(z1l+xeps)--cycle;
1101 filldraw p;
1102 filldraw z6l--z7l--z7r--z6r--cycle;
1103 if serifs:
1104 serif(7,6,a,sadj*serif_darkness,-cap_jut);
1105 serif(7,6,b,sadj*serif_darkness, cap_jut);
1106 fi
1107 proofpcbb(100, y100, y100);
1108 penlabels(0,1,2,3,4,5,6,7,100); endchar;
1109
1110 % \end{macrocode}
1111 % \end{macro}
1112 %
1113 % \begin{macro}{H}
1114 % The letter H. With serifs, this fills the square. The two legs are
1115 % |thick|. The cross-bar is |medium|, like the A, and the bottom of the
1116 % bar is at the half-height;
1117 % \begin{macrocode}
1118
1119 cmchar "Trajan's letter H";
1120 beginchar("H", u#+side#, cap_height#,0);
1121 adjust_fit(cap_serif_fit#, cap_serif_fit#);
1122 pcshiftx := u/2;
1123 y100 = h/2; x100 = pcshiftx + y100; % center point
1124 pickup tiny.nib;
1125 forsuffixes t=1,2,3,4: pos.t(thick,0); endfor
1126 lft x1l=lft x2l=pcshiftx+cap_jut; bot y2=0; top y1=h;
1127 filldraw stroke z1e--z2e; % left vertical stem
1128 rt x3r= rt x4r=x1l+h-2cap_jut; y3=y1; y4=y2;
1129 filldraw stroke z3e--z4e; % right vertical stem
1130 pos5(medium, 90); pos6(medium,90);
1131 x5=.5[x1r,x1l]; x6=.5[x3l,x3r]; bot y5r=bot y6r=h/2;
1132 filldraw stroke z5e--z6e; % horizontal crossbar
1133 if serifs:
1134 serif(1,2,a,sadj*serif_darkness,-cap_jut); % top LL
1135 serif(1,2,b,sadj*serif_darkness,cap_jut); % top LR
1136 serif(2,1,c,sadj*serif_darkness,-cap_jut); % bottom LL
1137 serif(2,1,d,sadj*serif_darkness,cap_jut); % bottom LR
1138 serif(3,4,e,sadj*serif_darkness,-cap_jut); % top RL
1139 serif(3,4,f,sadj*serif_darkness,cap_jut); % top RR
1140 serif(4,3,g,sadj*serif_darkness,-cap_jut); % bottom RL
1141 serif(4,3,h,sadj*serif_darkness,cap_jut); % bottom RR
1142 fi
1143 proofpcbb(100, y100, y100);
1144 labels(1,2,3,4,5,6,100); endchar;
1145
1146 % \end{macrocode}
1147 % \end{macro}
1148 %
1149 % \begin{macro}{I}
1150 % The letter I.
1151 % \begin{macrocode}
1152
1153 cmchar "Trajan's letter I";
1154 beginchar("I", u#+2cap_jut#+thick#, cap_height#,0);
1155 adjust_fit(cap_serif_fit#, cap_serif_fit#);
1156 pcshiftx := u/2;
1157 y100 = h/2; x100 = pcshiftx + cap_jut + 0.5cap_stem; % center point
1158 pickup tiny.nib; checkthin; pos1(cap_stem,0); pos2(cap_stem,0);
1159 x1=x2=hround(w/2); top y1=h; bot y2=0;
1160 filldraw stroke z1e--z2e; % vertical stem
1161 if serifs:
1162 serif(1, 2, a, sadj*serif_darkness, -cap_jut);
1163 serif(1, 2, b, sadj*serif_darkness, cap_jut); % top lft,rt
1164 serif(2, 1, c, sadj*serif_darkness, -cap_jut);
1165 serif(2, 1, d, sadj*serif_darkness, cap_jut); % bot lft,rt
1166 fi
1167 proofpcbb(100, y100, y100);
1168 penlabels(1, 2, 100); endchar;
1169
1170 % \end{macrocode}
1171 % \end{macro}
1172 %
1173 % \begin{macro}{J}
1174 % The letter J. The Romans didn't use J, but Tschichold designed a matching
1175 % J, which I use here. The J extends 2*thick below the baseline.
1176 % \begin{macrocode}
1177
1178 cmchar "Trajan's letter J";
1179 beginchar("J",u#+2.5thick#+cap_jut#, cap_height#, 2thick#);
1180 adjust_fit(0, cap_serif_fit#); pickup tiny.nib;
1181 pcshiftx := u/2;
1182 y100 = h/2; x100 = pcshiftx + 2.5thick; % center point
1183 pos1(thick,0); pos2(thick,0); pos3(0.5thin, -90);
1184 top y1=h; rt x1r=w-pcshiftx-cap_jut; x2=x1; bot y2=0;
1185 lft x3=x1-2thick; bot y3r=-d;
1186 filldraw stroke z1e--z2e{down}..{left}z3e;
1187 if serifs:
1188 serif(1,2,a,sadj*serif_darkness,-cap_jut);
1189 serif(1,2,b,sadj*serif_darkness,cap_jut);
1190 fi
1191 proofpcbb(100, y100, y100);
1192 penlabels(1,2,3,100); endchar;
1193
1194 % \end{macrocode}
1195 % \end{macro}
1196 %
1197 % \begin{macro}{K}
1198 % The letter K. With serifs its width is 7/8 square.
1199 % \begin{macrocode}
1200
1201 cmchar "Trajan's letter K";
1202 beginchar("K", u#+0.875side#, cap_height#,0);
1203 adjust_fit(cap_serif_fit#,0); pickup tiny.nib;
1204 pcshiftx := 0.5u;
1205 y100=h/2; x100=pcshiftx+y100; % square center
1206 % the stem
1207 pos1(thick,0); pos2(thick,0);
1208 lft x1l=lft x2l=pcshiftx+cap_jut;
1209 top y1=h; bot y2=0;
1210 filldraw stroke z1e--z2e; % left stem
1211 numeric alpha; alpha=(h++(h/2))/(h);
1212 % top arm
1213 pos3(alpha*medium,0); pos4(alpha*medium,0);
1214 x4l=x1r; y4=y100;
1215 x3l=x100+medium; y3=h;
1216 % bottom arm
1217 pos5(alpha*thick,0); pos6(alpha*thick,0);
1218 z5l=z4l;
1219 x6l=x3l+cap_jut; y6=0;
1220 z0=whatever[z6r,z5r]=whatever[z3r,z4r]; % notch point
1221 % draw the arms
1222 filldraw z4l--z3l--z3r--z0--z6r--z6l--cycle;
1223 if serifs:
1224 serif(1,2,a,sadj*serif_darkness,-cap_jut);
1225 serif(1,2,b,sadj*serif_darkness,cap_jut);
1226 serif(2,1,c,sadj*serif_darkness,-cap_jut);
1227 serif(2,1,d,sadj*serif_darkness,cap_jut);
1228 numeric old_jut, old_brack; old_jut=cap_jut; old_brack=bracket;
1229 % serifs on top leg
1230 bracket:=.5old_brack;cap_jut:=.5old_jut;
1231 serif(3,4,e,serif_darkness,-cap_jut);
1232 bracket:=2old_brack; cap_jut:=2old_jut;
1233 serif(3,4,f,.6serif_darkness, 0.5cap_jut);
1234 % serifs on bottom leg
1235 bracket:=.5old_brack;cap_jut:=.5old_jut;
1236 serif(6,5,g,serif_darkness,-cap_jut);
1237 bracket:=2old_brack; cap_jut:=2old_jut;
1238 serif(6,5,h,.6serif_darkness, 0.5cap_jut);
1239 cap_jut:=old_jut; bracket:=old_brack;
1240 fi
1241 proofpcbb(100, y100, y100);
1242 penlabels(0,1,2,3,4,5,6,100); endchar;
1243
1244 % \end{macrocode}
1245 % \end{macro}
1246 %
1247 % \begin{macro}{L}
1248 % The letter L. This is identical to the left leg and
1249 % bottom arm of Trajan's E. It extends |medium| beyond half the square.
1250 % \begin{macrocode}
1251
1252 cmchar "Trajan's letter L";
1253 beginchar("L", u#+0.5side#+medium#, cap_height#,0);
1254 adjust_fit(cap_serif_fit#,0);
1255 pcshiftx := 0.5u;
1256 y100=h/2; x100=pcshiftx+y100; % square center
1257 pickup tiny.nib;
1258 pos1(thick,0); pos2(thick,0);
1259 lft x1l=lft x2l=pcshiftx+cap_jut; top y1=h; bot y2=0;
1260 filldraw stroke z1e--z2e; % stem
1261 pickup crisp.nib; % prepare for lower arm
1262 pos8(medium,-90); pos9(dslab,0); x8=x2; bot y8r=0;
1263 rt x9r=hround(x100+medium);
1264 y9=1.5thick;
1265 foot(8,9,g,serif_darkness,medium); % lower arm
1266 if serifs:
1267 serif(1,2,a,sadj*serif_darkness,-cap_jut);
1268 serif(2,1,b,sadj*serif_darkness,-cap_jut);
1269 serif(1,2,d,serif_darkness,cap_jut);
1270 temp_:=slab; slab:=medium; tmp_:=bracket; bracket:=thick+medium;
1271 serif(2,1,c,serif_darkness,thick);
1272 slab:=temp_; bracket:=tmp_;
1273 fi
1274 proofpcbb(100, y100, y100);
1275 penlabels(0,1,2,3,4,5,6,7,8,9,100); endchar; % end of "L"
1276
1277 % \end{macrocode}
1278 % \end{macro}
1279 %
1280 % \begin{macro}{M}
1281 % The letter M. This has slightly sloping right and left legs. The outside
1282 % serifs at the base are outside the square.
1283 % \begin{macrocode}
1284
1285 cmchar"Trajan's letter M";
1286 beginchar("M", u#+2cap_jut#+side#, cap_height#, 0);
1287 adjust_fit(cap_serif_fit#, cap_serif_fit#); pickup tiny.nib;
1288 pcshiftx := 0.5u+cap_jut;
1289 y100=h/2; x100=pcshiftx+y100; % square center
1290 pos1(medium,0); pos2(medium,0); % left leg
1291 lft x1l=pcshiftx+cap_jut; top y1=h; bot y2=0;
1292 lft x2l = pcshiftx;
1293 pos3(thick,0); pos4(thick,0); % right leg
1294 x4r=pcshiftx+h; top y3=h; bot y4=0;
1295 x3r=x4r-cap_jut;
1296 numeric long, short, hypot, alpha; long=side; short=1/2side;
1297 hypot=long++short; alpha=hypot/long;
1298 pos5(alpha*thick,0); pos6(alpha*thick,0); % left inner
1299 z5r=z1l; bot lft z6l=(x100,0);
1300 pos7(alpha*medium,0); pos8(alpha*medium,0); % right inner
1301 z8l=z3r; bot rt z7r=z6l;
1302 z0=whatever[z5r,z6r]=whatever[z7l,z8l]; % bottom notch
1303 z10=whatever[z5l,z6l]=whatever[z1r,z2r]; % left notch
1304 z11=whatever[z7r,z8r]=whatever[z3l,z4l]; % right notch
1305 % draw the M all in one go
1306 filldraw z5r--z0--z8l--z3r--z4r--z4l--z11--z6l--z10--z2r--z2l--z1l--cycle;
1307 if serifs:
1308 serif(2,1,a,sadj*serif_darkness,-cap_jut); % left leg
1309 serif(2,1,e,sadj*serif_darkness,cap_jut);
1310 serif(4,3,d,sadj*serif_darkness, cap_jut); % right leg
1311 serif(4,3,f,sadj*serif_darkness,-cap_jut);
1312 fi
1313 proofpcbb(100, y100, y100);
1314 penlabels(0,1,2,3,4,5,6,7,8,10,11,100); endchar;
1315
1316 % \end{macrocode}
1317 % \end{macro}
1318 %
1319 % \begin{macro}{N}
1320 % The letter N. With serifs it fills the square. The diagonal is |thick|
1321 % and the width of the uprights is 75\% of the width of the diagonal.
1322 % \begin{macrocode}
1323
1324 cmchar "Trajan's letter N";
1325 beginchar("N", u#+side#, cap_height#,0);
1326 adjust_fit(cap_serif_fit#, cap_serif_fit#); pickup tiny.nib;
1327 pcshiftx := u/2;
1328 y100 = h/2; x100 = pcshiftx + y100; % center point
1329 numeric long, short, hypot, alpha; long=h; short=h;
1330 hypot=long++short; alpha=hypot/long;
1331 numeric legw; legw = 3/4thick;
1332 pos1(legw,0); pos2(legw,0); lft x1l=lft x2l=pcshiftx+cap_jut; top y1=h; bot y2=0;
1333 pos3(legw,0); pos4(legw,0); x3=x4; rt x3r=w-pcshiftx-cap_jut; y3=y1; y4=y2;
1334 pos 5(alpha*thick,0); pos6(alpha*thick,0);
1335 z5r=z1l; z6l=z4r; z0=whatever[z1r,z2r]=whatever[z5l,z6l]; % under notch point
1336 z0'=whatever[z5r,z6r]=whatever[z3l,z4l];
1337 filldraw z1l--z2l--z2r--z0--z6l--z3r--z3l--z0'--cycle;
1338 if serifs:
1339 % bottom of left stem
1340 serif(2,1,b,sadj*serif_darkness,-cap_jut);
1341 serif(2,1,c,sadj*serif_darkness,cap_jut);
1342 % top of right stem
1343 serif(3,4,d,sadj*serif_darkness,-cap_jut);
1344 serif(3,4,e,sadj*serif_darkness,cap_jut);
1345 fi
1346 proofpcbb(100, y100, y100);
1347 penlabels(0,0',1,2,3,4,5,6,100); endchar;
1348
1349 % \end{macrocode}
1350 % \end{macro}
1351 %
1352 %
1353 % \begin{macro}{O}
1354 % The letter O. This includes optical adjustments at the top and bottom.
1355 % \begin{macrocode}
1356
1357 cmchar "Trajan's letter O";
1358 beginchar("O", 2u#+side#, cap_height#, 0);
1359 adjust_fit(0,0); pair trajan[];
1360 pcshiftx := u;
1361 y100=h/2; x100=pcshiftx+y100; % square center
1362 x2r=pcshiftx; x4r=x2r+h; y1r=h+o; y3r=-o;
1363 z100=.5[z5,z6]; numeric axis_angle;
1364 trajan1=(x2r+0.25h,y1r); trajan2=(x4r, 0.75h);
1365 trajan3=(x2r, 0.25h); trajan4=(x2r+0.75h, y3r);
1366 axis_angle=angle(trajan2-trajan3);
1367 z5-z6=(thick,0)rotated axis_angle;
1368 y2r=y6; y4r=y5; x1r=x5; x3r=x6;
1369 forsuffixes $=1,2,3,4: z$=.5[z$l,z$r]; endfor
1370 x1l=x3r; y1l-y6=y6-y3r; x5-x2l=x4r-x5; y2l=y4r;
1371 x3l=x1r; y1r-y5=y5-y3l; x4l-x6=x6-x2r; y4l=y2r;
1372 path p,p';
1373 p=pulled_arc.r(1,2)&reverse pulled_arc.r(3,2)&
1374 pulled_arc.r(3,4)&reverse pulled_arc.r(1,4)&cycle; % outer
1375 path anti_diag; anti_diag=z100--trajan1;
1376 z21r=p intersectionpoint anti_diag; penpos21(thin, axis_angle+90);
1377 x43r=w-x21r; y43r=h-y21r; penpos43(thin, axis_angle+270);
1378 path diag; diag=z100--trajan2;
1379 z41r=diag intersectionpoint p; penpos41(thick, axis_angle);
1380 x32r=w-x41r; y32r=h-y41r; penpos32(thick, axis_angle+180);
1381 p'= z1l{left}..z21l..z2l{down}..z32l..
1382 z3l{right}..z43l..
1383 z4l{up}..z41l..{left}cycle; % inner
1384 fill p; unfill p';
1385 proofpcbb(100, y100, y100);
1386 penlabels(0,1,2,3,4,5,6,21,32,43,41,100); endchar;
1387
1388 % \end{macrocode}
1389 % \end{macro}
1390 %
1391 % \begin{macro}{P}
1392 % The letter P. With serifs, the inside of the bowl is at half the width.
1393 % \begin{macrocode}
1394
1395 cmchar "Trajan's letter P";
1396 beginchar("P", u#+0.5side#+thick#, cap_height#, 0);
1397 adjust_fit(cap_serif_fit#, 0);
1398 pcshiftx := 0.5u;
1399 y100=h/2; x100=pcshiftx+y100; % square center
1400 pickup tiny.nib;
1401 pos1(thick,0); pos2(thick,0);
1402 top lft z1l=(pcshiftx+cap_jut,h); bot lft z2l=(pcshiftx+cap_jut,0);
1403 filldraw stroke z1e--z2e; % vertical stem
1404 pos3(thin,90); pos4(thin,90); pos5(thick,0);
1405 pos6(thin,-90);
1406 top y3r=top y4r=h; x3=x1; x4=x1r+thick; filldraw stroke z3e--z4e;
1407 x6=x4; y6=hround(h/2);
1408 lft x5l=x100; y5=.75h;
1409 pos7(0.5thin,-90);
1410 y7=y6+0.5thin; x7=.25[rt x1r, x6];
1411 filldraw stroke pulled_super_arc.e(4,5,eta)&pulled_super_arc.e(5,6,eta)
1412 ..z7e; % lobe
1413 if serifs:
1414 serif(1,2,a,sadj*serif_darkness,-cap_jut);
1415 serif(2,1,b,sadj*serif_darkness,-cap_jut);
1416 serif(2,1,c,sadj*serif_darkness,cap_jut);
1417 fi
1418 proofpcbb(100, y100, y100);
1419 penlabels(1,2,3,4,5,6,7,100); endchar;
1420
1421 % \end{macrocode}
1422 % \end{macro}
1423 %
1424 %
1425 % \begin{macro}{Q}
1426 % The letter Q, which is based on the O and has a much longer tail
1427 % than modern fonts.
1428 % \begin{macrocode}
1429
1430 cmchar "Trajan's letter Q";
1431 beginchar("Q", 2u#+side#, cap_height#, 0);
1432 adjust_fit(0,0); pair trajan[];
1433 pcshiftx := u;
1434 y100=h/2; x100=pcshiftx+y100; % square center
1435 x2r=pcshiftx; x4r=x2r+h; y1r=h+o; y3r=-o;
1436 z100=.5[z5,z6]; numeric axis_angle;
1437 trajan1=(x2r+0.25h,y1r); trajan2=(x4r, 0.75h);
1438 trajan3=(x2r, 0.25h); trajan4=(x2r+0.75h, y3r);
1439 axis_angle=angle(trajan2-trajan3);
1440 z5-z6=(thick,0)rotated axis_angle;
1441 y2r=y6; y4r=y5; x1r=x5; x3r=x6;
1442 forsuffixes $=1,2,3,4: z$=.5[z$l,z$r]; endfor
1443 x1l=x3r; y1l-y6=y6-y3r; x5-x2l=x4r-x5; y2l=y4r;
1444 x3l=x1r; y1r-y5=y5-y3l; x4l-x6=x6-x2r; y4l=y2r;
1445 path p,p';
1446 p=pulled_arc.r(1,2)&reverse pulled_arc.r(3,2)&
1447 pulled_arc.r(3,4)&reverse pulled_arc.r(1,4)&cycle; % outer
1448 path anti_diag; anti_diag=z100--trajan1;
1449 z21r=p intersectionpoint anti_diag; penpos21(thin, axis_angle+90);
1450 x43r=w-x21r; y43r=h-y21r; penpos43(thin, axis_angle+270);
1451 path diag; diag=z100--trajan2;
1452 z41r=diag intersectionpoint p; penpos41(thick, axis_angle);
1453 x32r=w-x41r; y32r=h-y41r; penpos32(thick, axis_angle+180);
1454 p'= z1l{left}..z21l..z2l{down}..z32l..
1455 z3l{right}..z43l..
1456 z4l{up}..z41l..{left}cycle; % inner
1457 fill p; unfill p';
1458
1459 % now for the tail!
1460 numeric alpha; alpha:=0.4;
1461 z10=z43;
1462 z10l=z10-(alpha*thick,alpha*thick); z10r=z10+(alpha*thick,alpha*thick);
1463 z11l=(x4r,-0.175h); z11r=z11l+(0,thick);
1464 z13l=(x4r+0.375h,-0.25h); z13r=z13l+(0,medium);
1465 z12l=(x4r+0.875h,-0.125h); z12r=z12l+(0,0.5thin);
1466 filldraw z10r..z11r..z13r..z12r--z12l..z13l..z11l..z10l--cycle;
1467 proofpcbb(100, y100, y100);
1468 penlabels(1,2,3,4,5,6,10,11,12,13,14,15,21,32,41,43,100); endchar;
1469
1470 % \end{macrocode}
1471 % \end{macro}
1472 %
1473 % \begin{macro}{R}
1474 % The letter R. Another character that, with serifs, fills the square.
1475 % \begin{macrocode}
1476
1477 cmchar "Trajan's letter R";
1478 beginchar("R", u#+side#, cap_height#,0);
1479 adjust_fit(cap_serif_fit#,0);
1480 pcshiftx := 0.5u;
1481 y100=h/2; x100=pcshiftx+y100; % square center
1482 pickup tiny.nib; pos1(thick,0); pos2(thick,0);
1483 top lft z1l=(pcshiftx+cap_jut,h); bot lft z2l=(pcshiftx+cap_jut,0);
1484 filldraw stroke z1e--z2e; % vertical stem
1485 pos3(thin,90); pos4(thin,90); pos5(thick,0);
1486 pos6(thin, -90);
1487 top y3r=top y4r=h; x3=x1; x4=x1r+thick;
1488 x6=x4; y6=hround(h/2 - medium);
1489 lft x5l=x100; y5=.5[y4,y6];
1490 pos7(thin, -90);
1491 y7=y6; x7=x3;
1492 filldraw stroke z3e--pulled_super_arc.e(4,5,eta)&
1493 pulled_super_arc.e(5,6,eta)..z7e; % lobe
1494 numeric half_letter_width; 2half_letter_width+1/2u=w;
1495 if serifs: half_letter_width:=half_letter_width+1/2u;
1496 else: half_letter_width:=half_letter_width-1.6thin; fi
1497 path p; p=pulled_super_arc.r(5,6,eta)..z7r;
1498 z0r=p intersectionpoint ((half_letter_width,0)--(half_letter_width,h));
1499 path circ_; circ_= (((halfcircle scaled 2thick) rotated 180) shifted z0r);
1500 z0l= p intersectionpoint circ_;
1501 z0'=(.45[half_letter_width,w],0);
1502 numeric tail_angle; tail_angle=angle(z0l-z0');
1503 penpos8(thick, tail_angle-90); z8l=whatever[z0', z0l];
1504 x8=1/5[half_letter_width,w];
1505 penpos9(2/3thick,tail_angle-90); z9r=whatever[z0r, z8r];
1506 x9r=.5[half_letter_width, w];
1507 penpos10(0.5thin,90);
1508 z10r=(w,-0.5thin);
1509 fill z0l--z8l...{right}z10l--z10r{-w,1/4h}..z9r--z0r--cycle; % tail
1510 if serifs:
1511 serif(1,2,a,sadj*serif_darkness,-cap_jut);
1512 serif(2,1,b,sadj*serif_darkness,-cap_jut);
1513 serif(2,1,c,sadj*serif_darkness,cap_jut); fi
1514 proofpcbb(100, y100, y100);
1515 penlabels(0,1,2,3,4,5,6,7,8,9,10,100); labels(0'); endchar;
1516
1517 % \end{macrocode}
1518 % \end{macro}
1519 %
1520 % \begin{macro}{S}
1521 % The letter S. The width is half the square.
1522 % \begin{macrocode}
1523
1524 cmchar "Trajan's letter S";
1525 beginchar("S", 2u#+1/2side#, cap_height#, 0);
1526 adjust_fit(0,0); pickup tiny.nib;
1527 pcshiftx := u;
1528 y100 = h/2; x100 = w/2; % square center
1529 pair trajan[]; % points to contain corner coords of Trajan square
1530 ypart trajan3=ypart trajan4=0; ypart trajan1= ypart trajan2=h;
1531 xpart trajan1=xpart trajan3; xpart trajan4= xpart trajan2= xpart trajan3+side;
1532 xpart trajan3=x100-0.5side;
1533 numeric slope, diag_angle; diag_angle=angle(trajan2-trajan3);
1534 slope=-0.75h/(xpart trajan4-xpart trajan3);
1535 pos0(thick,diag_angle);
1536 x0=w/2; y0=h/2;
1537 lft x3l=pcshiftx+o;
1538 rt x3r=lft x3l+5/6thick;
1539 pos2(thin,-diag_angle); top y2l=h;
1540 if x0-x3r>thick:
1541 x2l=x0;
1542 else:
1543 x2l=x0r; slope:=-1/2;
1544 fi
1545 ellipse_set(2l,3l,4l,0l); ellipse_set(2r,3r,4r,0r);
1546 pos7(thin,-diag_angle); x7r=x0; bot y7r=0;
1547 rt x6r=w-pcshiftx; lft x6l=rt x6r-5/6thick;
1548 ellipse_set(7l,6l,5l,0l); ellipse_set(7r,6r,5r,0r);
1549 pos1(max(currentbreadth+eps,5/6 thick),-90);
1550 top y1l=h-thin; x1=x6r-o;
1551 pos8(1.5thick,-90);
1552 lft x8r=pcshiftx; bot y8r=medium;
1553 filldraw z1l..z2l{left}..{down}z3l..z4l--z5l..{down}z6l..{left}z7l..z8l
1554 --z8r..{right}z7r..{up}z6r..z5r--z4r..{up}z3r..{right}z2r..z1r--cycle;
1555 proofpcbb(100, y100, y100);
1556 penlabels(0,1,2,3,4,5,6,7,8,100); endchar;
1557
1558 % \end{macrocode}
1559 % \end{macro}
1560 %
1561 % \begin{macro}{T}
1562 % The letter T. It has a jaunty crossbar.
1563 % \begin{macrocode}
1564
1565 cmchar "Trajan's letter T";
1566 beginchar("T",2u#+0.8side#, cap_height#,0);
1567 adjust_fit(cap_serif_fit#,0); pickup tiny.nib;
1568 pcshiftx := u;
1569 y100=h/2; x100=pcshiftx+y100; % square center
1570 pos1(thick,0); pos2(thick,0); 0.5[x1r,x1l]=0.5[x2r,x2l]=w/2;
1571 top y1=h-thin; bot y2=0;
1572 filldraw stroke z1e--z2e; % central stem
1573 % prepare for the top horizontal bar
1574 numeric top_bar; top_bar=0.4side; % half length of top bar
1575 pos3(medium,90); pos4(dslab,0);
1576 x1=x3; y3r=y1; rt x4l=x1+top_bar;
1577 bot y4=vround(y1- vstretch*(medium+cap_jut));
1578 arm(3,4,c,sadj*serif_darkness,0);
1579 % now the jaunty left arm
1580 x5=x1-top_bar;
1581 y5=h;
1582 pos8(medium,90);
1583 x8r=0.3[x5,x1]; y8r=0.125[y3r,y5];
1584 x6=x5-thin; y6=h-medium-cap_jut;
1585 x7=x6+0.75cap_jut; y7=y3l;
1586 x9=0.4[x6,x7]; y9=0.7[y6,y7];
1587 filldraw z3r--z1l{left}..z8r..z5--z6{z5-z6}..z9..z7..z8l..z3l--cycle;
1588 if serifs:
1589 serif(2,1,a,sadj*serif_darkness,-cap_jut);
1590 serif(2,1,b,sadj*serif_darkness,cap_jut);
1591 fi
1592 proofpcbb(100, y100, y100);
1593 penlabels(1,2,3,4,5,6,7,8,100); endchar;
1594
1595 % \end{macrocode}
1596 % \end{macro}
1597 %
1598 % \begin{macro}{U}
1599 % The letter U. The Romans didn't have a U but Jan Tschichold
1600 % designed one to match. With serifs, this just fits into the square.
1601 % \begin{macrocode}
1602
1603 cmchar "Trajan's letter U";
1604 beginchar("U", u#+side#, cap_height#,0);
1605 adjust_fit(cap_serif_fit#, cap_serif_fit#);
1606 pcshiftx:=0.5u;
1607 y100=h/2; x100=pcshiftx+y100; % square center
1608 pickup tiny.nib;
1609 x101=pcshiftx; y101=h; x102=x101+h; y102=0; % square corners
1610 % right leg
1611 pos5(thick,0); pos6(thick,0);
1612 rt x5r= rt x6r= pcshiftx+h-cap_jut;
1613 top y5=h; bot y6=0;
1614 filldraw stroke z5e--z6e; % leg
1615 % left leg and bowl
1616 pos1(thick,0); pos2(thick,0);
1617 pos3(medium,-90); pos4(thin,0);
1618 lft x1l= hround(pcshiftx+cap_jut); x2=x1;
1619 top y1=h;
1620 y2=0.35h;
1621 x3=x100; bot y3r=0;
1622 z4l=whatever[z101,z102]=whatever[z5l,z6l];
1623 filldraw z1r--z2r{down}..z3l..z4l--z4r..z3r..z2l{up}--z1l--cycle;
1624 if serifs:
1625 serif(1,2,a,sadj*serif_darkness,-cap_jut); % top LL
1626 serif(1,2,b,sadj*serif_darkness,cap_jut); % top LR
1627 serif(5,6,c,sadj*serif_darkness,-cap_jut); % top RL
1628 serif(5,6,d,sadj*serif_darkness,cap_jut); % top RR
1629 serif(6,5,f,sadj*serif_darkness,cap_jut); % bottom RR
1630 fi
1631 proofpcbb(100, y100, y100);
1632 penlabels(1,2,3,4,5,6,100); endchar;
1633
1634 % \end{macrocode}
1635 % \end{macro}
1636 %
1637 % \begin{macro}{V}
1638 % The letter V. With serifs it just fills the square.
1639 % \begin{macrocode}
1640
1641 cmchar "Trajan's letter V";
1642 beginchar("V",u#+side#, cap_height#, 0);
1643 adjust_fit(cap_serif_fit#, cap_serif_fit#); pickup tiny.nib;
1644 pcshiftx := 0.5u;
1645 y100=h/2; x100=pcshiftx+y100; % square center
1646 numeric alpha; alpha=((0.5h-cap_jut)++(h))/(h);
1647 pos1(alpha*thick,0); pos2(alpha*thick,0);
1648 pos3(alpha*medium,0); pos4(alpha*medium,0);
1649 top y1=top y4=h; lft x1l=pcshiftx+cap_jut; x4r=x1l+side-2cap_jut;
1650 lft x2l=hround(pcshiftx+0.5side); x3r=x2l; bot y2=bot y3=0;
1651 z0=whatever[z1r,z2r]=whatever[z3l,z4l]; % notch point
1652 filldraw z0--diag_end(0,4l,1,1,4r,3r)--z2l
1653 --diag_end(2l,1l,1,1,1r,0)--cycle;
1654 if serifs:
1655 bracket:=cap_jut_factor*bracket; cap_jut:=cap_jut_factor*cap_jut;
1656 pickup tiny.nib; numeric jut_factor;
1657 jut_factor=3/4;
1658 serif(1,2,a,sadj*serif_darkness,-cap_jut); % top LL
1659 serif(4,3,d,sadj*serif_darkness,cap_jut); % top RR
1660 bracket:=jut_factor*bracket;
1661 serif(1,2,b,sadj*serif_darkness, jut_factor*cap_jut); % top LR
1662 serif(4,3,c,sadj*serif_darkness,-jut_factor*cap_jut); % top RL
1663 fi
1664 proofpcbb(100, y100, y100);
1665 penlabels(0,1,2,3,4,100); endchar;
1666
1667 % \end{macrocode}
1668 % \end{macro}
1669 %
1670 % \begin{macro}{W}
1671 % The letter W. Jan Tschichold provides a design for this.
1672 % It consists of 2 Vs shifted
1673 % 3/8 of the side of the square.
1674 % \begin{macrocode}
1675
1676 cmchar "Trajan's letter W";
1677 beginchar("W", u#+1.375side#, cap_height#, 0);
1678 adjust_fit(cap_serif_fit#, cap_serif_fit#); pickup tiny.nib;
1679 pcshiftx := 0.5u;
1680 y100=h/2; x100=pcshiftx+y100; % square center
1681 numeric alpha; alpha=((0.5h-cap_jut)++(h))/(h);
1682 numeric beta; beta := 0.375;
1683 % the lefthand V
1684 pos1(alpha*thick,0); pos2(alpha*thick,0);
1685 pos3(alpha*medium,0); pos4(alpha*medium,0);
1686 top y1=top y4=h; lft x1l=pcshiftx+cap_jut; x4r=x1l+side-2cap_jut;
1687 lft x2l=hround(pcshiftx+0.5side); x3r=x2l; bot y2=bot y3=0;
1688 z0=whatever[z1r,z2r]=whatever[z3l,z4l]; % notch point
1689 filldraw z0--diag_end(0,4l,1,1,4r,3r)--z2l
1690 --diag_end(2l,1l,1,1,1r,0)--cycle;
1691 % the righthand V
1692 pos5(alpha*thick,0); pos6(alpha*thick,0);
1693 pos7(alpha*medium,0); pos8(alpha*medium,0);
1694 z5=(x1+beta*h,y1); z6=(x2+beta*h,y2);
1695 z7=(x3+beta*h,y3); z8=(x4+beta*h,y4);
1696 z10=(x0+beta*h,y0);
1697 filldraw z10--diag_end(10,8l,1,1,8r,7r)--z6l
1698 --diag_end(6l,5l,1,1,5r,10)--cycle;
1699
1700 if serifs:
1701 bracket:=cap_jut_factor*bracket; cap_jut:=cap_jut_factor*cap_jut;
1702 pickup tiny.nib; numeric jut_factor;
1703 jut_factor=3/4;
1704 serif(1,2,a,sadj*serif_darkness,-cap_jut); % top LL left V
1705 serif(4,3,d,sadj*serif_darkness,cap_jut); % top RR left V
1706 serif(5,6,f,sadj*serif_darkness,-cap_jut); % top LL right V
1707 serif(8,7,k,sadj*serif_darkness,cap_jut); % top RR right V
1708
1709 bracket:=jut_factor*bracket;
1710 serif(1,2,b,sadj*serif_darkness, jut_factor*cap_jut); % top LR left V
1711 serif(4,3,c,sadj*serif_darkness,-jut_factor*cap_jut); % top RL left V
1712 serif(5,6,g,sadj*serif_darkness, jut_factor*cap_jut); % top LR right V
1713 serif(8,7,j,sadj*serif_darkness,-jut_factor*cap_jut); % top RL right V
1714 fi
1715 proofpcbb(100, y100, y100);
1716 penlabels(0,,1,2,3,4,5,6,7,8,10,100); endchar;
1717
1718 % \end{macrocode}
1719 % \end{macro}
1720 %
1721 % \begin{macro}{X}
1722 % The letter X. The major leg is like the major leg (left) of the V.
1723 % \begin{macrocode}
1724
1725 cmchar "Trajan's letter X";
1726 beginchar("X", u#+0.5side#+thick#+2cap_jut#, cap_height#, 0);
1727 adjust_fit(cap_serif_fit#, cap_serif_fit#);
1728 pcshiftx := 0.5u;
1729 y100=h/2; x100=pcshiftx+y100; % center of square
1730 numeric alpha; alpha=((0.5h-cap_jut)++(h))/(h);
1731 % major leg
1732 pos1(alpha*thick,0); pos2(alpha*thick,0);
1733 top y1=h; lft x1l=hround(pcshiftx+cap_jut);
1734 bot y2=0; lft x2l=hround(pcshiftx+0.5side+cap_jut);
1735 % minor leg
1736 penpos3(alpha*medium,0); penpos4(alpha*medium,0);
1737 y3=y1; lft x3l=h/2+cap_jut;
1738 y4=y2; lft x4l=pcshiftx+cap_jut;
1739 filldraw z1l--z1r--z2r--z2l--cycle; % draw the thick limb
1740 filldraw z3l--z3r--z4r--z4l--cycle; % draw the other limb
1741 if serifs:
1742 bracket:=cap_jut_factor*bracket; cap_jut:=cap_jut_factor*cap_jut;
1743 pickup tiny.nib; numeric jut_factor;
1744 jut_factor=3/4;
1745 serif(1,2,a,serif_darkness,-cap_jut); % outer serifs
1746 serif(2,1,d,serif_darkness,cap_jut);
1747 serif(3,4,f,serif_darkness,cap_jut);
1748 serif(4,3,g,serif_darkness,-cap_jut);
1749 bracket:=jut_factor*bracket;
1750 serif(1,2,b,sadj*serif_darkness,.75cap_jut); % inner serifs
1751 serif(2,1,c,sadj*serif_darkness,-.75cap_jut);
1752 serif(3,4,e,sadj*serif_darkness,-.75cap_jut);
1753 serif(4,3,h,sadj*serif_darkness,.75cap_jut);
1754 fi
1755 proofpcbb(100, y100, y100);
1756 penlabels(1,2,3,4,100); endchar;
1757
1758 % \end{macrocode}
1759 % \end{macro}
1760 %
1761 % \begin{macro}{Y}
1762 % The letter Y. With serifs it takes 7/8 of the square width.
1763 % \begin{macrocode}
1764
1765 cmchar "Trajan's letter Y";
1766 beginchar("Y", u#+0.875side#, cap_height#, 0);
1767 adjust_fit(cap_serif_fit#, cap_serif_fit#); pickup pencircle scaled 0pt;
1768 pcshiftx := 0.5u;
1769 y100=h/2; x100=pcshiftx+y100; % center of square
1770 numeric alpha, long, short, hypot; long=h/2;
1771 short=0.5side-thick-cap_jut;
1772 hypot=long++short; alpha=hypot/long;
1773 % top left of V
1774 penpos1(alpha*thick,0);
1775 lft x1l=pcshiftx+cap_jut;
1776 top y1=h;
1777 % top right of V
1778 penpos4(alpha*medium,0); y4=y1; x4r=w-pcshiftx-cap_jut;
1779 % the stem
1780 penpos5(thick,0); penpos6(thick,0);
1781 rt x5r= rt x6r=x100;
1782 y6=0; y5=h;
1783 % bottom of left V arm
1784 penpos2(alpha*thick,0);
1785 x2l=x6l; y2=y100;
1786 % bottom of right V arm
1787 penpos3(alpha*medium,0);
1788 x3r=x6r; y3=y100+thin;
1789 z0=whatever[z1r, z2r]=whatever[z3l,z4l]; % notch point
1790 filldraw z1r--z0--z4l--z4r--z3r--z6r--z6l--z2l--z1l--cycle;
1791 if serifs:
1792 numeric jut_factor;
1793 serif(6,5,e,sadj*serif_darkness,-cap_jut); % stem L
1794 serif(6,5,f,sadj*serif_darkness,cap_jut); % stem R
1795 bracket:=cap_jut_factor*bracket; cap_jut:=cap_jut_factor*cap_jut;
1796 jut_factor=3/4;
1797 % top outer serifs
1798 serif(1,2,a,serif_darkness,-cap_jut);serif(4,3,d,serif_darkness,cap_jut);
1799 bracket:=jut_factor*bracket;
1800 % top inner serifs
1801 serif(1,2,b,sadj*serif_darkness,0.6cap_jut);
1802 serif(4,3,c,sadj*serif_darkness,-0.6cap_jut);
1803 fi
1804 proofpcbb(100, y100, y100);
1805 penlabels(0,1,2,3,4,5,6,100); endchar; % End of "Y"
1806
1807 % \end{macrocode}
1808 % \end{macro}
1809 %
1810 % \begin{macro}{Z}
1811 % The letter Z. Jan Tschichold supplies the design for this. It takes 3/4
1812 % of the square in width, with the bottom arm like the E or L.
1813 % \begin{macrocode}
1814
1815 cmchar "Trajan's letter Z";
1816 beginchar("Z", 2u#+0.75side#+medium#, cap_height#,0);
1817 adjust_fit(0, 0); pickup tiny.nib;
1818 pcshiftx := u;
1819 y100=h/2; x100=pcshiftx+y100; % center of square
1820 numeric alpha, long, short, hypot;
1821 long=h; short=h/2-thick; hypot=long++short;
1822 alpha=hypot/long;
1823 pos1(medium,90); pos2(medium,90); pos3(alpha*thick, 0);
1824 pos4(alpha*thick, 0);
1825 rt x3r=w-u; top y3=h; x4l=w-x3r; bot y4=0;
1826 top y1r=h; lft x1=u; y2=y1; rt x2=x3;
1827 filldraw stroke z1e--z2e; % top bar
1828 filldraw stroke z3e--z4e; % diagonal
1829 % and for the bottom bar
1830 pos8(medium,-90); pos9(dslab,0); x8=x4; bot y8r=0;
1831 rt x9r=hround(x100+0.25h+medium);
1832 y9=1.5thick;
1833 foot(8,9,g,serif_darkness,medium); % lower arm
1834
1835 if serifs:
1836 pickup crisp.nib; % prepare for arms and serifs
1837 pos5(medium, 90); pos6(dslab,180); z5=z2; lft x6r=u;
1838 bot y6=h-vstretch*thick;
1839 arm(5,6,a,serif_darkness,0); % upper dropped serif
1840 fi
1841 proofpcbb(100, y100, y100);
1842 penlabels(1,2,3,4,5,6,7,8,9,100); endchar;
1843
1844
1845 %</maj>
1846 % \end{macrocode}
1847 % \end{macro}
1848 %
1849 % \subsection{The punctuation file}
1850 %
1851 % This is essentially a copy of Knuth's Computer Modern Roman punctuation.
1852 %
1853 % \begin{macrocode}
1854 %<*punct>
1855 % TRJNPUNCT.MF This file contains punctuation marks common to
1856 % Trajan roman and italic styles.
1857
1858 % \end{macrocode}
1859 %
1860 % \begin{macro}{!}
1861 % The ! character.
1862 % \begin{macrocode}
1863
1864 cmchar "Exclamation point";
1865 beginchar("!",5u#+width_adj#,asc_height#,0);
1866 italcorr asc_height#*slant-2u#-.5width_adj#+.5dot_size#;
1867 adjust_fit(0,0);
1868 pickup tiny.nib; pos3(dot_size,0); pos4(dot_size,90);
1869 lft x3l=hround(.5w-.5dot_size); bot y4l=0; z3=z4; dot(3,4); % dot
1870 numeric bot_width;
1871 bot_width=if hefty:max(hround .8dot_size,fine.breadth) else: hair fi;
1872 pickup fine.nib; pos1(dot_size,0); pos2(bot_width,0);
1873 x1=x2=x3; bot y2=.25[top y4r,x_height]+1;
1874 if square_dots: top y1=h;
1875 filldraw stroke z1e--z2e; % stem
1876 else: top z0=(x1,h+o); y1+.5dot_size=h+o;
1877 filldraw z1r...z0...z1l---z2l--z2r---cycle; fi % stem and bulb
1878 penlabels(0,1,2,3,4); endchar;
1879
1880 % \end{macrocode}
1881 % \end{macro}
1882 %
1883 % \begin{macro}{'}
1884 % The ' character.
1885 % \begin{macrocode}
1886
1887 cmchar "Apostrophe";
1888 beginchar("'",5u#,asc_height#,0);
1889 italcorr asc_height#*slant+.5dot_size#-2u#;
1890 adjust_fit(0,0);
1891 x1-.5dot_size=hround(.5w-.5dot_size); y1+.5dot_size=h;
1892 if monospace: comma(1,a,dot_size,.28u,vround 1.5comma_depth); % large comma
1893 else: comma(1,a,dot_size,.25u,comma_depth); fi % comma with increased jut
1894 penlabels(1); endchar;
1895
1896 % \end{macrocode}
1897 % \end{macro}
1898 %
1899 % \begin{macro}{(}
1900 % The ( character.
1901 % \begin{macrocode}
1902
1903 cmchar "Left parenthesis";
1904 beginchar("(",7u# if monospace: -u# fi,body_height#,paren_depth#);
1905 italcorr body_height#*slant-.5u#;
1906 adjust_fit(0,0); pickup fine.nib;
1907 pos1(vair,0); pos2(.75[hair,stem],0); pos3(vair,0);
1908 rt x1r=rt x3r=hround(w-u); lft x2l=hround(x1-4u if monospace: +4/3u fi);
1909 top y1=h; y2=.5[y1,y3]=math_axis;
1910 filldraw stroke z1e{3(x2e-x1e),y2-y1}...z2e
1911 ...{3(x3e-x2e),y3-y2}z3e; % arc
1912 penlabels(1,2,3); endchar;
1913
1914 % \end{macrocode}
1915 % \end{macro}
1916 %
1917 % \begin{macro}{)}
1918 % The ) character.
1919 % \begin{macrocode}
1920
1921 cmchar "Right parenthesis";
1922 beginchar(")",7u# if monospace: -u# fi,body_height#,paren_depth#);
1923 italcorr math_axis#*slant-.5u#;
1924 adjust_fit(0,0); pickup fine.nib;
1925 pos1(vair,0); pos2(.75[hair,stem],0); pos3(vair,0);
1926 lft x1l=lft x3l=hround u; rt x2r=hround(x1+4u if monospace: -4/3u fi);
1927 top y1=h; y2=.5[y1,y3]=math_axis;
1928 filldraw stroke z1e{3(x2e-x1e),y2-y1}...z2e
1929 ...{3(x3e-x2e),y3-y2}z3e; % arc
1930 penlabels(1,2,3); endchar;
1931
1932 % \end{macrocode}
1933 % \end{macro}
1934 %
1935 % \begin{macro}{,}
1936 % The , character.
1937 % \begin{macrocode}
1938
1939 cmchar "Comma";
1940 numeric dot_diam#; dot_diam#=if monospace: 5/4 fi\\ dot_size#;
1941 define_whole_blacker_pixels(dot_diam);
1942 beginchar(",",5u#,dot_diam#,comma_depth#);
1943 adjust_fit(0,0);
1944 x1-.5dot_diam=hround(.5w-.5dot_diam); y1-.5dot_diam=0;
1945 comma(1,a,dot_diam,.2u,comma_depth); % dot and tail
1946 penlabels(1); endchar;
1947
1948 % \end{macrocode}
1949 % \end{macro}
1950 %
1951 % \begin{macro}{.}
1952 % The . character.
1953 % \begin{macrocode}
1954
1955 cmchar "Period";
1956 numeric dot_diam#; dot_diam#=if monospace: 5/4 fi\\ dot_size#;
1957 define_whole_blacker_pixels(dot_diam);
1958 beginchar(".",5u#,dot_diam#,0);
1959 adjust_fit(0,0); pickup fine.nib;
1960 pos1(dot_diam,0); pos2(dot_diam,90);
1961 lft x1l=hround(.5w-.5dot_diam); bot y2l=0; z1=z2; dot(1,2); % dot
1962 penlabels(1,2); endchar;
1963
1964 % \end{macrocode}
1965 % \end{macro}
1966 %
1967 % \begin{macro}{/}
1968 % The / character.
1969 % \begin{macrocode}
1970
1971 cmchar "Virgule (slash)";
1972 beginchar("/",9u#,body_height#,paren_depth#);
1973 italcorr body_height#*slant-.5u#;
1974 adjust_fit(0,0); pickup rule.nib;
1975 rt x1=hround(w-u)+eps; top y1=h+eps;
1976 lft x2=hround u-eps; bot y2=-d-eps;
1977 draw z1--z2; % diagonal
1978 penlabels(1,2); endchar;
1979
1980 % \end{macrocode}
1981 % \end{macro}
1982 %
1983 % \begin{macro}{:}
1984 % The : character.
1985 % \begin{macrocode}
1986
1987 cmchar "Colon";
1988 numeric dot_diam#; dot_diam#=if monospace: 5/4 fi\\ dot_size#;
1989 define_whole_blacker_pixels(dot_diam);
1990 beginchar(":",5u#,x_height#,0);
1991 italcorr x_height#*slant+.5dot_diam#-2u#;
1992 adjust_fit(0,0); pickup fine.nib;
1993 pos1(dot_diam,0); pos2(dot_diam,90);
1994 lft x1l=hround(.5w-.5dot_diam); top y2r=h; z1=z2; dot(1,2); % upper dot
1995 pos3(dot_diam,0); pos4(dot_diam,90);
1996 x3=x1; bot y4l=0; z3=z4; dot(3,4); % lower dot
1997 penlabels(1,2,3,4); endchar;
1998
1999 % \end{macrocode}
2000 % \end{macro}
2001 %
2002 % \begin{macro}{;}
2003 % The ; character.
2004 % \begin{macrocode}
2005
2006 cmchar "Semicolon";
2007 numeric dot_diam#; dot_diam#=if monospace: 5/4 fi\\ dot_size#;
2008 define_whole_blacker_pixels(dot_diam);
2009 beginchar(";",5u#,x_height#,comma_depth#);
2010 italcorr x_height#*slant+.5dot_diam#-2u#;
2011 adjust_fit(0,0); pickup fine.nib;
2012 pos1(dot_diam,0); pos2(dot_diam,90);
2013 lft x1l=hround(.5w-.5dot_diam); top y2r=h; z1=z2; dot(1,2); % upper dot
2014 x3-.5dot_diam=hround(.5w-.5dot_diam); y3-.5dot_diam=0;
2015 comma(3,a,dot_diam,.05u,comma_depth); % lower dot and tail
2016 penlabels(1,2,3); endchar;
2017
2018 % \end{macrocode}
2019 % \end{macro}
2020 %
2021 % \begin{macro}{[}
2022 % The [ character.
2023 % \begin{macrocode}
2024
2025 cmchar "Left bracket";
2026 numeric wd#; wd#=max(5u#,4.5u#+.5if hefty:stem# else:rule_thickness# fi);
2027 beginchar("[",wd#,body_height#,paren_depth#);
2028 italcorr body_height#*slant;
2029 adjust_fit(0,0);
2030 numeric top_thickness,side_thickness;
2031 if hefty: top_thickness=vair;
2032 side_thickness=max(crisp.breadth,stem-2stem_corr);
2033 else: top_thickness=side_thickness=rule_thickness; fi;
2034 pickup crisp.nib; pos1(side_thickness,0); pos2(side_thickness,0);
2035 top y1=h; bot y2=-d; lft x1l=lft x2l=hround(2.5u-.5side_thickness)-1-eps;
2036 filldraw stroke z1e--z2e; % stem
2037 pos3(top_thickness,90); pos4(top_thickness,90);
2038 pos5(top_thickness,90); pos6(top_thickness,90);
2039 x3=x5=x1l; rt x4=rt x6=ceiling(w-.4u)+eps; y3r=y4r=y1; y5l=y6l=y2;
2040 filldraw stroke z3e--z4e; % upper bar
2041 filldraw stroke z5e--z6e; % lower bar
2042 penlabels(1,2,3,4,5,6); endchar;
2043
2044 % \end{macrocode}
2045 % \end{macro}
2046 %
2047 % \begin{macro}{]}
2048 % The ] character.
2049 % \begin{macrocode}
2050
2051 cmchar "Right bracket";
2052 numeric wd#; wd#=max(5u#,4.5u#+.5if hefty:stem# else:rule_thickness# fi);
2053 beginchar("]",wd#,body_height#,paren_depth#);
2054 italcorr body_height#*slant-2u#+.5if hefty:stem# else:rule_thickness# fi;
2055 adjust_fit(0,0);
2056 numeric top_thickness,side_thickness;
2057 if hefty: top_thickness=vair;
2058 side_thickness=max(crisp.breadth,stem-2stem_corr);
2059 else: top_thickness=side_thickness=rule_thickness; fi;
2060 pickup crisp.nib; pos1(side_thickness,0); pos2(side_thickness,0);
2061 top y1=h; bot y2=-d; rt x1r=rt x2r=hround(w-2.5u+.5side_thickness)+1+eps;
2062 filldraw stroke z1e--z2e; % stem
2063 pos3(top_thickness,90); pos4(top_thickness,90);
2064 pos5(top_thickness,90); pos6(top_thickness,90);
2065 x3=x5=x1r; lft x4=lft x6=floor .4u-eps; y3r=y4r=y1; y5l=y6l=y2;
2066 filldraw stroke z3e--z4e; % upper bar
2067 filldraw stroke z5e--z6e; % lower bar
2068 penlabels(1,2,3,4,5,6); endchar;
2069
2070 % \end{macrocode}
2071 % \end{macro}
2072 %
2073 % \begin{macro}{`}
2074 % The ` character.
2075 % \begin{macrocode}
2076
2077 cmchar "Reverse apostrophe";
2078 beginchar("`",5u#,asc_height#,0);
2079 italcorr asc_height#*slant+.5dot_size#-2u#;
2080 adjust_fit(0,0);
2081 x1-.5dot_size=hround(.5w-.5dot_size); y1+.5dot_size=h-comma_depth;
2082 if monospace: ammoc(1,a,dot_size,.28u,vround 1.5comma_depth); % large ammoc
2083 else: ammoc(1,a,dot_size,.25u,comma_depth); fi % normal ammoc
2084 penlabels(1); endchar;
2085
2086
2087 %</punct>
2088 % \end{macrocode}
2089 % \end{macro}
2090 %
2091 %
2092 % \subsection{The ligatures and dashes file}
2093 %
2094 % This is essentially a copy of the Computer Modern file.
2095 % \begin{macrocode}
2096 %<*lig>
2097 % TRJNLIG.MF This file defines characters common to
2098 % Trajan roman and slanted text fonts
2099 % that appear only when |ligs>0|.
2100
2101 % \end{macrocode}
2102 % First the ligtables.
2103 % \begin{macrocode}
2104
2105 ligtable "`": "`"=:oct"134";
2106 ligtable "'": "'"=:oct"042", "?" kern 2u#, "!" kern 2u#;
2107
2108 ligtable "-": "-"=:oct"173";
2109 ligtable oct"173": "-"=:oct"174";
2110
2111 % \end{macrocode}
2112 %
2113 % \begin{macro}{''}
2114 % The '' ligature.
2115 % \begin{macrocode}
2116
2117 cmchar "Closing quotes";
2118 beginchar(oct"042",7u#+max(2u#,dot_size#),asc_height#,0);
2119 italcorr asc_height#*slant+dot_size#-4.1u#;
2120 adjust_fit(0,0);
2121 x1-.5dot_size=hround .6u; y2+.5dot_size=h;
2122 x2-x1=hround(1.5u+max(2u,dot_size)); y2=y1;
2123 comma(1,a,dot_size,.25u,comma_depth); % left dot and tail
2124 comma(2,b,dot_size,.25u,comma_depth); % right dot and tail
2125 penlabels(1,2); endchar;
2126
2127 % \end{macrocode}
2128 % \end{macro}
2129 %
2130 % \begin{macro}{-}
2131 % The - character.
2132 % \begin{macrocode}
2133
2134 cmchar "Hyphen";
2135 beginchar("-",6u#,x_height#,0);
2136 italcorr .5x_height#*slant-.5u#;
2137 adjust_fit(0,0);
2138 numeric thickness; thickness=if hefty:bar else:.75[hair,stem] fi;
2139 pickup crisp.nib; pos1(thickness,90); pos2(thickness,90);
2140 top y1r=top y2r=vround(.5h+.5thickness); rt x2=hround(w-u)+eps;
2141 if monospace: x2=w-x1 else: lft x1=hround .2u-eps fi;
2142 filldraw stroke z1e--z2e; % bar
2143 penlabels(1,2); endchar;
2144
2145 % \end{macrocode}
2146 % \end{macro}
2147 %
2148 % \begin{macro}{``}
2149 % The `` ligature.
2150 % \begin{macrocode}
2151
2152 cmchar "Opening quotes";
2153 beginchar(oct"134",7u#+max(2u#,dot_size#),asc_height#,0);
2154 italcorr asc_height#*slant-.1u#;
2155 adjust_fit(0,0);
2156 x2+.5dot_size=hround(w-.6u); y1+.5dot_size=h-comma_depth;
2157 x2-x1=hround(1.5u+max(2u,dot_size)); y2=y1;
2158 ammoc(1,a,dot_size,.25u,comma_depth); % left dot and tail
2159 ammoc(2,b,dot_size,.25u,comma_depth); % right dot and tail
2160 penlabels(1,2); endchar;
2161
2162 % \end{macrocode}
2163 % \end{macro}
2164 %
2165 % \begin{macro}{--}
2166 % The -- ligature. I think that the CM en-dash is too thin for the
2167 % Trajan font, so I have thickened it a little.
2168 % \begin{macrocode}
2169
2170 cmchar "En dash";
2171 beginchar(oct"173",9u#,x_height#,0);
2172 italcorr .61803x_height#*slant+.5u#;
2173 adjust_fit(0,0);
2174 %%pickup crisp.nib; pos1(vair,90); pos2(vair,90);
2175 pickup crisp.nib; pos1(medium,90); pos2(medium,90);
2176 top y1r=top y2r=vround(.61803h+.5vair); lft x1=-eps; rt x2=w+eps;
2177 filldraw stroke z1e--z2e; % bar
2178 penlabels(1,2); endchar;
2179
2180 % \end{macrocode}
2181 % \end{macro}
2182 %
2183 % \begin{macro}{---}
2184 % The --- ligature. I think that the CM em-dash is too thin for the
2185 % Trajan font, so I have thickened it a little.
2186 % \begin{macrocode}
2187
2188 cmchar "Em dash";
2189 beginchar(oct"174",18u#,x_height#,0);
2190 italcorr .61803x_height#*slant+.5u#;
2191 adjust_fit(letter_fit#,letter_fit#);
2192 %%pickup crisp.nib; pos1(vair,90); pos2(vair,90);
2193 pickup crisp.nib; pos1(medium,90); pos2(medium,90);
2194 top y1r=top y2r=vround(.61803h+.5vair); lft x1=-eps; rt x2=w+eps;
2195 filldraw stroke z1e--z2e; % bar
2196 penlabels(1,2); endchar;
2197
2198
2199 %</lig>
2200 % \end{macrocode}
2201 % \end{macro}
2202 %
2203 % \subsection{Extra punctuation}
2204 %
2205 % This is an abbreviated copy of \Lpack{romanp.mf}.
2206 % \begin{macrocode}
2207 %<*xp>
2208 % TRJNROMANP.MF This file contains `\&' and `?' .
2209
2210 % \end{macrocode}
2211 %
2212 % \begin{macro}{&}
2213 % The \&{} character.
2214 % \begin{macrocode}
2215
2216 cmchar "Ampersand";
2217 beginchar("&",14u#,asc_height#,0);
2218 italcorr x_height#*slant-serif_fit# - if serifs: .4u# else: 1.5u# fi;
2219 adjust_fit(0,serif_fit#);
2220 pickup tiny.nib; pos2(slab,-90); x2=4u; bot y2r=-o;
2221 if not hefty:(x,y2l)=whatever[z2r,(w-5u,x_height)]; x2l:=x; fi
2222 if serifs: pos0(fudged.hair,0);
2223 rt x0r+jut=hround(w-.9u); top y0=x_height;
2224 pos1(fudged.hair,0); z1=whatever[z0,(.6[x0,x2],0)];
2225 y1=max(y0-1.5bracket-.2x_height,2/3x_height);
2226 filldraw stroke z0e---z1e...{left}z2e; % short diagonal
2227 else: pickup fine.nib; pos1(.25[slab,flare],-15); rt x1r=hround(w-2u);
2228 y1r=good.y .75[bar_height,x_height]; x1l:=good.x x1l; y1l:=good.y y1l;
2229 top z2'l=(x2l,tiny.top y2l); bot z2'r=(x2r,tiny.bot y2r);
2230 filldraw stroke term.e(2',1,right,1,4); fi % short diagonal and terminal
2231 pickup tiny.nib; numeric slope,theta,reduced_hair;
2232 slope=(h-2vair-slab)/10.5u; theta=angle(-slope,1);
2233 reduced_hair=max(tiny.breadth,hround(fudged.hair if hefty:-2stem_corr fi));
2234 lft x3r=hround .75u; x5=.5[x3r,x6l]; lft x6r=hround .5(w-u);
2235 x3l-x3r=curve-tiny; pos6(reduced_hair,180);
2236 pos5(vair,theta); y5=.5h;
2237 ellipse_set(2l,3l,4l,5l); ellipse_set(2r,3r,4r,5r);
2238 pos7(vair,270); top y7l=h+o; x7=.45[x6r,x8r];
2239 pos8(fudged.stem,30); x8l=good.x(x8l+3.5u-x8); y8r=y6;
2240 ellipse_set(7l,6l,5',5l);
2241 filldraw stroke z2e{left}...z3e{up}...z4e---z5e...{up}z6e
2242 ...z7e{left}...z8e{down}; % bowls
2243 pos10(slab,90); x10=w-3.5u; bot y10l=-o;
2244 pos9(fudged.stem,angle(z8-z10)-90);
2245 z9=.5[z8,z10]+(1.75u,0) rotated(angle(z8-z10)+90);
2246 filldraw stroke z8e{down}...z9e{z10-z8}...{right}z10e; % long diagonal
2247 if serifs: pickup crisp.nib; pos10'(slab,90); z10'=z10;
2248 pos11(fudged.hair,180); rt x11l=hround(w-u); y11=.5bar_height;
2249 filldraw stroke z10'e{right}...{up}z11e; % terminal
2250 numeric inner_jut; if rt x6l+.5u<lft x0l-1.5jut: inner_jut=1.5jut;
2251 else: rt x6l+.5u=lft x0l-inner_jut; fi
2252 dish_serif(0,1,a,.6,inner_jut,b,.5,jut)(dark); % serif
2253 else: pickup fine.nib; pos10'(slab,90); z10'=z10;
2254 pos11(Vround .5[slab,flare],90);
2255 rt x11=hround(r-letter_fit-u); bot y11l=vround .07bar_height-o;
2256 filldraw stroke term.e(10',11,right,1,4); fi % terminal
2257 penlabels(0,1,2,3,4,5,6,7,8,9,10,11); endchar;
2258
2259 % \end{macrocode}
2260 % \end{macro}
2261 %
2262 % \begin{macro}{?}
2263 % The ? character. I have changed this slightly because of the
2264 % of the redefinition of the |pulled_super_arc| macro.
2265 % \begin{macrocode}
2266
2267 cmchar "Question mark";
2268 beginchar("?",8.5u#,asc_height#,0);
2269 italcorr .8asc_height#*slant;
2270 adjust_fit(0,0);
2271 pickup tiny.nib; pos7(dot_size,0); pos8(dot_size,90);
2272 lft x7l=hround(.5w-.25u-.5dot_size); bot y8l=0; z7=z8; dot(7,8); % dot
2273 numeric bot_width;
2274 bot_width=if hefty:max(hround .8dot_size,fine.breadth) else: hair fi;
2275 pickup fine.nib; pos2(vair,90); pos3(curve,0);
2276 pos4(vair,-90); pos5(bot_width,0); pos6(bot_width,0);
2277 x2=x4=x5=x6=x7; rt x3r=hround(w-u); bot y6=1+.25[top y8r,x_height];
2278 top y2r=h+oo; y3=.75[y6,y2]; y4=.5[y6,y2]; y5=.1[y6,y2];
2279 {{interim superness:=more_super;
2280 %%filldraw stroke pulled_super_arc.e(2,3)(superpull) % macro changed in cpctitle.mf
2281 filldraw stroke pulled_super_arc.e(2,3,eta)
2282 & subpath (0,1) of super_arc.e(3,4) .. z5e---z6e\\}}; % arc and stem
2283 if serifs: pos1(hair,180); pos0(flare,180);
2284 lft x1r=hround u; y1=y3; bulb(2,1,0); % bulb
2285 else:
2286 pos1(Vround 5/7[vair,flare],110);
2287 lft x1r=hround u; top y1r=vround .9[y6,top y2r];
2288 filldraw stroke term.e(2,1,left,1,4);
2289 fi % terminal
2290 penlabels(0,1,2,3,4,5,6,7,8); endchar;
2291
2292
2293 %</xp>
2294 % \end{macrocode}
2295 % \end{macro}
2296 %
2297 % \section{The font definition files} \label{sec:fd}
2298 %
2299 % \begin{macrocode}
2300 %<*fdot1>
2301 \DeclareFontFamily{OT1}{trjn}{}
2302 \DeclareFontShape{OT1}{trjn}{m}{n}{ <-> trjnr10 }{}
2303 \DeclareFontShape{OT1}{trjn}{bx}{n}{ <-> sub * trjn/m/n }{}
2304 \DeclareFontShape{OT1}{trjn}{b}{n}{ <-> sub * trjn/m/n }{}
2305 \DeclareFontShape{OT1}{trjn}{m}{sl}{ <-> trjnsl10 }{}
2306 \DeclareFontShape{OT1}{trjn}{m}{it}{ <-> sub * trjn/m/sl }{}
2307 %</fdot1>
2308 % \end{macrocode}
2309 %
2310 %
2311 % \begin{macrocode}
2312 %<*fdt1>
2313 \DeclareFontFamily{T1}{trjn}{}
2314 \DeclareFontShape{T1}{trjn}{m}{n}{ <-> trjnr10 }{}
2315 \DeclareFontShape{T1}{trjn}{bx}{n}{ <-> sub * trjn/m/n }{}
2316 \DeclareFontShape{T1}{trjn}{b}{n}{ <-> sub * trjn/m/n }{}
2317 \DeclareFontShape{T1}{trjn}{m}{sl}{ <-> trjnsl10 }{}
2318 \DeclareFontShape{T1}{trjn}{m}{it}{ <-> sub * trjn/m/sl }{}
2319 %</fdt1>
2320 % \end{macrocode}
2321 %
2322 % \section{The \Lpack{trajan} package code} \label{sec:code}
2323 %
2324 % Announce the name and version of the package, which requires
2325 % \LaTeXe{}.
2326 % \begin{macrocode}
2327 %<*usc>
2328 \NeedsTeXFormat{LaTeX2e}
2329 \ProvidesPackage{trajan}[2005/06/29 v1.1 package for Trajan fonts]
2330 % \end{macrocode}
2331 %
2332 %
2333 % \begin{macro}{\trjnfamily}
2334 % Selects the Trajan font family in the T1 encoding.
2335 % \changes{v1.1}{2005/06/29}{Use T1 encoding instead of OT1}
2336 % \begin{macrocode}
2337 \newcommand{\trjnfamily}{\usefont{T1}{trjn}{m}{n}}
2338 % \end{macrocode}
2339 % \end{macro}
2340 %
2341 % \begin{macro}{\texttrjn}
2342 % Text command for the Trajan font family.
2343 % \begin{macrocode}
2344 \DeclareTextFontCommand{\texttrjn}{\trjnfamily}
2345 % \end{macrocode}
2346 % \end{macro}
2347 %
2348 % The end of this package.
2349 % \begin{macrocode}
2350 %</usc>
2351 % \end{macrocode}
2352 %
2353 % \section{The map file}
2354 %
2355 % Just a short file.
2356 % \changes{v1.1}{2005/06/29}{Added the map file}
2357 % \begin{macrocode}
2358 %<*map>
2359 trjnr10 Trajan-Roman <trjnr10.pfb
2360 trjnsl10 Trajan-Slanted <trjnsl10.pfb
2361 %</map>
2362 % \end{macrocode}
2363 %
2364 %
2365 %
2366 %
2367 % \Finale
2368 %
2369 \endinput
2370
2371 %% \CharacterTable
2372 %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
2373 %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
2374 %% Digits \0\1\2\3\4\5\6\7\8\9
2375 %% Exclamation \! Double quote \" Hash (number) \#
2376 %% Dollar \$ Percent \% Ampersand \&
2377 %% Acute accent \' Left paren \( Right paren \)
2378 %% Asterisk \* Plus \+ Comma \,
2379 %% Minus \- Point \. Solidus \/
2380 %% Colon \: Semicolon \; Less than \<
2381 %% Equals \= Greater than \> Question mark \?
2382 %% Commercial at \@ Left bracket \[ Backslash \\
2383 %% Right bracket \] Circumflex \^ Underscore \_
2384 %% Grave accent \` Left brace \{ Vertical bar \|
2385 %% Right brace \} Tilde \~}
2386
2387