Debian Codegraph @

texmf-dist/source/fonts/auncial-new/aunclmft.dtx

raw
1 % \iffalse meta-comment
2 %
3 % aunclmft.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 % If you do not have the docmfp package (available from CTAN in
22 % tex-archive/macros/latex/contrib/supported), comment out the
23 % \usepackage{docmfp} line below and uncomment the line following it.
24 %
25 %<*driver>
26 \documentclass[twoside]{ltxdoc}
27 \usepackage{docmfp}
28 %%%%%% \providecommand{\DescribeVariable}[1]{} \newenvironment{routine}[1]{}{}
29 \usepackage{url}
30 \usepackage[draft=false,
31 plainpages=false,
32 pdfpagelabels,
33 bookmarksnumbered,
34 hyperindex=false
35 ]{hyperref}
36 \providecommand{\phantomsection}{}
37 \OnlyDescription %% comment this out for the full glory
38 \EnableCrossrefs
39 \CodelineIndex
40 \setcounter{StandardModuleDepth}{1}
41 \makeatletter
42 \@mparswitchfalse
43 \makeatother
44 \renewcommand{\MakeUppercase}[1]{#1}
45 \pagestyle{headings}
46 \newenvironment{addtomargins}[1]{%
47 \begin{list}{}{%
48 \topsep 0pt%
49 \addtolength{\leftmargin}{#1}%
50 \addtolength{\rightmargin}{#1}%
51 \listparindent \parindent
52 \itemindent \parindent
53 \parsep \parskip}%
54 \item[]}{\end{list}}
55 \begin{document}
56 \raggedbottom
57 \DocInput{aunclmft.dtx}
58 \end{document}
59 %</driver>
60 %
61 % \fi
62 %
63 % \CheckSum{132}
64 %
65 % \DoNotIndex{\',\.,\@M,\@@input,\@addtoreset,\@arabic,\@badmath}
66 % \DoNotIndex{\@centercr,\@cite}
67 % \DoNotIndex{\@dotsep,\@empty,\@float,\@gobble,\@gobbletwo,\@ignoretrue}
68 % \DoNotIndex{\@input,\@ixpt,\@m}
69 % \DoNotIndex{\@minus,\@mkboth,\@ne,\@nil,\@nomath,\@plus,\@set@topoint}
70 % \DoNotIndex{\@tempboxa,\@tempcnta,\@tempdima,\@tempdimb}
71 % \DoNotIndex{\@tempswafalse,\@tempswatrue,\@viipt,\@viiipt,\@vipt}
72 % \DoNotIndex{\@vpt,\@warning,\@xiipt,\@xipt,\@xivpt,\@xpt,\@xviipt}
73 % \DoNotIndex{\@xxpt,\@xxvpt,\\,\ ,\addpenalty,\addtolength,\addvspace}
74 % \DoNotIndex{\advance,\Alph,\alph}
75 % \DoNotIndex{\arabic,\ast,\begin,\begingroup,\bfseries,\bgroup,\box}
76 % \DoNotIndex{\bullet}
77 % \DoNotIndex{\cdot,\cite,\CodelineIndex,\cr,\day,\DeclareOption}
78 % \DoNotIndex{\def,\DisableCrossrefs,\divide,\DocInput,\documentclass}
79 % \DoNotIndex{\DoNotIndex,\egroup,\ifdim,\else,\fi,\em,\endtrivlist}
80 % \DoNotIndex{\EnableCrossrefs,\end,\end@dblfloat,\end@float,\endgroup}
81 % \DoNotIndex{\endlist,\everycr,\everypar,\ExecuteOptions,\expandafter}
82 % \DoNotIndex{\fbox}
83 % \DoNotIndex{\filedate,\filename,\fileversion,\fontsize,\framebox,\gdef}
84 % \DoNotIndex{\global,\halign,\hangindent,\hbox,\hfil,\hfill,\hrule}
85 % \DoNotIndex{\hsize,\hskip,\hspace,\hss,\if@tempswa,\ifcase,\or,\fi,\fi}
86 % \DoNotIndex{\ifhmode,\ifvmode,\ifnum,\iftrue,\ifx,\fi,\fi,\fi,\fi,\fi}
87 % \DoNotIndex{\input}
88 % \DoNotIndex{\jobname,\kern,\leavevmode,\let,\leftmark}
89 % \DoNotIndex{\list,\llap,\long,\m@ne,\m@th,\mark,\markboth,\markright}
90 % \DoNotIndex{\month,\newcommand,\newcounter,\newenvironment}
91 % \DoNotIndex{\NeedsTeXFormat,\newdimen}
92 % \DoNotIndex{\newlength,\newpage,\nobreak,\noindent,\null,\number}
93 % \DoNotIndex{\numberline,\OldMakeindex,\OnlyDescription,\p@}
94 % \DoNotIndex{\pagestyle,\par,\paragraph,\paragraphmark,\parfillskip}
95 % \DoNotIndex{\penalty,\PrintChanges,\PrintIndex,\ProcessOptions}
96 % \DoNotIndex{\protect,\ProvidesClass,\raggedbottom,\raggedright}
97 % \DoNotIndex{\refstepcounter,\relax,\renewcommand,\reset@font}
98 % \DoNotIndex{\rightmargin,\rightmark,\rightskip,\rlap,\rmfamily,\roman}
99 % \DoNotIndex{\roman,\secdef,\selectfont,\setbox,\setcounter,\setlength}
100 % \DoNotIndex{\settowidth,\sfcode,\skip,\sloppy,\slshape,\space}
101 % \DoNotIndex{\symbol,\the,\trivlist,\typeout,\tw@,\undefined,\uppercase}
102 % \DoNotIndex{\usecounter,\usefont,\usepackage,\vfil,\vfill,\viiipt}
103 % \DoNotIndex{\viipt,\vipt,\vskip,\vspace}
104 % \DoNotIndex{\wd,\xiipt,\year,\z@}
105 %
106 % \changes{v1.0}{1999/05/22}{First public release}
107 % \changes{v2.0}{2005/11/27}{Major rewrite}
108 %
109 % \def\fileversion{v1.0} \def\filedate{1999/05/22}
110 % \def\fileversion{v2.0} \def\filedate{2005/11/27}
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 % \newcommand*{\AD}{\textsc{ad}}
118 % \newcommand*{\thisfont}{Artificial Uncial}
119 %
120 % \title{\Lpack{Artificial Uncial}: MetaFont driver code\thanks{This
121 % file has version number \fileversion, last revised
122 % \filedate.}}
123 %
124 % \author{%
125 % Peter Wilson\footnote{\texttt{herries dot press at earthlink dot net}}\\
126 % Herries Press }
127 % \date{\filedate}
128 % \maketitle
129 % \begin{abstract}
130 % The \Lpack{auncial} bundle provides a PostScript Type1 set of
131 % \thisfont{} bookhands
132 % as used
133 % for manuscripts in the 6th to the 10th century. This is one in a series
134 % of manuscript fonts.
135 %
136 % This document contains the MetaFont driver code.
137 % \end{abstract}
138 % \tableofcontents
139 % \listoftables
140 %
141 %
142 %
143 % \section{Introduction}
144 %
145 % The \Lpack{auncial} bundle provides a PostScript Type1 version of a
146 % Metafont~\cite{METAFONT} rendition
147 % of the \thisfont{} manuscript book-hand that was in use between about the
148 % sixth and tenth centuries~\AD. It is part of a project to provide fonts
149 % covering the major manuscript hands between the first century~\AD{} and
150 % the invention of printing.
151 %
152 % This document contains the MetaFont driver code.
153 %
154 % This manual is typeset according to the conventions of the
155 % \LaTeX{} \textsc{docstrip} utility which enables the automatic
156 % extraction of the \LaTeX{} macro source files~\cite{GOOSSENS94}.
157 % The \Lpack{docmfp} package is used for documenting the Metafont portions
158 % of the distribution~\cite{DOCMFP}.
159 %
160 % \section{The Metafont code} \label{sec:mf}
161 %
162 %
163 % As previously noted, this work is part of a larger project to provide
164 % fonts covering the main manuscript book-hands. As such, one of the
165 % aims is to produce a coordinated set of fonts, especially as multiple
166 % hands might be used in a single document.
167 %
168 % Noting that the hands tend to be somewhat larger than the typical 10pt
169 % size (where the x-height is approximately 1.5mm) used for modern books,
170 % I have also designed the fonts
171 % at a larger than normal size, then applied some non-linear factors when reducing
172 % them down to a 10pt size.
173 % Further, I have used the height of the Carolingian minuscule as a
174 % normalising factor when deciding on the absolute height of any particular
175 % script. The x-height of the Carolingian font is made equal to the
176 % x-height of the Computer Modern Roman (CMR) font.
177 %
178 % Modern fonts are effectively drawn. That is, the outline of the letter is
179 % drawn carefully and the center is filled with ink. This is shown to good
180 % effect in the Metafont code for the Computer Modern fonts~\cite{CM}.
181 % In contrast, the manuscript letters were inked by single pen strokes in
182 % a calligraphic manner. I have tried to repeat this calligraphic style
183 % in the Metafont code.
184 %
185 % As much as possible I have tried to use parameter values from the
186 % Computer Modern Roman (CMR) fonts in order to reduce possible
187 % infelicities if the CM and manuscript fonts are used together. However,
188 % few of the CMR parameters are applicable to the calligraphic style.
189 %
190 %
191 % \StopEventually{
192 % \bibliographystyle{alpha}
193 % \renewcommand{\refname}{Bibliography}
194 % \begin{thebibliography}{GMS94}
195 % \addcontentsline{toc}{section}{\refname}
196 %
197 % \bibitem[And69]{ANDERSON69}
198 % Donald M.~Anderson.
199 % \newblock \emph{The Art of Written Forms: The Theory and Practice of Calligraphy}.
200 % \newblock Holt, Rinehart and Winston, 1969.
201 %
202 % \bibitem[Bol95]{BOLOGNA95}
203 % Giulia Bologna.
204 % \newblock \emph{Illuminated Manuscripts: The Book before Gutenberg}.
205 % \newblock Crescent Books, 1995.
206 %
207 % \bibitem[Day95]{DAY95}
208 % Lewis F.~Day.
209 % \newblock \emph{Alphabets Old \& New}.
210 % \newblock (3rd edition originally published by B.~T.~Batsford, 1910)
211 % \newblock Senate, 1995.
212 %
213 % \bibitem[Dro80]{DROGIN80}
214 % Marc Drogin.
215 % \newblock \emph{Medieval Calligraphy: Its History and Technique}.
216 % \newblock Allenheld, Osmun \& Co., 1980.
217 %
218 % \bibitem[Dru95]{DRUCKER95}
219 % Johanna Drucker.
220 % \newblock \emph{The Alphabetic Labyrinth}.
221 % \newblock Thames \& Hudson, 1995.
222 %
223 % \bibitem[Fir93]{FIRMAGE93}
224 % Richard A.~Firmage.
225 % \newblock \emph{The Alphabet Abecedarium}.
226 % \newblock David R~Goodine, 1993.
227 %
228 % \bibitem[Fli98]{LETTRINE}
229 % Daniel Flipo.
230 % \newblock \emph{The LETTRINE package}.
231 % \newblock (Available from CTAN in \texttt{macros/latex/contrib/supported}).
232 % \newblock 1998.
233 %
234 % \bibitem[Har95]{HARRIS95}
235 % David Harris.
236 % \newblock \emph{The Art of Calligraphy}.
237 % \newblock DK Publishing, 1995.
238 %
239 % \bibitem[Jen95]{BETON}
240 % Frank Jensen.
241 % \newblock \emph{The BETON package}.
242 % \newblock (Available from CTAN in \texttt{macros/latex/contrib/supported}).
243 % \newblock 1995.
244 %
245 % \bibitem[Joh71]{JOHNSTON75}
246 % Edward Johnston (ed. Heather Child).
247 % \newblock \emph{Formal Penship and Other Papers}.
248 % \newblock Penthalic, 1971.
249 %
250 % \bibitem[Knu87]{CM}
251 % Donald E.~Knuth.
252 % \newblock \emph{Computer Modern Typefaces}.
253 % \newblock Addison-Wesley, 1987.
254 %
255 % \bibitem[Knu92]{METAFONT}
256 % Donald E.~Knuth.
257 % \newblock \emph{The METAFONTbook}.
258 % \newblock Addison-Wesley, 1992.
259 %
260 % \bibitem[GMS94]{GOOSSENS94}
261 % Michel Goossens, Frank Mittelbach, and Alexander Samarin.
262 % \newblock \emph{The LaTeX Companion}.
263 % \newblock Addison-Wesley Publishing Company, 1994.
264 %
265 % \bibitem[Tho75]{THOMAS75}
266 % Alan G.~Thomas.
267 % \newblock \emph{Great Books and Book Collectors}.
268 % \newblock Weidenfield and Nichoson, 1975.
269 %
270 % \bibitem[Wil99]{DOCMFP}
271 % Peter R.~Wilson.
272 % \newblock \emph{The DOCMFP Package}.
273 % \newblock (Available from CTAN in \texttt{macros/latex/contrib/supported}).
274 % \newblock 1999.
275 %
276 % \bibitem[Wil99b]{ROMANNUM}
277 % Peter R.~Wilson.
278 % \newblock \emph{The ROMANNUM Package}.
279 % \newblock (Available from CTAN in \texttt{macros/latex/contrib/supported}).
280 % \newblock 1999.
281 %
282 % \end{thebibliography}
283 % \PrintIndex
284 % }
285 %
286 % \section{The driver file}
287 %
288 % The driver file sets up the font parameters and also contains
289 % the macros used in the definition of the characters.
290 %
291 % \begin{macrocode}
292 %<*mfd>
293 % This is UNCLTITLE.MF for the Artificial Uncial font.
294 % This file also contains special macros universally needed in the
295 % font but either not in the cmbase.mf file or modifications of these.
296 %
297 % \end{macrocode}
298 %
299 % \begin{routine}{makebox}
300 % This is a new version of the \Lpack{cmbase.mf} |makebox| macro.
301 % Essentially, as we are only generating a single case font, we don't
302 % need all the horizontals for the CMR characters.
303 %
304 % \begin{macrocode}
305 %%% A new version of cmbase.mf makebox macro
306 def makebox(text rule) =
307 for y=0,half_height,cap_height,body_height,x_height,asc_height,-desc_depth,-body_depth:
308 rule((l,y)t_,(r,y)t_); endfor % horizontals
309 for x=l,r: rule((x,-body_depth)t_,(x,body_height)t_); endfor % verticals
310 for x=u*(1+floor(1/u)) step u until r-1:
311 rule((x,-body_depth)t_,(x,body_height)t_); endfor % more verticals
312 if charic<>0:
313 rule((r+charic*pt,h.o_),(r+charic*pt,.5h.o_)); fi % italic correction
314 enddef;
315
316 % \end{macrocode}
317 % \end{routine}
318 %
319 % \begin{routine}{proofpcbb}
320 % The macro |proofpcbb(S, xoff, yoff)| draws crosses at the corners of the
321 % square, and at the bottom and top midpoints, where the point |zS| is at
322 % position |(xoff,yoff)| in the square.
323 % \begin{macrocode}
324 %%% A macro to delineate a letter's bounding square in proof mode.
325 %%% Point z$ is at (xoff,yoff) in the bounding square.
326 def proofpcbb(suffix $)(expr xoff, yoff) =
327 if proofing > 0:
328 x$bl = x$ - xoff; y$bl = y$ - yoff; % Bottom Left Hand Corner
329 z$br = (x$bl+side, y$bl); % BRHC
330 z$tr = (x$bl+side, y$bl+side); % TRHC
331 z$tl = (x$bl, y$bl+side); % TLHC
332 z$bc = 1/2[z$bl,z$br]; z$tc = 1/2[z$tl,z$tr]; % horizontal mid points
333 pair hc, vc;
334 hc = (2u,0); vc = (0,2u);
335 pickup pensquare scaled 2;
336 for s = z$bl, z$br, z$tr, z$tl, z$bc, z$tc:
337 draw s-hc--s+hc;
338 draw s-vc--s+vc;
339 endfor
340 fi
341 enddef;
342
343 % \end{macrocode}
344 % \end{routine}
345 %
346 %
347 %
348 % \begin{routine}{auncial_font_setup}
349 % This macro contains the set up for the \thisfont{} fonts.
350 % \begin{macrocode}
351 def auncial_font_setup= % contains special stuff for auncial fonts
352 define_pixels(side,half_height,carol_height,comma_width);
353 define_pixels(u,dot_size,letter_size,cap_height,width_adj,serif_fit,
354 cap_serif_fit,jut,cap_jut);
355 define_pixels(fig_width);
356 define_whole_pixels(letter_fit);
357 define_whole_vertical_pixels(body_height,asc_height,cap_height,x_height,
358 desc_depth,body_depth,fig_height,
359 accent_ysize,accent_gap);
360 define_corrected_pixels(o);
361 define_blacker_pixels(thick,thin,accent_thickness);
362 let adjust_fit = normal_adjust_fit;
363 % \end{macrocode}
364 % \DescribeVariable{stylus}
365 % The pen for drawing the thinnest lines is |stylus|.
366 % \begin{macrocode}
367 pickup pencircle scaled thin;
368 stylus:=savepen;
369 % \end{macrocode}
370 % \DescribeVariable{thickstylus}
371 % The pen for drawing lines a bit thicker than the thinnest is |thickstylus|.
372 % \begin{macrocode}
373 pickup pencircle scaled (1.5thin);
374 thickstylus:=savepen;
375 % \end{macrocode}
376 % \DescribeVariable{accentpen}
377 % The pen for drawing the typical accent is |accentpen|.
378 % \begin{macrocode}
379 pickup pencircle xscaled 1/2thick yscaled thin rotated pangle;
380 accentpen:=savepen;
381 % \end{macrocode}
382 % \DescribeVariable{quill}
383 % The normal calligraphic pen is |quill|.
384 % \begin{macrocode}
385 pickup pencircle xscaled thick yscaled thin rotated pangle;
386 quill:=savepen;
387 numeric pcshiftx#; % x value of LHS of box wrt origin of char box
388 define_pixels(pcshiftx);
389 numeric sqxside#; % x size of the square
390 numeric sqyside#; % y size of the square
391 define_pixels(sqxside,sqyside);
392
393 enddef; % end of auncial_font_setup
394
395 % \end{macrocode}
396 % \end{routine}
397 %
398 %
399 % \DescribeVariable{ductus}
400 % A boolean to control drawing the ductus (TRUE) or the full letter (FALSE).
401 % \begin{macrocode}
402 boolean ductus;
403 ductus:=false;
404 % \end{macrocode}
405 %
406 % \DescribeVariable{qhor}
407 % \DescribeVariable{qvert}
408 % The cosine and sine of the pen angle.
409 % \begin{macrocode}
410 numeric qhor, qvert;
411 qhor:=cosd(pangle); qvert:=sind(pangle);
412 % \end{macrocode}
413 %
414 % \DescribeVariable{pdir}
415 % The vector corresponding to the pen angle.
416 % \begin{macrocode}
417 pair pdir; pdir=dir(pangle);
418 % \end{macrocode}
419 %
420 % \DescribeVariable{ppdir}
421 % The vector that is perpendicular (anticlockwise) to the pen angle.
422 % \begin{macrocode}
423 pair ppdir; ppdir=dir(pangle+90);
424
425 % \end{macrocode}
426 %
427 %
428 % \begin{routine}{draw_serif}
429 % A macro to draw a serif. |draw_serif(1,2,f)| uses the current pen to
430 % draw a serif of extent |jut| at |z1| to the left of the line from |z2|
431 % to |z1|. The
432 % radius is controlled by |f|, where $0<f<1$. The `stem' from |z1| to |z2|
433 % starts at the point |z1a|.
434 % \begin{macrocode}
435 def draw_serif(suffix $, $$)(expr fr)=
436 numeric beta, ajut, bjut;
437 % \end{macrocode}
438 % |fr| and |beta| control the serif radius.
439 % \begin{macrocode}
440 beta=1-fr;
441 ajut=fr*jut; bjut=beta*jut;
442 % \end{macrocode}
443 % The points |$c|, |$b| and |$a| define the serif. For a top (bottom) serif
444 % the leftmost (rightmost) point is
445 % |$c| and |$a| is on the stem. |$a| is moved from |$| towards |$$| by the
446 % distance |ajut|, and the other points are calculated from this. If the stem
447 % is not vertical, then we have to rotate |$b| to match.
448 % \begin{macrocode}
449 pair vec[]; vec1=unitvector(z$$-z$);
450 vec2=ajut*vec1;
451 z$a=z$ shifted vec2;
452 z$b=z$a rotatedaround (z$,-90);
453 boolean top_serif;
454 if y$>y$$:
455 top_serif := true;
456 z$c=z$b shifted (-bjut*pdir);
457 else:
458 top_serif:=false;
459 z$c=z$b shifted (bjut*pdir);
460 fi
461 % \end{macrocode}
462 % Draw the parts, and finish off.
463 % \begin{macrocode}
464 if top_serif:
465 draw z$c--z$b{pdir}..{z$$-z$}z$a; % the serif
466 else:
467 draw z$c--z$b{-pdir}..{z$$-z$}z$a;
468 fi
469 labels($a,$b,$c);
470 enddef; % end of draw_serif
471
472 % \end{macrocode}
473 % \end{routine}
474 %
475 % \begin{routine}{draw_istem}
476 % A macro to draw the shape of an i. |draw_istem(1,2,f)| draws a stem whose
477 % top is at |z1| and bottom at |z2|. It draws with the current pen and the serifs
478 % are of extent |jut|. There is a top left and bottom right serif.
479 % The serif radius is controlled by |f|, with $0<f<1$.
480 % \begin{macrocode}
481 def draw_istem(suffix $, $$)(expr fr)=
482 draw_serif($, $$, fr); % top serif
483 draw_serif($$, $, fr); % bottom serif
484 draw z$a--z$$a; % the stem
485 enddef; % end of draw_istem
486
487 % \end{macrocode}
488 % \end{routine}
489 %
490 % \begin{routine}{draw_tstem}
491 % A macro to draw the shape of the stem of a `t'. |draw_tstem(1,2,f)| draws a
492 % stem whose
493 % top is at |z1| and bottom at |z2| with a right serif at |z2|. The radius
494 % is controlled by |f|, with $0 < f < 1$.
495 % It draws with the current pen and the serif is of extent |jut|.
496 % \begin{macrocode}
497 def draw_tstem(suffix $, $$)(expr fr)=
498 draw_serif($$, $, fr); % the serif
499 draw z$--z$$a; % the stem
500 enddef; % end of draw_tstem
501
502 % \end{macrocode}
503 % \end{routine}
504 %
505 % \begin{routine}{draw_tlserif}
506 % A macro to draw a top left serif. |draw_tlserif(1,2,f)| draws a serif on top
507 % of a stem whose absolute
508 % top is at |z1| and bottom at |z2|. It draws with the current pen and the serif
509 % is of extent |jut|. It also draws the stem to the point |z2|. The serif
510 % radius is controlled by |f|, with $0<f<1$.
511 % \begin{macrocode}
512 def draw_tlserif(suffix $, $$)(expr fr)=
513 draw_serif($, $$, fr); % the serif
514 draw z$a--z$$; % the stem
515 enddef; % end of draw_tlserif
516
517 % \end{macrocode}
518 % \end{routine}
519 %
520 %
521 % \begin{routine}{draw_flick}
522 % A macro to draw a flick (like an eyebrow).
523 % |draw_flick(1,rise,fall,fjut)| draws a stroke starting at |z1| rising up by
524 % |rise| and falling down by |fall| wrt |z1|. The overall stroke distance is
525 % |fjut| to the right of |z1|. It is drawn with the current pen.
526 % \begin{macrocode}
527 def draw_flick(suffix $)(expr rise, fall, fjut)=
528 % \end{macrocode}
529 % The points |z$a| and |z$b|, together with |z$| make up three points on the
530 % ductus.
531 % \begin{macrocode}
532 rt x$b = x1+fjut; top y$b=y$-fall;
533 x$a=0.5[x$,x$b]; top y$a=y$+rise;
534 % \end{macrocode}
535 % Draw the part, and finish off.
536 % \begin{macrocode}
537 draw z$..z$a..z$b;
538 labels($a,$b);
539 enddef; % end of draw_flick
540
541 % \end{macrocode}
542 % \end{routine}
543 %
544 %
545 % \begin{routine}{draw_wave}
546 % A macro to draw a (horizontal) stroke with a flick at each end
547 % (down at the left and up at the right). |draw_wave(1,2,f)| uses the current
548 % pen to draw from |z1wl| to |z1wr|, where |x1wl=x1|, |y1wl=y1-f|, and
549 % |x1wr=x2|, |y1wr=y2+f|, with |z1| assumed to be at the left of |z2|.
550 % \begin{macrocode}
551 def draw_wave(suffix $,$$)(expr f)=
552 x$wl=x$; y$wl=y$-f;
553 x$wr=x$$; y$wr=y$$+f;
554 z$wc=0.5[z$wl,z$wr];
555 draw z$wl{pdir}..z$wc{right}..{pdir}z$wr;
556 labels($wl,$wc,$wr);
557 enddef; % end of draw_wave
558
559 % \end{macrocode}
560 % \end{routine}
561 %
562 % \begin{routine}{draw_tail}
563 % A macro to draw a tail at the bottom of a (vertical) stem.
564 % |draw_tail(1,fjut)| draws a tail at the bottom of the stem which ends at |z1|.
565 % The depth is controlled by the |desc_depth| value and the jut by |fjut|.
566 % \begin{macrocode}
567 def draw_tail(suffix $)(expr fj)=
568 pen oldpen; oldpen:=currentpen;
569 pickup quill;
570 x$tl' = lft x$; y$tl=bot y$;
571 pickup stylus;
572 lft x$tl=x$tl';
573 x$tb=x$tl-fj; bot y$tb=y$tl-1/2desc_depth;
574 filldraw z${down}..{-pdir}z$tb & z$tb{pdir}..{up}z$tl--cycle;
575 pickup oldpen;
576 labels($tb,$tl);
577 enddef; % end of draw_tail
578
579 % \end{macrocode}
580 % \end{routine}
581 %
582 % \begin{routine}{draw_triangle}
583 % A macro to draw a downward pointing equilateral triangle.
584 % |draw_triangle(1,sz)| draws a triangle of side length with |z1| in the middle
585 % of the base.
586 % \begin{macrocode}
587 def draw_triangle(suffix $)(expr sz)=
588 pen oldpen; oldpen:=currentpen;
589 pickup stylus;
590 x$t1=x$-sz/2; x$t3=x$+sz/2;
591 y$t1=y$t3=y$;
592 x$t2=x$; y$t2=y$-0.9sz; % approx sqrt(3)/2
593 filldraw z$t1--z$t2--z$t3--cycle;
594 pickup oldpen;
595 labels($t1,$t2,$t3);
596 enddef; % end of draw_triangle
597
598 % \end{macrocode}
599 % \end{routine}
600 %
601 % \begin{routine}{draw_rtriangle}
602 % A macro to draw a downward pointing right angled triangle.
603 % |draw_triangle(1,sz)| draws a triangle of side length with |z1| at the
604 % right (where the right angle is).
605 % \begin{macrocode}
606 def draw_rtriangle(suffix $)(expr sz)=
607 pen oldpen; oldpen:=currentpen;
608 pickup stylus;
609 x$t1=x$-sz; rt x$t3=x$;
610 y$t1=y$t3=y$;
611 x$t2=x$t3; y$t2=y$-sz;
612 filldraw z$t1--z$t2--z$t3--cycle;
613 pickup oldpen;
614 labels($t1,$t2,$t3);
615 enddef; % end of draw_rtriangle
616
617 % \end{macrocode}
618 % \end{routine}
619 %
620 % \begin{routine}{draw_rutriangle}
621 % A macro to draw an upward pointing right angled triangle.
622 % |draw_triangle(1,sz)| draws a triangle of side length with |z1| at the
623 % right (where the right angle is).
624 % \begin{macrocode}
625 def draw_rutriangle(suffix $)(expr sz)=
626 pen oldpen; oldpen:=currentpen;
627 pickup stylus;
628 x$t1=x$-sz; rt x$t3=x$;
629 y$t1=y$t3=y$;
630 x$t2=x$t3; y$t2=y$+sz;
631 filldraw z$t1--z$t2--z$t3--cycle;
632 pickup oldpen;
633 labels($t1,$t2,$t3);
634 enddef; % end of draw_rutriangle
635
636 % \end{macrocode}
637 % \end{routine}
638 %
639 % \begin{routine}{draw_fork}
640 % A macro to draw a forked line.
641 % |draw_fork(1,2,sz)| draws a graduated line from |z1| to |z2| with a forked
642 % end of size |sz|.
643 % \begin{macrocode}
644 def draw_fork(suffix $, $$)(expr sz)=
645 pen oldpen; oldpen:=currentpen;
646 pickup quill;
647 x$f1'=lft x$; y$f1'=bot y$;
648 x$f3'=rt x$; y$f3'=top y$;
649 pickup stylus;
650 lft x$f1=x$f1'; bot y$f1=y$f1';
651 rt x$f3=x$f3'; y$f3-y$=2*(y$-y$f1);
652 rt x$f2=x$$-sz; bot y$f2=y$$;
653 rt x$f4= rt x$f5=x$$;
654 bot y$f5=y$$-sz; top y$f4=y$$+1/2sz;
655 filldraw z$f1--z$f2--z$f3--cycle; % the line
656 draw z$f2{right}..z$f4; % upper fork
657 draw z$f2{right}..z$f5; % lower fork
658 pickup oldpen;
659 labels($f1,$f2,$f3,$f4,$f5);
660 enddef; % end of draw_fork
661
662 % \end{macrocode}
663 % \end{routine}
664 %
665 % \begin{routine}{draw_pdot}
666 % A macro to draw a period dot.
667 % |draw_pdot(1,sz)| uses |stylus| to draw a dot centered at |z1| of overall size |sz|.
668 % \begin{macrocode}
669 def draw_pdot(suffix $)(expr sz)=
670 % \end{macrocode}
671 % Draw a square rotated 45 degrees.
672 % \begin{macrocode}
673 z$s = z$ shifted (0.5sz*left);
674 z$t = z$ shifted (0.5sz*up);
675 z$u = z$s shifted (sz*right);
676 z$v = z$t shifted (sz*down);
677 pickup stylus;
678 filldraw z$s--z$t--z$u--z$v--cycle;
679 labels($s,$t,$u,$v);
680 enddef; % end of draw_pdot
681
682 % \end{macrocode}
683 % \end{routine}
684 %
685 % \begin{routine}{draw_pcomma}
686 % A macro to draw a period comma.
687 % |draw_pcomma(1,t,w)| draws a comma placed at |z1| (the top), line width is |t|
688 % and bottom of line is |w| horizontally from |z1|. The pen is |stylus|.
689 % \begin{macrocode}
690 def draw_pcomma(suffix $)(expr sz, ar)=
691 % \end{macrocode}
692 % Draw a line of at |z$| of width |sz| sloping back and down at 45 degrees
693 % for a total width of |ar|.
694 % \begin{macrocode}
695 z$s = z$ shifted (0.5sz*left);
696 z$t = z$s shifted (sz*right);
697 x$v=x$s-ar; y$v=y$s-ar;
698 z$u = z$v shifted (sz*right);
699 pickup stylus;
700 filldraw z$s--z$t--z$u--cycle;
701 labels($s,$t,$u,$v);
702 enddef; % end of draw_pcomma
703
704 % \end{macrocode}
705 % \end{routine}
706 %
707 % \begin{routine}{draw_plq}
708 % A macro to draw a period left quote.
709 % |draw_plq(1,t,w)| draws a left quote placed at |z1| (the top), line width is |t|
710 % and bottom of line is |w| horizontally from |z1|.
711 % \begin{macrocode}
712 def draw_plq(suffix $)(expr sz, ar)=
713 % \end{macrocode}
714 % Draw a line of at |z$| of width |sz| sloping forward and down at 45 degrees
715 % for a total width of |ar|.
716 % \begin{macrocode}
717 z$s = z$ shifted (0.5sz*left);
718 z$t = z$s shifted (sz*right);
719 x$v=x$s+ar; y$v=y$s-ar;
720 z$u = z$v shifted (sz*right);
721 pickup stylus;
722 filldraw z$s--z$t--z$v--cycle;
723 labels($s,$t,$u,$v);
724 enddef; % end of draw_plq
725
726 % \end{macrocode}
727 % \end{routine}
728 %
729 % \begin{routine}{draw_small_zero}
730 % A macro to draw a (small) zero.
731 % |draw_small_zero(1,2)|, bottom left at |z1|, top right at |z2|.
732 % \begin{macrocode}
733 def draw_small_zero(suffix $, $$)=
734 x$szt=x$szb=1/2[x$,x$$]; x$szr=x$$; x$szl=x$;
735 y$szt=y$$; y$szb=y$; y$szl=y$szr=1/2[y$,y$$];
736 draw z$szt..z$szr..z$szb..z$szl..cycle;
737 labels($,$szt,$szr,$szb,$szl);
738 enddef; % end of draw_small_zero
739
740 % \end{macrocode}
741 % \end{routine}
742 %
743 % \subsection{Routines for accents}
744 %
745 % The next set of routines are for drawing accents and other decorations.
746 %
747 % \begin{routine}{draw_grave}
748 % A macro to draw a grave accent.
749 % |draw_grave(1)|, top at z1, angle |accent_angle|,
750 % with total drop of |accent_ysize|.
751 % \begin{macrocode}
752 def draw_grave(suffix $)=
753 pen oldpen; oldpen:=currentpen; pickup accentpen;
754 x$gab = x$ + accent_ysize*cos_accent_angle;
755 y$gab = y$ - accent_ysize*sin_accent_angle;
756 z$gam = 1/2[z$,z$gab];
757 draw z$--z$gab;
758 pickup oldpen;
759 labels($,$gam,$gab);
760 enddef; % end of draw_grave
761
762 % \end{macrocode}
763 % \end{routine}
764 %
765 % \begin{routine}{draw_acute}
766 % A macro to draw an acute accent.
767 % |draw_acute(1)|, top at z1, angle |accent_angle|,
768 % with total drop of |accent_ysize|.
769 % \begin{macrocode}
770 def draw_acute(suffix $)=
771 pen oldpen; oldpen:=currentpen; pickup accentpen;
772 x$aab = x$ - accent_ysize*cos_accent_angle;
773 y$aab = y$ - accent_ysize*sin_accent_angle;
774 z$aam = 1/2[z$,z$aab];
775 draw z$--z$aab;
776 pickup oldpen;
777 labels($,$aab,$aam);
778 enddef; % end of draw_acute
779
780 % \end{macrocode}
781 % \end{routine}
782 %
783 % \begin{routine}{draw_circumflex}
784 % A macro to draw a circumflex accent.
785 % |draw_circumflex(1)|, bottom at z1, angles |accent_angle|, with total drop of
786 % |accent_ysize|.
787 % \begin{macrocode}
788 def draw_circumflex(suffix $)=
789 pen oldpen; oldpen:=currentpen; pickup accentpen;
790 x$cabl = x$ - accent_ysize*cos_accent_angle; x$cabr - x$ = x$ - x$cabl;
791 y$cabl = y$cabr = y$;
792 y$catm = y$ + accent_ysize*sin_accent_angle;
793 x$catm = x$;
794 draw z$cabl--z$catm--z$cabr;
795 pickup oldpen;
796 labels($,$cabl,$cabr,$catm);
797 enddef; % end of draw_circumflex
798
799 % \end{macrocode}
800 % \end{routine}
801 %
802 % \begin{routine}{draw_hachek}
803 % A macro to draw a caron/hachek accent.
804 % |draw_hachek(1)|, bottom at z1, angles |accent_angle|, with total drop of
805 % |accent_ysize|.
806 % \begin{macrocode}
807 def draw_hachek(suffix $)=
808 pen oldpen; oldpen:=currentpen; pickup accentpen;
809 x$hatl = x$ - accent_ysize*cos_accent_angle; x$hatr - x$ = x$ - x$hatl;
810 y$hatl = y$hatr = y$ + accent_ysize*sin_accent_angle;
811 draw z$hatl--z$--z$hatr;
812 pickup oldpen;
813 labels($,$hatl,$hatr);
814 enddef; % end of draw_hachek
815
816 % \end{macrocode}
817 % \end{routine}
818 %
819 % \begin{routine}{draw_breve}
820 % A macro to draw a breve accent (a rounded hachek).
821 % |draw_breve(1)|, bottom at z1, angles |accent_angle|, with total drop of
822 % |accent_ysize|.
823 % \begin{macrocode}
824 def draw_breve(suffix $)=
825 pen oldpen; oldpen:=currentpen; pickup accentpen;
826 x$batl = x$ - accent_ysize*cos_accent_angle; x$batr - x$ = x$ - x$batl;
827 y$batl = y$batr = y$ + accent_ysize*sin_accent_angle;
828 draw z$batl..z$..z$batr;
829 pickup oldpen;
830 labels($,$batl,$batr);
831 enddef; % end of draw_hachek
832
833 % \end{macrocode}
834 % \end{routine}
835 %
836 % \begin{routine}{draw_ring}
837 % A macro to draw a ring accent.
838 % |draw_breve(1)|, top at z1, angles |accent_angle|, with total drop of
839 % |accent_ysize|.
840 % \begin{macrocode}
841 def draw_ring(suffix $)=
842 pen oldpen; oldpen:=currentpen; pickup accentpen;
843 x$rab = x$; y$rab = y$ - accent_ysize;
844 y$raml = y$ramr = 1/2[y$,y$rab];
845 x$ramr - x$ = x$ - x$raml = 1/2accent_ysize;
846 draw z$..z$ramr..z$rab..z$raml..cycle;
847 pickup oldpen;
848 labels($,$ramr,$rab,$raml);
849 enddef; % end of draw_ring
850
851 % \end{macrocode}
852 % \end{routine}
853 %
854 % \begin{routine}{draw_dota}
855 % A macro to draw a dot accent.
856 % |draw_dota(1)|, top at z1, angles |accent_angle|,
857 % and diameter 1/2|accent_ysize|..
858 % \begin{macrocode}
859 def draw_dota(suffix $)=
860 pen oldpen; oldpen:=currentpen; pickup stylus;
861 numeric dotalpha; dotalpha := 1/2accent_ysize;
862 x$dab = x$; y$dab = y$ - dotalpha;
863 y$daml = y$damr = 1/2[y$,y$dab];
864 x$damr - x$ = x$ - x$daml = 1/2dotalpha;
865 draw_pdot($,12/16accent_ysize);
866 pickup oldpen;
867 labels($,$damr,$dab,$daml);
868 enddef; % end of draw_dota
869
870 % \end{macrocode}
871 % \end{routine}
872 %
873 % \begin{routine}{draw_dieresis}
874 % A macro to draw a dieresis (double dot) accent.
875 % |draw_ddota(1)|, top at z1, angles |accent_angle|,
876 % and diameter 1/2|accent_ysize|..
877 % \begin{macrocode}
878 def draw_dieresis(suffix $)=
879 pen oldpen; oldpen:=currentpen; pickup stylus;
880 numeric ddotalpha; ddotalpha := 1/2accent_ysize;
881 x$ddab = x$; y$ddab = y$ - ddotalpha; z$ddam = 1/2[z$,z$ddab];
882 y$'damr = y$''daml = y$ddam; x$''daml - x$ = x$ - x$'damr = 1/2accent_ysize;
883 y$drl=y$drr=y$ddam; x$drl = x$-10/16accent_ysize; x$drr=x$+10/16accent_ysize;
884 draw_pdot($drl,12/16accent_ysize); draw_pdot($drr,12/16accent_ysize);
885 pickup oldpen;
886 labels($,$ddam,$ddab);
887 enddef; % end of draw_dieresis
888
889 % \end{macrocode}
890 % \end{routine}
891 %
892 % \begin{routine}{draw_lumlaut}
893 % A macro to draw a long (Hungarian) umlaut accent.
894 % |draw_lumlaut(1)|, top at z1, angles |accent_angle|,
895 % and depth |accent_ysize|..
896 % \begin{macrocode}
897 def draw_lumlaut(suffix $)=
898 pen oldpen; oldpen:=currentpen; pickup accentpen;
899 x$luab = x$; y$luab = y$ - accent_ysize; z$luam = 1/2[z$,z$luab];
900 y$lualt = y$luart = y$; y$lualb = y$luarb = y$luab;
901 x$luarm - x$luam = x$luam - x$lualm = 1/2accent_ysize;
902 x$luart - x$luarb = accent_ysize*(cosd(70)) = x$lualt - x$lualb;
903 z$lualm = 1/2[z$lualt,z$lualb]; z$luarm = 1/2[z$luart,z$luarb];
904 draw z$lualt--z$lualb; draw z$luart--z$luarb;
905 pickup oldpen;
906 labels($,$luam,$luab,$lualt,$lualb,$luart,$luarb);
907 enddef; % end of draw_lumlaut
908
909 % \end{macrocode}
910 % \end{routine}
911 %
912 % \begin{routine}{draw_tildea}
913 % A macro to draw a tilde accent.
914 % |draw_tildea(1)|, center at z1, angles |accent_angle|,
915 % and length |accent_ysize|..
916 % \begin{macrocode}
917 def draw_tildea(suffix $)=
918 pen oldpen; oldpen:=currentpen; pickup accentpen;
919 y$tal=y$=y$tar;
920 x$tar - x$ = x$ - x$tal = 12/16accent_ysize;
921 draw z$tal{dir accent_angle}..z$..{dir accent_angle}z$tar;
922 pickup oldpen;
923 labels($,$tal,$tar);
924 enddef; % end of draw_tildea
925
926 % \end{macrocode}
927 % \end{routine}
928 %
929 % \begin{routine}{draw_macron}
930 % A macro to draw a macron (bar) accent.
931 % |draw_macron(1)|, center at z1, angles |accent_angle|,
932 % and length |accent_ysize|..
933 % \begin{macrocode}
934 def draw_macron(suffix $)=
935 pen oldpen; oldpen:=currentpen; pickup accentpen;
936 y$mal=y$=y$mar;
937 x$mar - x$ = x$ - x$mal = 1/2accent_ysize;
938 draw z$mal--z$mar;
939 pickup oldpen;
940 labels($,$mal,$mar);
941 enddef; % end of draw_macron
942
943 % \end{macrocode}
944 % \end{routine}
945 %
946 % \begin{routine}{draw_cedilla}
947 % A macro to draw a cedilla.
948 % |draw_cedilla(1)|, top at z1, angles |accent_angle|,
949 % and length |accent_ysize|..
950 % \begin{macrocode}
951 def draw_cedilla(suffix $)=
952 pen oldpen; oldpen:=currentpen; pickup accentpen;
953 x$cedc=x$; y$cedc= y$-accent_ysize;
954 x$ceda=x$; y$ceda=4/16[y$,y$cedc];
955 x$cedb=x$+8/16accent_ysize; y$cedb=1/2[y$ceda,y$cedc];
956 x$cedd=x$cedc-2/16accent_ysize; y$cedd=y$cedc-1/16accent_ysize;
957 draw z$--z$ceda; draw z$ceda..z$cedb..z$cedc..z$cedd;
958 pickup oldpen;
959 labels($,$ceda,$cedb,$cedc,$cedd);
960 enddef; % end of draw_cedilla
961
962 % \end{macrocode}
963 % \end{routine}
964 %
965 % \begin{routine}{draw_ogonek}
966 % A macro to draw an ogonek.
967 % |draw_ogonek(1)|, top at z1, angles |accent_angle|,
968 % and length |accent_ysize|..
969 % \begin{macrocode}
970 def draw_ogonek(suffix $)=
971 pen oldpen; oldpen:=currentpen; pickup accentpen;
972 x$ogc=x$; y$ogc= y$-accent_ysize;
973 x$oga=x$; y$oga=2/16[y$,y$ogc];
974 x$ogb=x$-8/16accent_ysize; y$ogb=1/2[y$oga,y$ogc];
975 x$ogd=x$ogc+4/16accent_ysize; y$ogd=y$ogc+2/16accent_ysize;
976 draw z$..z$ogb..z$ogc..z$ogd;
977 pickup oldpen;
978 labels($,$oga,$ogb,$ogc,$ogd);
979 enddef; % end of draw_ogonek
980
981 % \end{macrocode}
982 % \end{routine}
983 %
984 % \begin{routine}{draw_leftguill}
985 % A macro to draw a left guillemot.
986 % |draw_leftquill(1, gh, gw)|, bottom at z1, height and width |gh| and |gw|.
987 % \begin{macrocode}
988 def draw_leftguill(suffix $)(expr gh, gw)=
989 x$lgqt=x$; y$lgqt= y$+gh;
990 x$lgqm=x$-gw; y$lgqm=1/2[y$,y$lgqt];
991 draw z$--z$lgqm--z$lgqt;
992 labels($,$lgqm,$lgqt);
993 enddef; % end of draw_leftguill
994
995 % \end{macrocode}
996 % \end{routine}
997 %
998 % \begin{routine}{draw_rightguill}
999 % A macro to draw a right guillemot.
1000 % |draw_rightguill(1, gh, gw)|, bottom at z1, height and width |gh| and |gw|.
1001 % \begin{macrocode}
1002 def draw_rightguill(suffix $)(expr gh, gw)=
1003 x$rgqt=x$; y$rgqt= y$+gh;
1004 x$rgqm=x$+gw; y$rgqm=1/2[y$,y$rgqt];
1005 draw z$--z$rgqm--z$rgqt;
1006 labels($,$rgqm,$rgqt);
1007 enddef; % end of draw_rightguill
1008
1009 % \end{macrocode}
1010 % \end{routine}
1011 %
1012 % \subsection{Routines for alphabetic characters}
1013 %
1014 % The next set of routines are for drawing characters.
1015 %
1016 % \begin{routine}{draw_a}
1017 % Draw the `a' character.
1018 % |$| and |$$| are the lower left and upper right of the character's `box'.
1019 % \begin{macrocode}
1020 def draw_a(suffix $,$$)=
1021 lft x1=x$+2jut; rt x2=x$$;
1022 top y1=y$$; bot y2=y$;
1023 % for the bowl
1024 z3=3/4[z2,z1];
1025 x5=lft x3; y5=bot y3;
1026 z13=1/2[z2,z1];
1027 x15=lft x13; y15=bot y13;
1028 if ductus:
1029 pickup stylus;
1030 fi
1031 draw_istem(1,2,srad); % the stem
1032 pickup thickstylus; % for the bowl
1033 lft x4=x$; bot y4=y$;
1034 z14=0.2[z4,z5];
1035 draw z14{pdir}...{z5-z4}z15; % bowl bottom
1036 draw z5--z4; % bowl top
1037 labels(1,2,3,4,5,13,14,15);
1038 enddef;
1039
1040 % \end{macrocode}
1041 % \end{routine}
1042 %
1043 % \begin{routine}{draw_a}
1044 % Draw the `a' character.
1045 % |$| and |$$| are the lower left and upper right of the character's `box'.
1046 % \begin{macrocode}
1047 def draw_a_save(suffix $,$$)=
1048 lft x1=x$; rt x2=x$$;
1049 top y1=y$$; bot y2=y$;
1050 % for the bowl
1051 z3=3/4[z2,z1];
1052 x5=lft x3; y5=bot y3;
1053 z13=1/2[z2,z1];
1054 x15=lft x13; y15=bot y13;
1055 if ductus:
1056 pickup stylus;
1057 fi
1058 draw_istem(1,2,srad); % the stem
1059 pickup thickstylus; % for the bowl
1060 lft x4=pcshiftx; bot y4=0;
1061 z14=0.2[z4,z5];
1062 draw z14{pdir}...{z5-z4}z15; % bowl bottom
1063 draw z5--z4; % bowl top
1064 labels(1,2,3,4,5,13,14,15);
1065 enddef;
1066
1067 % \end{macrocode}
1068 % \end{routine}
1069 %
1070 % \begin{routine}{draw_at}
1071 % Draw the commercial at character.
1072 % |$| and |$$| are the lower left and upper right of the character's `box'.
1073 % \begin{macrocode}
1074 def draw_at(suffix $,$$)=
1075 lft x1=2/3[x$,x$$]; rt x2=x$$;
1076 top y1=y$$; bot y2=y$;
1077 % for the bowl
1078 z3=3/4[z2,z1];
1079 x5=lft x3; y5=bot y3;
1080 z13=1/2[z2,z1];
1081 x15=lft x13; y15=bot y13;
1082 if ductus:
1083 pickup stylus;
1084 fi
1085 draw_tstem(3,2,srad); % the stem
1086 pickup thickstylus; % for the bowl
1087 lft x4=1/3[x$,x$$]; bot y4=y$;
1088 z14=0.2[z4,z5];
1089 draw z14{pdir}...{z5-z4}z15; % bowl bottom
1090 draw z5--z4; % bowl top
1091 %% the loop
1092 pickup quill;
1093 lft x201=x$; y201=1/2[y$,y$$];
1094 x203=1/2[x4,x2]; y203=y$-1/2desc_depth;
1095 draw z3..{down}z201..{right}z203;
1096 labels(1,2,3,4,5,13,14,15,201,202,203);
1097 enddef;
1098
1099 % \end{macrocode}
1100 % \end{routine}
1101 %
1102 % \begin{routine}{draw_aesc}
1103 % Draw the aesc character.
1104 % |$| and |$$| are the lower left and upper right of the character's `box'.
1105 % \begin{macrocode}
1106 def draw_aesc(suffix $,$$)=
1107 lft x1=1/3[x$,x$$]; rt x2=2/3[x$,x$$];
1108 top y1=y$$; bot y2=y$;
1109 % for the bowl
1110 z3=3/4[z2,z1];
1111 x5=lft x3; y5=bot y3;
1112 z13=1/2[z2,z1];
1113 x15=lft x13; y15=bot y13;
1114 if ductus:
1115 pickup stylus;
1116 fi
1117 draw_istem(1,2,srad); % the stem
1118 pickup thickstylus; % for the bowl
1119 lft x4=x$; bot y4=y$;
1120 z14=0.2[z4,z5];
1121 draw z14{pdir}...{z5-z4}z15; % bowl bottom
1122 draw z5--z4; % bowl top
1123 %% the e
1124 pickup quill;
1125 lft x101=x13; rt x103=x$$; x102=x104=1/2[x101,x103];
1126 top y102=y$$; bot y104=y$;
1127 %% y101=y103=1/2[y$,y$$];
1128 y101=y103=y13;
1129 x105=x106=x103;
1130 y105=0.1[y$,y$$];
1131 top y106=0.95[y$,y$$]; y106'=top y106; y106''=bot y106; x106''=lft x106;
1132 % the serif
1133 pickup stylus;
1134 rt x116=x$$; top y116=y106';
1135 x117=x106; y117=y116-jut;
1136 lft x118=x106''; bot y118=y106'';
1137 pickup quill;
1138 % the bar
1139 x107=x101; y107=y101;
1140 x108=x$$; y108=y107;
1141 if ductus:
1142 pickup stylus;
1143 fi
1144 draw z106..z102..z101..z2a; % the bowl
1145 pickup stylus;
1146 filldraw z117..z118--z116--cycle; % the serif
1147 draw_fork(101,108,jut); % the bar
1148 labels(1,2,3,4,5,13,14,15,101,102,103,104,105,106,107);
1149 enddef;
1150
1151 % \end{macrocode}
1152 % \end{routine}
1153 %
1154 % \begin{routine}{draw_b}
1155 % Draw a `b' character.
1156 % |$| and |$$| are the lower left and upper right of the character's `box'.
1157 % \begin{macrocode}
1158 def draw_b(suffix $,$$)=
1159 lft x1=lft x2=x$;
1160 top y1=y$$; bot y2=y$;
1161 % lower bowl
1162 rt x4=x$$; y4=1/3[y$,y$$];
1163 lft x5=rt x1+2thin; y5=2/3[y$,y$$];
1164 z6=z1;
1165 rt x7=0.67[x1,x4]; y7=y6;
1166 x9=rt x7-thin; y9=h-thin;
1167 x8=lft x5+thin; y8=bot y5+thin;
1168 if ductus:
1169 pickup stylus;
1170 fi
1171 draw_tlserif(1,2,srad); % the stem
1172 draw z2{right}..z4{up}..{left}z5; % bottom bowl
1173 draw z6--z7; % top bowl
1174 pickup stylus;
1175 draw z9--z8;
1176 penlabels(1,2,3,4,5,6,7,8,9,100);
1177 enddef;
1178
1179 % \end{macrocode}
1180 % \end{routine}
1181 %
1182 % \begin{routine}{draw_c}
1183 % Draw a `c' character.
1184 % |$| and |$$| are the lower left and upper right of the character's `box'.
1185 % \begin{macrocode}
1186 def draw_c(suffix $,$$)=
1187 lft x1=x$; rt x3=x$$; x2=x4=1/2[x1,x3];
1188 top y2=y$$; bot y4=y$; y1=y3=1/2[y$,y$$];
1189 x5=x6=x3;
1190 y5=0.1[y$,y$$];
1191 top y6=0.95[y$,y$$]; y6'=top y6; y6''=bot y6; x6''=lft x6;
1192 % the serif
1193 pickup stylus;
1194 rt x16=x$$; top y16=y6';
1195 x17=x6; y17=y16-jut;
1196 lft x18=x6''; bot y18=y6'';
1197 pickup quill;
1198 if ductus:
1199 pickup stylus;
1200 fi
1201 draw z5{-pdir}..{left}z4..z1..z2..z6;
1202 pickup stylus;
1203 filldraw z17..z18--z16--cycle;
1204 penlabels(1,2,3,4,5,6,16,17,18,100);
1205 enddef;
1206
1207 % \end{macrocode}
1208 % \end{routine}
1209 %
1210 % \begin{routine}{draw_d}
1211 % Draw a `d' character.
1212 % |$| and |$$| are the lower left and upper right of the character's `box'.
1213 % \begin{macrocode}
1214 def draw_d(suffix $,$$)=
1215 lft x1=x$; rt x3=x$$;
1216 bot y4=y$; top y5=y$$;
1217 x2=x4=1/2[x1,x3]; top y2=3/4[y$,y$$];
1218 y1=y3=0.5[y4,y2];
1219 x5=x1;
1220 if ductus:
1221 pickup stylus;
1222 fi
1223 draw z2{-pdir}..z1{down}..z4{right}..z3{up}..z5;
1224 penlabels(0,1,2,3,4,5,6,7,8,100);
1225 enddef;
1226
1227 % \end{macrocode}
1228 % \end{routine}
1229 %
1230 % \begin{routine}{draw_dyet}
1231 % Draw a `dyet' character.
1232 % |$| and |$$| are the lower left and upper right of the character's `box'.
1233 % \begin{macrocode}
1234 def draw_dyet(suffix $,$$)=
1235 lft x1=x$; rt x3=x$$;
1236 bot y4=y$; top y5=y$$;
1237 x2=x4=1/2[x1,x3]; top y2=3/4[y$,y$$];
1238 y1=y3=0.5[y4,y2];
1239 x5=x1;
1240 path p[];
1241 p1=z2{-pdir}..z1{down}..z4{right}..z3{up}..z5;
1242 if ductus:
1243 pickup stylus;
1244 fi
1245 draw p1;
1246 % the bar
1247 x11=1/2[x5,x2]; y11=1/2[y2,y5];
1248 x12=x11; y12-y666 = y666-y11;
1249 draw z11--z12;
1250 penlabels(0,1,2,3,4,5,6,7,8,10,11,100);
1251 enddef;
1252
1253 % \end{macrocode}
1254 % \end{routine}
1255 %
1256 %
1257 % \begin{routine}{draw_e}
1258 % Draw an `e' character.
1259 % |$| and |$$| are the lower left and upper right of the character's `box'.
1260 % \begin{macrocode}
1261 def draw_e(suffix $,$$)=
1262 lft x1=x$; rt x3=x$$; x2=x4=1/2[x1,x3];
1263 top y2=y$$; bot y4=y$; y1=y3=1/2[y$,y$$];
1264 x5=x6=x3;
1265 y5=0.1[y$,y$$];
1266 top y6=0.95[y$,y$$]; y6'=top y6; y6''=bot y6; x6''=lft x6;
1267 % the serif
1268 pickup stylus;
1269 rt x16=x$$; top y16=y6';
1270 x17=x6; y17=y16-jut;
1271 lft x18=x6''; bot y18=y6'';
1272 pickup quill;
1273 % the bar
1274 x7=x1; y7=y1;
1275 x8=x$$; y8=y7;
1276 if ductus:
1277 pickup stylus;
1278 fi
1279 draw z5{-pdir}..{left}z4..z1..z2..z6; % the bowl
1280 pickup stylus;
1281 filldraw z17..z18--z16--cycle; % the serif
1282 draw_fork(7,8,jut); % the bar
1283 ductus:=false;
1284 penlabels(1,2,3,4,5,6,7,8,9,10,16,17,18,100);
1285 enddef;
1286
1287 % \end{macrocode}
1288 % \end{routine}
1289 %
1290 % \begin{routine}{draw_ethel}
1291 % Draw an `ethel' character.
1292 % |$| and |$$| are the lower left and upper right of the character's `box'.
1293 % \begin{macrocode}
1294 def draw_ethel(suffix $,$$)=
1295 lft x1=1/2[x$,x$$]; rt x3=x$$; x2=x4=1/2[x1,x3];
1296 top y2=y$$; bot y4=y$; y1=y3=1/2[y$,y$$];
1297 x5=x6=x3;
1298 y5=0.1[y$,y$$];
1299 top y6=0.95[y$,y$$]; y6'=top y6; y6''=bot y6; x6''=lft x6;
1300 % the serif
1301 pickup stylus;
1302 rt x16=x$$; top y16=y6';
1303 x17=x6; y17=y16-jut;
1304 lft x18=x6''; bot y18=y6'';
1305 pickup quill;
1306 % the bar
1307 x7=x1; y7=y1;
1308 x8=x$$; y8=y7;
1309 if ductus:
1310 pickup stylus;
1311 fi
1312 draw z5{-pdir}..{left}z4..z1..z2..z6; % the bowl
1313 pickup stylus;
1314 filldraw z17..z18--z16--cycle; % the serif
1315 draw_fork(7,8,jut); % the bar
1316 %% the O
1317 pickup quill;
1318 lft x101=x$; rt x103= x1; y101=1/2[y$,y$$]; y103=y1;
1319 x102 = x104 = 1/2[x101,x103]; y102=y$$; y104=y$;
1320 draw z101..z102..z103..z104..cycle;
1321 ductus:=false;
1322 penlabels(1,2,3,4,5,6,7,8,9,10,16,17,18,101,102,103,104);
1323 enddef;
1324
1325 % \end{macrocode}
1326 % \end{routine}
1327 %
1328 % \begin{routine}{draw_f}
1329 % Draw an `f' character.
1330 % |$| and |$$| are the lower left and upper right of the character's `box'.
1331 % and |$$$| is lower left of the descender box.
1332 % \begin{macrocode}
1333 def draw_f(suffix $,$$,$$$)=
1334 % stem
1335 lft x$Ft=lft x$Fb= x$; % 1 = Ft, 2 = Fb
1336 top y$Ft=y$$; bot y$Fb=y$$$;
1337 % bars
1338 x$Ftl=x$Fml=x$Ft; y$Ftl=y$Ft; bot y$Fml=y$; % 3 = Ftl, 4 = Fml
1339 rt x$Ftr= rt x$Fmr=x$$; y$Ftr=y$Ftl; y$Fmr=y$Fml; % 5 = Ftr, 6 = Fmr
1340 % triangles
1341 x$Ftrt=x$Fmrt=rt x$Ftr-1/2thin; % 15 = Ftrt, 16 = Fmrt
1342 y$Ftrt=y$Ftr; y$Fmrt=y$Fmr;
1343 if ductus:
1344 pickup stylus;
1345 fi
1346 draw_tlserif($Ft,$Fb,srad); % stem
1347 draw_tail($Fb,jut);
1348 draw z$Ftl--z$Ftr; % top bar
1349 draw_rtriangle($Ftrt,jut);
1350 draw z$Fml--z$Fmr; % bottom bar
1351 draw_rtriangle($Fmrt,jut);
1352 penlabels(1,2,3,4,5,6,15,16,100,$Ft,$Fb,$Ftl,$Fml,$Ftr,$Fmr,$Ftrt,$Fmrt);
1353 enddef;
1354
1355 % \end{macrocode}
1356 % \end{routine}
1357 %
1358 %
1359 % \begin{routine}{draw_g}
1360 % Draw a `g' character.
1361 % |$| and |$$| are the lower left and upper right of the character's `box'.
1362 % and |$$$| is lower left of the descender box.
1363 % \begin{macrocode}
1364 def draw_g(suffix $,$$,$$$)=
1365 % the bowl
1366 lft x1=x$; rt x3=x$$; y1=y3=1/2[y$,y$$];
1367 x2=x4=1/2[x$,x$$]; top y2=y$$; bot y4=y$;
1368 x5=x6=x3;
1369 y5=0.1[y$,y$$];
1370 top y6=0.95[y$,y$$]; y6'=top y6; y6''=bot y6; x6''=lft x6;
1371 % the serif
1372 pickup stylus;
1373 rt x16=x$$; top y16=y6';
1374 x17=x6; y17=y16-jut;
1375 lft x18=x6''; bot y18=y6'';
1376 pickup quill;
1377 % the stem
1378 x7=rt x5-1/2thin; y7=top y5-1/2thin;
1379 pickup stylus;
1380 lft x8=1/2[x$,x$$]; bot y8=y$$$;
1381 pickup quill;
1382 pair vec[]; vec1:=z7-z8; vec2:=z8-z7;
1383 y21=y8+3/2thick; z21=whatever[z8,z7];
1384 y22=y8+ thick; z22=whatever[z8,z7];
1385 x23=x8-thick; y23=y8;
1386 x24=x23+1/2thick; y24=y23+1/2thick;
1387 if ductus:
1388 pickup stylus;
1389 fi
1390 draw z5{-pdir}..{left}z4..z1..z2..z6; % the bowl
1391 pickup stylus;
1392 filldraw z17..z18--z16--cycle; % the serif
1393 draw z7--z22; % the stem
1394 filldraw z22{vec2}..{left}z23--z24{right}..{vec1}z21--cycle;
1395 penlabels(1,2,3,4,5,6,7,8,16,17,18,21,22,23,24,100);
1396 enddef;
1397
1398 % \end{macrocode}
1399 % \end{routine}
1400 %
1401 %
1402 % \begin{routine}{draw_h}
1403 % Draw an `h' character.
1404 % |$| and |$$| are the lower left and upper right of the character's `box'.
1405 % \begin{macrocode}
1406 def draw_h(suffix $,$$)=
1407 lft x1=lft x2=x$;
1408 top y1=y$$; bot y2=y$;
1409 % bowl
1410 rt x5=x$$; y5=3/8[y$,y$$];
1411 lft x6=2/3[x$,x$$]; bot y6=y$;
1412 x4=0.5[x1,x5]; top y4=3/4[y$,y$$];
1413 x4'=0.5[x4,x1]; y4'=y4;
1414 z4''=z4' shifted (-w*pdir);
1415 z3'=whatever[z4',z4'']=whatever[z1,z2];
1416 x3=rt x3'; y3=y3';
1417 if ductus:
1418 pickup stylus;
1419 fi
1420 draw_istem(1,2,srad); % stem
1421 draw z3{pdir}..z4{right}..z5{down}..z6; % bowl
1422 penlabels(1,2,3,4,5,6,100);
1423 enddef;
1424
1425 % \end{macrocode}
1426 % \end{routine}
1427 %
1428 %
1429 % \begin{routine}{draw_i}
1430 % Draw an `i' character.
1431 % |$| and |$$| are the lower left and upper right of the character's `box'.
1432 % \begin{macrocode}
1433 def draw_i(suffix $,$$)=
1434 lft x$It=lft x$Ib=x$; % 1 = $It, 2 = $Ib
1435 top y$It=y$$; bot y$Ib=y$;
1436 draw_tlserif($It,$Ib,srad);
1437 draw_tail($Ib,jut);
1438 penlabels(1,2,$It,$Ib,100);
1439 enddef;
1440
1441 % \end{macrocode}
1442 % \end{routine}
1443 %
1444 %
1445 % \begin{routine}{draw_j}
1446 % Draw a `j' character.
1447 % |$| and |$$| are the lower left and upper right of the character's `box'.
1448 % \begin{macrocode}
1449 def draw_j(suffix $,$$)=
1450 lft x$Jt=lft x$Jb=x$; % 1 = Jt, 2 = Jb
1451 top y$Jt=y$$; bot y$Jb=y$;
1452 draw_tlserif($Jt,$Jb,srad);
1453 draw_tail($Jb,jut);
1454 penlabels($Jt,$Jb);
1455 enddef;
1456
1457 % \end{macrocode}
1458 % \end{routine}
1459 %
1460 %
1461 % \begin{routine}{draw_k}
1462 % Draw a `k' character.
1463 % |$| and |$$| are the lower left and upper right of the character's `box'.
1464 % \begin{macrocode}
1465 def draw_k(suffix $,$$)=
1466 lft x1=lft x2=x$; top y1=y$$; bot y2=y$;
1467 % for the flick
1468 numeric rise,fall,fjut;
1469 x3=rt x1; y3=5/8[y$,y$$];
1470 rise:=1/6[y$,y$$]; fall:=-rise/2; fjut:=1/2[x$,x$$];
1471 % for the leg
1472 z4=z3;
1473 x5=x$$; y5=y$;
1474 if ductus:
1475 pickup stylus;
1476 fi
1477 draw_tlserif(1,2,srad); % stem
1478 draw_tail(2,jut);
1479 draw_flick(3,rise,fall,fjut); % upper diag
1480 draw_tstem(4,5,srad); % lower diag
1481 penlabels(1,2,3,4,5,100);
1482 enddef;
1483
1484 % \end{macrocode}
1485 % \end{routine}
1486 %
1487 %
1488 % \begin{routine}{draw_l}
1489 % Draw an `l' character.
1490 % |$| and |$$| are the lower left and upper right of the character's `box'.
1491 % \begin{macrocode}
1492 def draw_l(suffix $,$$)=
1493 lft x$Lt=lft x$Lb= x$; % 1 = Lt, 2 = Lb
1494 top y$Lt=y$$; bot y$Lb=y$;
1495 z$Lbl=z$Lb; % 3 = Lbl
1496 x$Lbr=x$$; y$Lbr=y$; % 4 = Lbr
1497 draw_tlserif($Lt,$Lb,srad); % the stem
1498 draw_fork($Lbl,$Lbr,jut); % the foot
1499 penlabels($Lt,$Lb,$Lbl,$Lbr);
1500 enddef;
1501
1502 % \end{macrocode}
1503 % \end{routine}
1504 %
1505 % \begin{routine}{draw_pound}
1506 % Draw a pound (sterling) symbol.
1507 % |$| and |$$| are the lower left and upper right of the character's `box'.
1508 % \begin{macrocode}
1509 def draw_pound(suffix $,$$)=
1510 lft x$pst=lft x$psb= x$;
1511 top y$pst=y$$-thick; bot y$psb=y$;
1512 z$psm=z$psb;
1513 x$psr=x$$; y$psr=y$;
1514 draw z$psb--z$pst; % the stem
1515 draw_fork($psm,$psr,jut); % the foot
1516 % top arch
1517 x$pstr=3/4[x$,x$$]; top y$pstr=y$$;
1518 draw z$pstr..{down}z$pst;
1519 % bar
1520 lft x$psbl= x$-jut; y$psbl = y$psbr = 2/3[y$psb,y$pst];
1521 x$psbr - x$pst = (2x$pst - x$psbl);
1522 draw z$psbl--z$psbr;
1523 penlabels($pst,$psb,$psm,$psr,$pstr,$psbl,$psbr,1,2,3,4,100);
1524 enddef;
1525
1526 % \end{macrocode}
1527 % \end{routine}
1528 %
1529 %
1530 % \begin{routine}{draw_m}
1531 % Draw an `m' character.
1532 % |$| and |$$| are the lower left and upper right of the character's `box'.
1533 % \begin{macrocode}
1534 def draw_m(suffix $,$$)=
1535 lft x2= x$; y2=1/2[y$,y$$];
1536 rt x8=x$$; y8=y2;
1537 rt x1=1/4w; bot y1=0;
1538 x4=1/2[x$,x$$]; y4=2/3[y$,y$$];
1539 x3=0.5[x2,x4]; top y3=y$$;
1540 x5=x4; y5=y1;
1541 z6=z4;
1542 x7=3/4[x$,x$$]; top y7=y$$;
1543 lft x9=3/4[x$,x$$]; y9=y1;
1544 if ductus:
1545 pickup stylus;
1546 fi
1547 draw z1..z2{up}..z3{right}..{down}z4; % left half
1548 draw_tstem(4,5,srad); % middle stem
1549 draw z6..z7{right}..z8{down}..{-pdir}z9; % right half
1550 ductus:=false;
1551 penlabels(1,2,3,4,5,6,7,8,9,100);
1552 enddef;
1553
1554 % \end{macrocode}
1555 % \end{routine}
1556 %
1557 %
1558 % \begin{routine}{draw_n}
1559 % Draw an `n' character.
1560 % |$| and |$$| are the lower left and upper right of the character's `box'.
1561 % \begin{macrocode}
1562 def draw_n(suffix $,$$)=
1563 % left stem
1564 lft x$nlt=x$; top y$nlt=y$$; %% nlt = 1
1565 x$nlb=x$nlt; bot y$nlb=y$; %% nlb = 2
1566 % right stem
1567 rt x$nrt=x$$; y$nrt=y$nlt; %% nrt = 4
1568 x$nrb=x$nrt; bot y$nrb=y$; %% nrb = 3
1569 if ductus:
1570 pickup stylus;
1571 fi
1572 draw_tlserif($nlt,$nlb,srad); % left stem
1573 draw_tail($nlb,jut);
1574 draw_istem($nrt,$nrb,srad); % right stem
1575 draw z$nlt--z$nrb; % diagonal
1576 penlabels($nlt,$nlb,$nrt,$nrb);
1577 enddef;
1578
1579 % \end{macrocode}
1580 % \end{routine}
1581 %
1582 % \begin{routine}{draw_eng}
1583 % Draw an `eng' character.
1584 % |$| and |$$| are the lower left and upper right of the character's `box'.
1585 % \begin{macrocode}
1586 def draw_eng(suffix $,$$,$$$)=
1587 draw_n($,$$);
1588 x$nge=2/3[x$nlb,x$nrb]; y$nge = y$$$; x$ngf=1/3[x$nlb,x$nrb];
1589 y$ngf = 1/2[y$nrb,y$nge];
1590 draw z$nrb{down}..z$nge..z$ngf;
1591 %% undraw the bottom serif
1592 pickup stylus;
1593 lft x$nglt= lft x$nglb=x$$; rt x$ngrb=rt x$ngrt = x$$+jut;
1594 top y$nglt = top y$ngrt = y$$; bot y$nglb = bot y$ngrb = y$;
1595 path pu[];
1596 pu1 = z$nglt--z$nglb--z$ngrb--z$ngrt--cycle;
1597 unfilldraw pu1; unfilldraw pu1;
1598 penlabels($nge,$ngf,$nglt,$nglb,$lgrb,$ngrt);
1599 enddef;
1600
1601 % \end{macrocode}
1602 % \end{routine}
1603 %
1604 %
1605 % \begin{routine}{draw_o}
1606 % Draw an `o' character.
1607 % |$| and |$$| are the lower left and upper right of the character's `box'.
1608 % \begin{macrocode}
1609 def draw_o(suffix $,$$)=
1610 lft x1=x$; rt x3=x$$; y1=y3=1/2[y$,y$$];
1611 x2=x4=1/2[x$,x$$]; top y2=y$$; bot y4=y$;
1612 if ductus:
1613 pickup stylus;
1614 fi
1615 draw z1..z2..z3..z4..cycle;
1616 penlabels(1,2,3,4,100);
1617 enddef;
1618
1619 % \end{macrocode}
1620 % \end{routine}
1621 %
1622 %
1623 % \begin{routine}{draw_p}
1624 % Draw a `p' character.
1625 % |$| and |$$| are the lower left and upper right of the character's `box'.
1626 % |$$$| is base of descender box.
1627 % \begin{macrocode}
1628 def draw_p(suffix $,$$,$$$)=
1629 % stem
1630 lft x1=lft x2=x$; top y1=y$$; bot y2=y$$$;
1631 % bowl
1632 z3=z1;
1633 rt x5=x$$; y5=1/2[y$,y$$];
1634 lft x7=rt x1; bot y7=y$;
1635 if ductus:
1636 pickup stylus;
1637 fi
1638 draw_tlserif(1,2,srad); % stem
1639 draw_tail(2,jut);
1640 draw z3{pdir}..z5{down}..{-pdir}z7; % bowl
1641 penlabels(1,2,3,4,5,6,7,100);
1642 enddef;
1643
1644 % \end{macrocode}
1645 % \end{routine}
1646 %
1647 %
1648 % \begin{routine}{draw_q}
1649 % Draw a `q' character.
1650 % |$| and |$$| are the lower left and upper right of the character's `box'.
1651 % |$$$| is base of descender box.
1652 % \begin{macrocode}
1653 def draw_q(suffix $,$$,$$$)=
1654 % right stem
1655 rt x1=rt x2=x$$; top y1=y$$; bot y2=y$$$;
1656 % bowl
1657 z3=z1;
1658 lft x5=x$; y5=1/2[y$,y$$];
1659 rt x7=lft x1; y7=0.1[y$,y$$];
1660 if ductus:
1661 pickup stylus;
1662 fi
1663 draw z1--z2; % right stem
1664 draw_tail(2,jut);
1665 draw z3{left}..z5{down}..{pdir}z7; % bowl
1666 penlabels(1,2,3,4,5,6,7,100);
1667 enddef;
1668
1669 % \end{macrocode}
1670 % \end{routine}
1671 %
1672 %
1673 % \begin{routine}{draw_pilcrow}
1674 % Draw a pilcrow character.
1675 % |$| and |$$| are the lower left and upper right of the character's `box'.
1676 % |$$$| is base of descender box.
1677 % \begin{macrocode}
1678 def draw_pilcrow(suffix $,$$,$$$)=
1679 % right stem
1680 rt x1=rt x2=x$$; top y1=y$$; bot y2=y$$$;
1681 % bowl
1682 x3=x1; y3=y1-thick;
1683 lft x5=x$; y5=1/2[y$,y$$];
1684 rt x7=lft x1; y7=0.1[y$,y$$];
1685 lft x15=rt x5; y15=y5;
1686 if ductus:
1687 pickup stylus;
1688 fi
1689 draw z1--z2; % right stem
1690 draw_tail(2,jut);
1691 draw z3{left}..z5{down}..{pdir}z7; % bowl
1692 draw z3{left}..z15{down}..{pdir}z7; % bowl
1693 penlabels(1,2,3,4,5,6,7,15,100);
1694 enddef;
1695
1696 % \end{macrocode}
1697 % \end{routine}
1698 %
1699 %
1700 % \begin{routine}{draw_r}
1701 % Draw an `r' character.
1702 % |$| and |$$| are the lower left and upper right of the character's `box'.
1703 % \begin{macrocode}
1704 def draw_r(suffix $,$$)=
1705 % stem
1706 lft x1=lft x2=x$; top y1=y$$; bot y2=y$;
1707 % bowl
1708 lft x3=rt x1-thin; y3=y1;
1709 rt x5=3/4[x$,x$$]; y5=3/4[y$,y$$];
1710 lft x7=rt x1; bot y7=1/3[y$,y$$];
1711 % leg
1712 z8=z7;
1713 rt x9=x$$; bot y9=y$;
1714 if ductus:
1715 pickup stylus;
1716 fi
1717 draw_tlserif(1,2,srad); % stem
1718 draw_tail(2,jut);
1719 draw z3{pdir}..z5{down}..{-pdir}z7; % bowl
1720 draw z8{-ppdir}..{right}z9; % leg
1721 penlabels(1,2,3,4,5,6,7,8,9,100);
1722 enddef;
1723
1724 % \end{macrocode}
1725 % \end{routine}
1726 %
1727 %
1728 % \begin{routine}{draw_s}
1729 % Draw an `s' character.
1730 % |$| and |$$| are the lower left and upper right of the character's `box'.
1731 % \begin{macrocode}
1732 def draw_s(suffix $,$$)=
1733 rt x$Sa=x$$; top y$Sa=y$$-thin; % a = 1
1734 x$Sb=1/2[x$,x$$]; top y$Sb=y$$; % b = 2
1735 lft x$Sc=x$; y$Sc=0.75[y$,y$$]; % c = 3
1736 x$Sd=x$Sb; y$Sd=1/2[y$,y$$]; % d = 4
1737 x$Se=x$Sa; y$Se=0.25[y$,y$$]; % e = 5
1738 x$Sf=x$Sb; bot y$Sf=y$; % f = 6
1739 x$Sg=x$Sc; bot y$Sg = y$+thin; % g = 7
1740 path p[];
1741 p1=z$Sa..z$Sb{left}..z$Sc{down}..z$Sd..z$Se{down}..z$Sf{left}..z$Sg;
1742 pair vec[];
1743 vec1= direction 0 of p1;
1744 vec2= direction (length p1) of p1;
1745 z$Saa=z$Sa shifted vec1; % aa = 11
1746 z$Sgg=z$Sg shifted -vec2; % gg = 17
1747 y$Sf'=top y$Sa; y$Sf''=bot y$Sa; x$Sf''=lft x$Sa;
1748 % the serif
1749 pickup stylus;
1750 rt x$Sfff=x$$; top y$Sfff=y$Sf'; % 26 = fff
1751 x$Sggg=x$Sa; y$Sggg=y$Sfff-0.75jut; % 27 = ggg
1752 lft x$Shhh=x$Sf''; bot y$Shhh=y$Sf''; % 28 = hhh
1753 pickup quill;
1754 if ductus:
1755 pickup stylus;
1756 fi
1757 draw p1; % the curve
1758 pickup stylus;
1759 filldraw z$Sggg..z$Shhh--z$Sfff--cycle; % the serif
1760 penlabels($Sa,$Sb,$Sc,$Sd,$Se,$Sf,$Sg,$Saa,$Sgg,$Sfff,$Sggg,$Shhh);
1761 enddef;
1762
1763 % \end{macrocode}
1764 % \end{routine}
1765 %
1766 %
1767 % \begin{routine}{draw_eszett}
1768 % Draw an eszett.
1769 % |$| and |$$| are the lower left and upper right of the character's `box'.
1770 % \begin{macrocode}
1771 def draw_eszett(suffix $,$$,$$$)=
1772 lft x1 = lft x2 = x$; bot y1 = y$$$; y2 = y$$-2thick;
1773 top y3=y$$; rt x4 = rt x6 = x$$; x3 = 1/2[x2,x4];
1774 lft x5 = lft x7 = x1+thick;
1775 bot y7 = y$; y5 = 1/2[y7,y3];
1776 y4 = 1/2[y5,y3]; y6 = 1/2[y7,y5];
1777 if ductus:
1778 pickup stylus;
1779 fi
1780 draw z1--z2{up}..z3{right}..z4{down}..{-pdir}z5;
1781 draw z5{right}..z6{down}..{left}z7;
1782 draw_tail(1,jut);
1783 penlabels(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15);
1784 enddef;
1785
1786 % \end{macrocode}
1787 % \end{routine}
1788 %
1789 %
1790 % \begin{routine}{draw_section}
1791 % Draw a section symbol.
1792 % |$| and |$$| are the lower left and upper right of the character's `box'.
1793 % \begin{macrocode}
1794 def draw_section(suffix $,$$,$$$)=
1795 rt x1 = rt x11 = x666; top y1 = top y11 = y666;
1796 lft x5 = lft x15 = x555; bot y5 = bot y15 = y$$$;
1797 x12=x15; x4 = x1;
1798 y3 = 1/2[y5,y1] + 1/2thick; y13 = y3-thick;
1799 y2=1/2[y3,y1]; y4 = 1/2[y5,y3];
1800 y12=1/2[y13,y11]; y14=1/2[y15,y13];
1801 x2=x12+thick; x14=x4-thick;
1802 x3=1/2[x2,x4]; x13 = 1/2[x12,x14];
1803 if ductus:
1804 pickup stylus;
1805 fi
1806 draw z1..z2..z3..z4..z5;
1807 draw z11..z12..z13..z14..z15;
1808 penlabels(1,2,3,4,5,11,12,13,14,15);
1809 enddef;
1810
1811 % \end{macrocode}
1812 % \end{routine}
1813 %
1814 %
1815 % \begin{routine}{draw_t}
1816 % Draw a `t' character.
1817 % |$| and |$$| are the lower left and upper right of the character's `box'.
1818 % \begin{macrocode}
1819 def draw_t(suffix $,$$)=
1820 %% x1=x2=1/2[x$,x$$];
1821 %% top y1=y$$; bot y2=y$;
1822 %% lft x3=x$; rt x4=x$$; y3=y4=y1;
1823 %% x5=x$+0.5jut; y5=y$$-1/2thin;
1824 %% x6=x$$-1/2thin; y6=y5;
1825 %% if ductus:
1826 %% pickup stylus;
1827 %% fi
1828 %% draw_tstem(1,2,srad); % stem
1829 %% draw z3--z4; % top bar
1830 %% draw_triangle(5,jut); draw_rtriangle(6,jut);
1831 %% penlabels(1,2,3,4,5,100);
1832 x184=x284=1/2[x$,x$$];
1833 top y184=y$$; bot y284=y$;
1834 lft x384=x$; rt x484=x$$; y384=y484=y184;
1835 x584=x$+0.5jut; y584=y$$-1/2thin;
1836 x684=x$$-1/2thin; y684=y584;
1837 if ductus:
1838 pickup stylus;
1839 fi
1840 draw_tstem(184,284,srad); % stem
1841 draw z384--z484; % top bar
1842 draw_triangle(584,jut); draw_rtriangle(684,jut);
1843 penlabels(184,284,384,484,584,100);
1844 enddef;
1845
1846 % \end{macrocode}
1847 % \end{routine}
1848 %
1849 %
1850 % \begin{routine}{draw_u}
1851 % Draw a `u' character.
1852 % |$| and |$$| are the lower left and upper right of the character's `box'.
1853 % \begin{macrocode}
1854 def draw_u(suffix $,$$)=
1855 % left half first
1856 lft x6=x$+jut; top y6=y$$-2thin;
1857 lft x7=x$; y7=1/2[y$,y$$];
1858 x8=0.5[x6,x1]; bot y8=y$;
1859 % the stem
1860 rt x1=x$$; top y1=y$$;
1861 x2=x1; bot y2=y$;
1862 % construction points for the curved part
1863 x5=0.5[x8,x1]; y5=y8;
1864 z5'=z5 shifted (w*pdir);
1865 path p[];
1866 p1=z5--z5';
1867 p2=z1--z2;
1868 z9= p2 intersectionpoint p1;
1869 pair vec[];
1870 p3=z6..z7{down}..{right}z8;
1871 vec3 = direction 0 of p3;
1872 z16=z6 shifted vec3;
1873 if ductus:
1874 pickup stylus;
1875 fi
1876 % draw the serifs, then the bowls
1877 draw_serif(6,16,srad); % left half
1878 draw z6a..z7{down}..z8{right}..{pdir}z9;
1879 draw_istem(1,2,srad); % right stem
1880 penlabels(1,2,3,4,5,6,7,8,9,11,16,100);
1881 enddef;
1882
1883 % \end{macrocode}
1884 % \end{routine}
1885 %
1886 %
1887 % \begin{routine}{draw_v}
1888 % Draw a `v' character.
1889 % |$| and |$$| are the lower left and upper right of the character's `box'.
1890 % \begin{macrocode}
1891 def draw_v(suffix $,$$)=
1892 % right side of W
1893 numeric midx; midx:= pcshiftx;
1894 lft x1=x$; top y1=y$$;
1895 x2=x1; y2=1/2[y$,y$$];
1896 rt x4=x$$; y4=y2;
1897 x3=0.5[x2,x4]; bot y3=y$;
1898 x5=x4-thick; y5=y1;
1899 if ductus:
1900 pickup stylus;
1901 fi
1902 % draw the serifs, then the bowls
1903 draw_tlserif(1,2,srad);
1904 draw z2{down}..z3{right}..z4{up}..z5;
1905 penlabels(1,2,3,4,5,11,100);
1906 enddef;
1907
1908 % \end{macrocode}
1909 % \end{routine}
1910 %
1911 %
1912 % \begin{routine}{draw_w}
1913 % Draw a `w' character.
1914 % |$| and |$$| are the lower left and upper right of the character's `box'.
1915 % \begin{macrocode}
1916 def draw_w(suffix $,$$)=
1917 % right side first
1918 numeric midx; midx:= 1/2[x$,x$$]-jut;
1919 lft x1=midx+jut; top y1=y$$;
1920 x2=x1; y2=1/2[y$,y$$];
1921 rt x4=x$$; y4=y2;
1922 x3=0.5[x2,x4]; bot y3=y$;
1923 x5=x4-thick; y5=y1;
1924 % left side
1925 lft x6=x$+jut;
1926 top y6=y$$-2thin;
1927 lft x7=x$; y7=y2;
1928 x8=0.5[x7,x1]; y8=y3;
1929 % construction points
1930 x15=0.5[x8,x1]; y15=y8;
1931 z15'=z15 shifted (w*pdir);
1932 x2'=x2; y2'=y15;
1933 path p[];
1934 p1=z1--z2';
1935 p2=z15--z15';
1936 z9= p2 intersectionpoint p1;
1937 pair vec[];
1938 p3=z6..z7{down}..{right}z8;
1939 vec3 = direction 0 of p3;
1940 z16=z6 shifted vec3;
1941 if ductus:
1942 pickup stylus;
1943 fi
1944 % draw the serifs, then the bowls
1945 draw_tlserif(1,2,srad); % right half
1946 draw z2{down}..z3{right}..z4{up}..z5;
1947 draw_serif(6,16,srad); % left half
1948 draw z6a..z7{down}..z8{right}..z9;
1949 penlabels(1,2,3,4,5,6,7,8,9,11,16,100);
1950 enddef;
1951
1952 % \end{macrocode}
1953 % \end{routine}
1954 %
1955 %
1956 % \begin{routine}{draw_x}
1957 % Draw an `x' character.
1958 % |$| and |$$| are the lower left and upper right of the character's `box'.
1959 % \begin{macrocode}
1960 def draw_x(suffix $,$$,$$$)=
1961 % thick diagonal
1962 lft x1=x$+jut; rt x2=x$$-jut;
1963 y1=y$$; y2=y$;
1964 % thin diagonal
1965 lft x3=x$; bot y3=y$$$;
1966 rt x5=x$$; top y5=y$$;
1967 if ductus:
1968 pickup stylus;
1969 fi
1970 draw_istem(1,2,srad); % thick diagonal
1971 draw z3..{pdir}z5; % thin diagonal
1972 penlabels(1,2,3,4,5,6,7,8,100);
1973 enddef;
1974
1975 % \end{macrocode}
1976 % \end{routine}
1977 %
1978 %
1979 % \begin{routine}{draw_y_base}
1980 % Draw a dotless `y' character.
1981 % |$| and |$$| are the lower left and upper right of the character's `box'.
1982 % \begin{macrocode}
1983 def draw_y_base(suffix $,$$,$$$)=
1984 % left stroke
1985 lft x1=x$+jut; top y1=y$$;
1986 rt x2=3/4[x$,x$$]; top y2=y$;
1987 % right stroke
1988 pickup stylus;
1989 rt x3=x$$; top y3=y$$;
1990 lft x4=x$; bot y4=y$$$;
1991 x5=x3-3thin; y5=y3;
1992 x7=x2-3/2thin; y7=y2;
1993 pickup quill;
1994 if ductus:
1995 pickup stylus;
1996 fi
1997 draw_tlserif(1,2,srad); % left stroke
1998 pickup stylus;
1999 filldraw z3..z2..z4 & z4..z7..z5--cycle; % right stroke
2000 penlabels(1,2,3,4,5,6,7,8,9,10,100);
2001 enddef;
2002
2003 % \end{macrocode}
2004 % \end{routine}
2005 %
2006 % \begin{routine}{draw_y}
2007 % Draw a `y' character.
2008 % |$| and |$$| are the lower left and upper right of the character's `box'.
2009 % \begin{macrocode}
2010 def draw_y(suffix $,$$,$$$)=
2011 draw_y_base($,$$,$$$);
2012 x8=1/2[x$,x$$]; y8=y$$+jut;
2013 draw_pdot(8,dot_size); % the dot
2014 penlabels(8);
2015 enddef;
2016
2017 % \end{macrocode}
2018 % \end{routine}
2019 %
2020 %
2021 % \begin{routine}{draw_z}
2022 % Draw a `z' character.
2023 % |$| and |$$| are the lower left and upper right of the character's `box'.
2024 % \begin{macrocode}
2025 def draw_z(suffix $,$$)=
2026 % bottom stroke
2027 lft x4=x$; bot y4=y$;
2028 x6=x$$; y6=y$;
2029 % top stroke
2030 x1=x4; top y1=y$$;
2031 rt x3=6/7[x$,x$$]; y3=y1;
2032 x11=x$+0.5jut; y11=y$$-thin/2;
2033 if ductus:
2034 pickup stylus;
2035 fi
2036 draw z1--z3; % top stroke
2037 draw_triangle(11,jut);
2038 draw_fork(4,6,jut);
2039 draw z4--z3; % diagonal
2040 penlabels(1,2,3,4,5,6,100);
2041 enddef;
2042
2043 % \end{macrocode}
2044 % \end{routine}
2045 %
2046 %
2047 % \begin{routine}{draw_thorn}
2048 % Draw a thorn character.
2049 % |$| and |$$| are the lower left and upper right of the character's `box'.
2050 % |$$$| is base of descender box.
2051 % \begin{macrocode}
2052 def draw_thorn(suffix $,$$,$$$)=
2053 % stem
2054 lft x1=lft x2=x$; top y1=y$$; bot y2=y$$$;
2055 % bowl
2056 lft x7=rt x1; bot y7=y$;
2057 x3=x1; y1-y3 = y7-y2;
2058 rt x5=x$$; y5=1/2[y3,y7];
2059 if ductus:
2060 pickup stylus;
2061 fi
2062 draw_tlserif(1,2,srad); % stem
2063 draw_tail(2,jut);
2064 draw z3{pdir}..z5{down}..{-pdir}z7; % bowl
2065 penlabels(1,2,3,4,5,6,7,100);
2066 enddef;
2067
2068 % \end{macrocode}
2069 % \end{routine}
2070 %
2071 %
2072 %
2073 %
2074 % \subsection{Mode, setup and input files}
2075 %
2076 %
2077 % Set the mode and font setup.
2078 % \begin{macrocode}
2079 font_coding_scheme:="TeXB1";
2080 mode_setup;
2081 auncial_font_setup;
2082
2083 % \end{macrocode}
2084 %
2085 %
2086 % We generate letters, together with some punctuation and
2087 % analphabetics.
2088 % \begin{macrocode}
2089 input auncllow; % characters below ASCII
2090 input aunclsci; % ASCII character set
2091 input aunclmid; % bottom of top half
2092 input auncltop; % top of top half
2093
2094 % \end{macrocode}
2095 %
2096 % \subsection{Ligatures}
2097 %
2098 % The open and close double quotes, and the en- and em-dashes.
2099 % \begin{macrocode}
2100 %%ligtable "`": "`"=:oct"134";
2101 %%ligtable "'": "'"=:oct"042"; %% , "?" kern 2u#, "!" kern 2u#;
2102 %%ligtable "-": "-"=:oct"173";
2103 %%ligtable oct"173": "-"=:oct"174";
2104 ligtable "`": "`"=:oct"020"; %% open quotes
2105 ligtable "'": "'"=:oct"021"; %% close quotes
2106 %% , "?" kern 2u#, "!" kern 2u#;
2107 ligtable "-": "-"=:oct"025"; %% en-dash
2108 ligtable oct"025": "-"=:oct"026"; %% em-dash
2109
2110 % \end{macrocode}
2111 %
2112 % Other ligatures are possible in the following slots..
2113 %
2114 % \begin{macrocode}
2115 %%ligtable oct"240": "t"=oct"223";
2116 %%ligtable "e": "t"=oct"247";
2117 %%ligtable "s": "t"=oct"263";
2118 %%ligtable "c": "t"=oct"265";
2119 %%ligtable =oct"223";
2120 %%ligtable =oct"225";
2121
2122 % \end{macrocode}
2123 %
2124 % Finally, do the uppercase ligtable.
2125 %
2126 % \begin{macrocode}
2127 font_slant slant; font_x_height x_height#;
2128 if monospace: font_normal_space 9u#; % no stretching or shrinking
2129 font_quad 18u#;
2130 font_extra_space 9u#;
2131 else: font_normal_space 6u#+2letter_fit#;
2132 font_normal_stretch 3u#; font_normal_shrink 2u#;
2133 font_quad 18u#+4letter_fit#;
2134 font_extra_space 2u#;
2135 k#:=-.5u#; kk#:=-1.5u#; kkk#:=-2u#; % three degrees of kerning
2136 %% ligtable "P": "T": "Y": "A" kern kk#;
2137 %% ligtable "F": "V": "W": "A" kern if serifs: kkk# else: kk#fi,
2138 %% "K": "X": "O" kern k#, "C" kern k#, "G" kern k#, "Q" kern k#;
2139 %% ligtable "O": "D": "X" kern k#, "W" kern k#, "A" kern k#,
2140 %% "V" kern k#, "Y" kern k#;
2141 %% ligtable "A": if serifs: "R": fi
2142 %% "C" kern k#, "O" kern k#, "G" kern k#, "U" kern k#, "Q" kern k#,
2143 %% "L": "T" kern kk#, "Y" kern kkk#, "V" kern kk#, "W" kern kkk#;
2144 %%ligtable "I": "I" kern -k#; % Richard III
2145 fi
2146
2147 bye.
2148
2149 %</mfd>
2150 % \end{macrocode}
2151 %
2152 %
2153 % \Finale
2154 %
2155 \endinput
2156
2157 %% \CharacterTable
2158 %% {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
2159 %% 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
2160 %% Digits \0\1\2\3\4\5\6\7\8\9
2161 %% Exclamation \! Double quote \" Hash (number) \#
2162 %% Dollar \$ Percent \% Ampersand \&
2163 %% Acute accent \' Left paren \( Right paren \)
2164 %% Asterisk \* Plus \+ Comma \,
2165 %% Minus \- Point \. Solidus \/
2166 %% Colon \: Semicolon \; Less than \<
2167 %% Equals \= Greater than \> Question mark \?
2168 %% Commercial at \@ Left bracket \[ Backslash \\
2169 %% Right bracket \] Circumflex \^ Underscore \_
2170 %% Grave accent \` Left brace \{ Vertical bar \|
2171 %% Right brace \} Tilde \~}
2172
2173