Debian Codegraph @

texmf-dist/source/fonts/archaic/ugarite.dtx

raw
1 % \iffalse meta-comment
2 %
3 % ugarite.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 %<*driver>
22 \documentclass[twoside]{ltxdoc}
23 \usepackage{url}
24 \usepackage[draft=false,
25 plainpages=false,
26 pdfpagelabels,
27 bookmarksnumbered,
28 hyperindex=false
29 ]{hyperref}
30 \providecommand{\phantomsection}{}
31 \OnlyDescription %% comment this out for the full glory
32 \EnableCrossrefs
33 \CodelineIndex
34 \setcounter{StandardModuleDepth}{1}
35 \makeatletter
36 \@mparswitchfalse
37 \makeatother
38 \renewcommand{\MakeUppercase}[1]{#1}
39 \pagestyle{headings}
40 \newenvironment{addtomargins}[1]{%
41 \begin{list}{}{%
42 \topsep 0pt%
43 \addtolength{\leftmargin}{#1}%
44 \addtolength{\rightmargin}{#1}%
45 \listparindent \parindent
46 \itemindent \parindent
47 \parsep \parskip}%
48 \item[]}{\end{list}}
49 \makeatletter
50 \DeclareTextCommand{\Uunder}{OT1}[1]^^A
51 {{\o@lign{\relax#1\crcr\hidewidth\sh@ft{29}^^A
52 \vbox to.2ex{\hbox{\char21}\vss}\hidewidth}}}
53 \makeatother
54 \begin{document}
55 \raggedbottom
56 \DocInput{ugarite.dtx}
57 \end{document}
58 %</driver>
59 %
60 % \fi
61 %
62 % \CheckSum{309}
63 %
64 % \DoNotIndex{\',\.,\@M,\@@input,\@addtoreset,\@arabic,\@badmath}
65 % \DoNotIndex{\@centercr,\@cite}
66 % \DoNotIndex{\@dotsep,\@empty,\@float,\@gobble,\@gobbletwo,\@ignoretrue}
67 % \DoNotIndex{\@input,\@ixpt,\@m}
68 % \DoNotIndex{\@minus,\@mkboth,\@ne,\@nil,\@nomath,\@plus,\@set@topoint}
69 % \DoNotIndex{\@tempboxa,\@tempcnta,\@tempdima,\@tempdimb}
70 % \DoNotIndex{\@tempswafalse,\@tempswatrue,\@viipt,\@viiipt,\@vipt}
71 % \DoNotIndex{\@vpt,\@warning,\@xiipt,\@xipt,\@xivpt,\@xpt,\@xviipt}
72 % \DoNotIndex{\@xxpt,\@xxvpt,\\,\ ,\addpenalty,\addtolength,\addvspace}
73 % \DoNotIndex{\advance,\Alph,\alph}
74 % \DoNotIndex{\arabic,\ast,\begin,\begingroup,\bfseries,\bgroup,\box}
75 % \DoNotIndex{\bullet}
76 % \DoNotIndex{\cdot,\cite,\CodelineIndex,\cr,\day,\DeclareOption}
77 % \DoNotIndex{\def,\DisableCrossrefs,\divide,\DocInput,\documentclass}
78 % \DoNotIndex{\DoNotIndex,\egroup,\ifdim,\else,\fi,\em,\endtrivlist}
79 % \DoNotIndex{\EnableCrossrefs,\end,\end@dblfloat,\end@float,\endgroup}
80 % \DoNotIndex{\endlist,\everycr,\everypar,\ExecuteOptions,\expandafter}
81 % \DoNotIndex{\fbox}
82 % \DoNotIndex{\filedate,\filename,\fileversion,\fontsize,\framebox,\gdef}
83 % \DoNotIndex{\global,\halign,\hangindent,\hbox,\hfil,\hfill,\hrule}
84 % \DoNotIndex{\hsize,\hskip,\hspace,\hss,\if@tempswa,\ifcase,\or,\fi,\fi}
85 % \DoNotIndex{\ifhmode,\ifvmode,\ifnum,\iftrue,\ifx,\fi,\fi,\fi,\fi,\fi}
86 % \DoNotIndex{\input}
87 % \DoNotIndex{\jobname,\kern,\leavevmode,\let,\leftmark}
88 % \DoNotIndex{\list,\llap,\long,\m@ne,\m@th,\mark,\markboth,\markright}
89 % \DoNotIndex{\month,\newcommand,\newcounter,\newenvironment}
90 % \DoNotIndex{\NeedsTeXFormat,\newdimen}
91 % \DoNotIndex{\newlength,\newpage,\nobreak,\noindent,\null,\number}
92 % \DoNotIndex{\numberline,\OldMakeindex,\OnlyDescription,\p@}
93 % \DoNotIndex{\pagestyle,\par,\paragraph,\paragraphmark,\parfillskip}
94 % \DoNotIndex{\penalty,\PrintChanges,\PrintIndex,\ProcessOptions}
95 % \DoNotIndex{\protect,\ProvidesClass,\raggedbottom,\raggedright}
96 % \DoNotIndex{\refstepcounter,\relax,\renewcommand,\reset@font}
97 % \DoNotIndex{\rightmargin,\rightmark,\rightskip,\rlap,\rmfamily,\roman}
98 % \DoNotIndex{\roman,\secdef,\selectfont,\setbox,\setcounter,\setlength}
99 % \DoNotIndex{\settowidth,\sfcode,\skip,\sloppy,\slshape,\space}
100 % \DoNotIndex{\symbol,\the,\trivlist,\typeout,\tw@,\undefined,\uppercase}
101 % \DoNotIndex{\usecounter,\usefont,\usepackage,\vfil,\vfill,\viiipt}
102 % \DoNotIndex{\viipt,\vipt,\vskip,\vspace}
103 % \DoNotIndex{\wd,\xiipt,\year,\z@}
104 %
105 % \changes{v1.0}{1999/03/14}{First public release}
106 % \changes{v1.1}{2000/09/30}{Changed some encodings to match the series}
107 % \changes{v1.2}{2005/06/18}{Added map file}
108 %
109 % \def\fileversion{v1.0} \def\filedate{1999/03/14}
110 % \def\fileversion{v1.1} \def\filedate{2000/09/30}
111 % \def\fileversion{v1.2} \def\filedate{2005/06/18}
112 % \newcommand*{\Lpack}[1]{\textsf {#1}} ^^A typeset a package
113 % \newcommand*{\Lopt}[1]{\textsf {#1}} ^^A typeset an option
114 % \newcommand*{\file}[1]{\texttt {#1}} ^^A typeset a file
115 % \newcommand*{\Lcount}[1]{\textsl {\small#1}} ^^A typeset a counter
116 % \newcommand*{\pstyle}[1]{\textsl {#1}} ^^A typeset a pagestyle
117 % \newcommand*{\Lenv}[1]{\texttt {#1}} ^^A typeset an environment
118 % \newcommand{\BC}{\textsc{bc}}
119 % \newcommand{\AD}{\textsc{ad}}
120 % \newcommand{\thisfont}{Ugaritic Cuneiform}
121 %
122 %
123 % \title{The \Lpack{Ugaritic Cuneiform} font\thanks{This
124 % file has version number \fileversion, last revised
125 % \filedate.}}
126 %
127 % \author{%
128 % Peter Wilson\thanks{\texttt{herries dot press at earthlink dot net}}\\
129 % Herries Press }
130 % \date{\filedate}
131 % \maketitle
132 % \begin{abstract}
133 % The \Lpack{ugarite} bundle provides a set of fonts for the
134 % \thisfont{} alphabetic script which was used around 1300~\BC{} in the Middle East.
135 % \end{abstract}
136 % \tableofcontents
137 %
138 %
139 %
140 % \section{Introduction}
141 %
142 %
143 % The Phoenician alphabet and characters is a direct ancestor of our modern day
144 % Latin alphabet and fonts.
145 % The \thisfont{} font presented here is one of a series of fonts intended
146 % to show how
147 % the modern Latin alphabet has evolved from its original Phoenician form
148 % to its present day appearance.
149 %
150 % This manual is typeset according to the conventions of the
151 % \LaTeX{} \textsc{docstrip} utility which enables the automatic
152 % extraction of the \LaTeX{} macro source files~\cite{GOOSSENS94}.
153 %
154 % Section~\ref{sec:usc} describes the usage of the package.
155 % Commented code for the fonts and source code for the package is in
156 % later sections.
157 %
158 % \subsection{An alphabetic tree}
159 %
160 % Scholars are reasonably agreed that all the world's alphabets are descended
161 % from a Semitic alphabet invented about 1600~\BC{} in the Middle
162 % East~\cite{DRUCKER95}. The word `Semitic' refers
163 % to the family of languages used in the geographical area from
164 % Sinai in the south, up the Mediterranean coast to Asia Minor in the north and
165 % west to the valley of the Euphrates.
166 %
167 % The Phoenician alphabet was stable by about 1100~\BC{} and the script was
168 % written right to left. In earlier times the writing direction was variable,
169 % and so were
170 % the shapes and orientation of the characters. The alphabet consisted of
171 % 22 letters and they were named after things. For example, their first two
172 % letters were called \textit{aleph} (ox), and \textit{beth} (house).
173 % The Phoenician script had
174 % only one case --- unlike our modern fonts which have both upper- and
175 % lower-cases. In modern terms the Phoenician abecedary was: \\
176 % A B G D E Y Z H $\Theta$ I K L M N X O P ts Q R S T \\
177 % where the `Y' (\textit{vau}) character was sometimes written as `F', and
178 % `ts' stands for the \textit{tsade} character.
179 %
180 % The Greek alphabet is one of the descendants of the Phoenician alphabet;
181 % another was Aramaic which is the ancestor of the Arabic, Persian and Indian
182 % scripts.
183 % Initially Greek was written right to left but around the 6th C~\BC{} became
184 % \textit{boustrophedron}, meaning that the lines
185 % alternated in direction. At about 500~\BC{} the writing direction stabilised
186 % as left to
187 % right. The Greeks modified the Phoenician alphabet to match the vocalisation
188 % of their language. They kept the Phoenician names of the letters, suitably
189 % `greekified', so \textit{aleph} became the familar \textit{alpha} and
190 % \textit{beth} became \textit{beta}. At this
191 % point the names of the letters had no meaning. Their were several variants
192 % of the Greek character glyphs until they were finally fixed in Athens in
193 % 403~\BC.
194 % The Greeks did not develop a lower-case
195 % script until about 600--700~\AD.
196 %
197 % The Etruscans based their alphabet on the Greek one, and again modified it.
198 % However, the Etruscans wrote right to left, so their borrowed characters are
199 % mirror images of the original Greek ones. Like the Phoenicians, the Etruscan
200 % script consisted of only one case; they died out before ever needing a
201 % lower-case script. The Etruscan script was used up until the first century
202 % \AD, even though the Etruscans themselves had dissapeared by that time.
203 %
204 %
205 % In turn, the Romans based their alphabet on the Etruscan one, but as they
206 % wrote left to right, the characters were again mirrored (although the early
207 % Roman inscriptions are boustrophedron).
208 %
209 % As the English alphabet is descended from the Roman alphabet
210 % it has a pedigree of some three and a half thousand years.
211 %
212 % \section{The \Lpack{ugarite} package} \label{sec:usc}
213 %
214 % The earliest cuneiform writing, about 2800~\BC, was used by
215 % the Sumerians in the Middle East~\cite{WALKER87,HEALEY90}.
216 % Other cuneiform scripts were used for Akkadian (2300~\BC) and
217 % Babylonian (2000~\BC). These were partly ideographic and partly
218 % syllabic scripts. The last dated use of a cuneiform script was
219 % in 75~\AD.
220 %
221 % The \thisfont{} script came from Ugarit (Ras Shamura) on the
222 % Syrian coast and was used for a language related to Hebrew and
223 % one of the precusors of Phoenician. Unlike the other cuneiform
224 % scripts, \thisfont{} is alphabetic, and the order is known from
225 % some abecedaries that have been found.
226 %
227 % The full alphabetic script has 30 letters, plus a word divider in
228 % the form of a short vertical stroke. The full script was used in
229 % administrative texts, but the last three letters were dropped when
230 % writing literary texts.
231 %
232 %
233 % Table~\ref{tab} lists, in the \thisfont{} alphabetical order, the
234 % transliterated value of the characters and, where I know it, the
235 % modern name of the character.
236 %
237 % \begin{table}
238 % \centering
239 % \caption{The \thisfont{} script and alphabet}\label{tab}
240 % \begin{tabular}{clcll} \hline
241 % Value & Name? & ASCII & Command & Command \\ \hline
242 % \textit{a} &
243 % aleph &
244 % ' a & |\Arq| |\Aa| &
245 % |\Aaleph|
246 % \\
247 % \textit{b} &
248 % beth &
249 % b & |\Ab| &
250 % |\Abeth|
251 % \\
252 % \textit{g} &
253 % gimel &
254 % g & |\Ag| &
255 % |\Agimel|
256 % \\
257 % \textit{\Uunder{h}} &
258 % &
259 % I & |\Ahu| &
260 %
261 % \\
262 % \textit{d} &
263 % daleth &
264 % d & |\Ad| &
265 % |\Adaleth|
266 % \\
267 % \textit{h} &
268 % he &
269 % h & |\Ah| &
270 % |\Ahe|
271 % \\
272 % \textit{w} &
273 % vav &
274 % w & |\Aw| &
275 % |\Avav|
276 % \\
277 % \textit{z} &
278 % zayin &
279 % z & |\Az| &
280 % |\Azayin|
281 % \\
282 % \textit{\d{h}} &
283 % heth &
284 % H & |\Ahd| &
285 % |\Aheth|
286 % \\
287 % \textit{\d{t}} &
288 % teth &
289 % T & |\Atd| &
290 % |\Ateth|
291 % \\
292 % \textit{y} &
293 % yod &
294 % y & |\Ay| &
295 % |\Ayod|
296 % \\
297 % \textit{k} &
298 % kaph &
299 % k & |\Ak| &
300 % |\Akaph|
301 % \\
302 % \textit{\'{s}} &
303 % &
304 % X & |\Asa| &
305 %
306 % \\
307 % \textit{l} &
308 % lamed &
309 % l & |\Al| &
310 % |\Alamed|
311 % \\
312 % \textit{m} &
313 % mem &
314 % m & |\Am| &
315 % |\Amem|
316 % \\
317 % \textit{\b{d}} &
318 % &
319 % D & |\Adb| &
320 %
321 % \\
322 % \textit{n} &
323 % nun &
324 % n & |\An| &
325 % |\Anun|
326 % \\
327 % \textit{\d{z}} &
328 % &
329 % Z & |\Azd| &
330 %
331 % \\
332 % \textit{s} &
333 % samekh &
334 % s & |\As| &
335 % |\Asamekh|
336 % \\
337 % \textit{`} &
338 % ayin &
339 % ` o & |\Alq| |\Ao| &
340 % |\Aayin|
341 % \\
342 % \textit{p} &
343 % pe &
344 % p & |\Ap| &
345 % |\Ape|
346 % \\
347 % \textit{\d{s}} &
348 % sade &
349 % x & |\Asd| &
350 % |\Asade|
351 % \\
352 % \textit{q} &
353 % qoph &
354 % q & |\Aq| &
355 % |\Aqoph|
356 % \\
357 % \textit{r} &
358 % resh &
359 % r & |\Ar| &
360 % |\Aresh|
361 % \\
362 % \textit{\b{t}} &
363 % &
364 % J & |\Atb| &
365 %
366 % \\
367 % \textit{\.{g}} &
368 % &
369 % G & |\Agd| &
370 %
371 % \\
372 % \textit{t} &
373 % tav &
374 % t & |\At| &
375 % |\Atav|
376 % \\
377 % \textit{i} &
378 % &
379 % i & |\Ai| &
380 %
381 % \\
382 % \textit{u} &
383 % &
384 % u & |\Au| &
385 %
386 % \\
387 % \textit{\`{s}} &
388 % &
389 % V & |\Asg| &
390 %
391 % \\
392 % \textit{:} &
393 % word divider &
394 % : & |\Awd| &
395 %
396 % \\
397 % \hline
398 % \end{tabular}
399 % \end{table}
400 %
401 %
402 % \DescribeMacro{\cugarfamily}
403 % This command selects the \thisfont{} font family.
404 % The family name is |cugar|.
405 %
406 % \DescribeMacro{\textcugar}
407 % The command |\textcugar{|\meta{ASCII/commands}|}|
408 % typesets \meta{ASCII/commands} in the
409 % \thisfont{} font.
410 %
411 % I have provided two, and sometimes three, ways of accessing the \thisfont{} glyphs:
412 % (a) by ASCII characters,
413 % (b) by commands whose names are based on the transliterated values, and
414 % (c) by commands whose names are based on the (modern) name of the
415 % character.
416 % These are shown in Table~\ref{tab}.
417 %
418 %
419 % \DescribeMacro{\translitcugar}
420 % The command |\translitcugar{|\meta{commands}|}| will typeset the
421 % transliteration of the Ugarite character commnds (those in the
422 % last two columns of Table~\ref{tab}).
423 %
424 % \DescribeMacro{\translitcugarfont}
425 % The font used for the transliteration is defined by this macro,
426 % which is initialised to an italic font (i.e., |\itshape|).
427 %
428 %
429 % \StopEventually{
430 % \bibliographystyle{alpha}
431 % \begin{thebibliography}{GMS94}
432 %
433 % \bibitem[Dav97]{DAVIES97}
434 % W. V. Davies.
435 % \newblock \emph{Reading the Past: Egyptian Hieroglyphs}.
436 % \newblock University of California Press/British Museum, 1997.
437 % \newblock (ISBN 0-520-06287-6)
438 %
439 % \bibitem[Dru95]{DRUCKER95}
440 % Johanna Drucker.
441 % \newblock \emph{The Alphabetic Labyrinth}.
442 % \newblock Thames and Hudson, 1995.
443 %
444 % \bibitem[Fir93]{FIRMAGE93}
445 % Richard A.~Firmage.
446 % \newblock \emph{The Alphabet Abecedarium}.
447 % \newblock David R.~Goodine, 1993.
448 %
449 % \bibitem[GMS94]{GOOSSENS94}
450 % Michel Goossens, Frank Mittelbach, and Alexander Samarin.
451 % \newblock \emph{The LaTeX Companion}.
452 % \newblock Addison-Wesley Publishing Company, 1994.
453 %
454 % \bibitem[Hea90]{HEALEY90}
455 % John F.~Healey.
456 % \newblock \emph{Reading the Past: The Early Alphabet}.
457 % \newblock University of California Press/British Museum, 1990.
458 % \newblock (ISBN 0-520-07309-6)
459 %
460 % \bibitem[Wal87]{WALKER87}
461 % C.~B.~F.~Walker.
462 % \newblock \emph{Reading the Past: Cuneiform}.
463 % \newblock University of California Press/British Museum, 1987.
464 % \newblock (ISBN 0-520-06115-2)
465 %
466 % \end{thebibliography}
467 % \PrintIndex
468 % }
469 %
470 %
471 % \section{The Metafont code} \label{sec:mf}
472 %
473 % \subsection{The parameter file}
474 %
475 % We deal with the parameter file first, and start by announcing
476 % what it is for.
477 % \begin{macrocode}
478 %<*up>
479 %%% CUGAR10.MF Computer Ugaritic Cuneiform font 10 point design size.
480
481 % \end{macrocode}
482 % Specify the font size.
483 % \begin{macrocode}
484
485 font_identifier:="ugarite"; font_size 10pt#;
486
487 % \end{macrocode}
488 %
489 %
490 % \begin{macro}{u}
491 % \begin{macro}{ht}
492 % \begin{macro}{s}
493 % \begin{macro}{o}
494 % \begin{macro}{px}
495 % \begin{macro}{font-normal-space}
496 % \begin{macro}{font-normal-shrink}
497 % \begin{macro}{font-x-height}
498 % \begin{macro}{font-quad}
499 % Define the very simple font parameters.
500 % \begin{macrocode}
501 u#:=.2pt#; % unit width
502 ht#:=8pt#; % height of characters (CM cap-height is approx 6.8pt)
503 s#:=1.5pt#; % width correction (right and left)
504 o#:=1/20pt#; % overshoot
505 px#:=.4pt#; % horizontal width of pen
506 font_normal_space:=7pt#; % width of a blank space
507 font_normal_shrink:=.9pt#; % width correction for blank space
508 font_x_height:=4.5pt#; % height of one ex
509 font_quad:=10pt#; % an em
510
511 % \end{macrocode}
512 % \end{macro}
513 % \end{macro}
514 % \end{macro}
515 % \end{macro}
516 % \end{macro}
517 % \end{macro}
518 % \end{macro}
519 % \end{macro}
520 % \end{macro}
521 %
522 % For a full font the driver file would normally be called here.
523 % In this case I have embedded it.
524 % \begin{macrocode}
525
526 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
527 % end of parameters
528 % start of driver code
529 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
530
531 % \end{macrocode}
532 %
533 %
534 % \subsection{The driver file}
535 %
536 % If there was a driver file, this would be its contents.
537 %
538 % \begin{macrocode}
539
540 font_coding_scheme:="Ugarite glyphs";
541 mode_setup;
542
543 % \end{macrocode}
544 %
545 % \begin{macro}{ho}
546 % \begin{macro}{leftloc}
547 % \begin{macro}{py}
548 % Perform additional setup.
549 % \begin{macrocode}
550 ho#:=o#; % horizontal overshoot
551 leftloc#:=s#; % leftmost xcoord of character
552 py#:=px#; % vertical thickness of the pen
553
554 define_pixels(s,u);
555 define_blacker_pixels(px,py);
556 define_good_x_pixels(leftloc);
557 define_corrected_pixels(o); % turn on overshoot correction
558 define_horizontal_corrected_pixels(ho);
559
560 % \end{macrocode}
561 % \end{macro}
562 % \end{macro}
563 % \end{macro}
564 %
565 % \begin{macro}{midloc}
566 % \begin{macro}{rightloc}
567 % \begin{macro}{aw}
568 % Variables for the middldle and rightmost xcoord of a character, and
569 % the actual width of a character.
570 % \begin{macrocode}
571 numeric midloc, rightloc, aw;
572 % \end{macrocode}
573 % \end{macro}
574 % \end{macro}
575 % \end{macro}
576 %
577 % \begin{macro}{stylus}
578 % Define the pen.
579 % \begin{macrocode}
580 pickup pencircle xscaled px yscaled py;
581 stylus:=savepen;
582
583 % \end{macrocode}
584 % \end{macro}
585 %
586 % \begin{macro}{trht}
587 % \begin{macro}{trbs}
588 % The normal height and base of a triangle.
589 % \begin{macrocode}
590 numeric trht, trbs;
591 % \end{macrocode}
592 % \end{macro}
593 % \end{macro}
594 %
595 % \begin{macro}{th}
596 % \begin{macro}{tb}
597 % The ratio of the normal height and base of a triangle with respect to
598 % the character height.
599 % \begin{macrocode}
600 numeric th, tb;
601 th = 6/24; tb = 8/24;
602 % \end{macrocode}
603 % \end{macro}
604 % \end{macro}
605 %
606 % \begin{macro}{wiht}
607 % \begin{macro}{wibs}
608 % The normal height and base of a wing.
609 % \begin{macrocode}
610 numeric wiht, wibs;
611 % \end{macrocode}
612 % \end{macro}
613 % \end{macro}
614 %
615 % \begin{macro}{wh}
616 % \begin{macro}{wb}
617 % The ratio of the normal height and base of a wing with respect to
618 % the character height.
619 % \begin{macrocode}
620 numeric wh, wb;
621 wh = 10/24; wb = 20/24;
622 % \end{macrocode}
623 % \end{macro}
624 % \end{macro}
625 %
626 %
627 % \begin{macro}{beginglyph}
628 % A macro to save some typing of beginchar arguments, and also assigns
629 % values to various variables.
630 %
631 % \begin{macrocode}
632 def beginglyph(expr code, unit_width) =
633 beginchar(code, unit_width*ht#+2s#, ht#, 0);
634 midloc:=1/2w; rightloc:=(w-s); aw := rightloc-leftloc;
635 trht := th*h; trbs := tb*h;
636 wiht := wh*h; wibs := wb*h;
637 pickup stylus enddef;
638
639 % \end{macrocode}
640 % \end{macro}
641 %
642 % \begin{macro}{cmchar}
643 % |cmchar| should precede each character
644 % \begin{macrocode}
645 let cmchar=\;
646
647 % \end{macrocode}
648 % \end{macro}
649 %
650 % \begin{macro}{triangle}
651 % |triangle($, ht, base, angle)| calculates the points on a triangle
652 % whose apex is at |z$|, of height |ht| and base width |base| rotated
653 % at |angle| from pointing along the positive |x| axis.
654 % \begin{macrocode}
655
656 def triangle(suffix $)(expr ht, bs, ang) =
657 path pth[];
658 pair pr[];
659 pr1 := (x$-ht,y$); % midpoint of base in default position
660 pr2 := pr1 shifted (1/2bs*up); % base points
661 pr3 := pr1 shifted (1/2bs*down);
662 z$trl = pr2 rotatedaround(z$, ang);
663 z$trr = pr3 rotatedaround(z$, ang);
664 z$trc = 1/2[z$trl,z$trr];
665 z$tic = 1/2[z$,z$trc];
666 pth$ := z$--z$trl--z$trr--cycle;
667 enddef;
668
669 % \end{macrocode}
670 % \end{macro}
671 %
672 % \begin{macro}{trir}
673 % |trir($, ht, base)| calculates the points on a triangle
674 % whose apex is at |z$|, of height |ht| and base width |base|
675 % pointing in the positive |x| direction (i.e., Right).
676 % \begin{macrocode}
677
678 def trir(suffix $)(expr ht, bs) =
679 path pth[];
680 z$trc = (x$-ht, y$); % midpoint of base
681 z$trl = (x$trc, y$trc+1/2bs); % base points
682 z$trr = (x$trc, y$trc-1/2bs);
683 z$tic = 1/2[z$,z$trc];
684 pth$ := z$--z$trl--z$trr--cycle;
685 enddef;
686
687 % \end{macrocode}
688 % \end{macro}
689 %
690 % \begin{macro}{triu}
691 % |triu($, ht, base)| calculates the points on a triangle
692 % whose apex is at |z$|, of height |ht| and base width |base|
693 % pointing in the positive |y| direction (i.e. Up).
694 % \begin{macrocode}
695
696 def triu(suffix $)(expr ht, bs) =
697 path pth[];
698 z$trc = (x$, y$-ht); % midpoint of base
699 z$trl = (x$-1/2bs, y$trc); % base points
700 z$trr = (x$+1/2bs, y$trc); % base points
701 z$tic = 1/2[z$,z$trc];
702 pth$ := z$--z$trl--z$trr--cycle;
703 enddef;
704
705 % \end{macrocode}
706 % \end{macro}
707 %
708 % \begin{macro}{tril}
709 % |tril($, ht, base)| calculates the points on a triangle
710 % whose apex is at |z$|, of height |ht| and base width |base|
711 % pointing in the negative |x| direction (i.e., Left).
712 % \begin{macrocode}
713
714 def tril(suffix $)(expr ht, bs) =
715 path pth[];
716 z$trc = (x$+ht, y$); % midpoint of base
717 z$trl = (x$trc, y$trc-1/2bs); % base points
718 z$trr = (x$trc, y$trc+1/2bs);
719 z$tic = 1/2[z$,z$trc];
720 pth$ := z$--z$trl--z$trr--cycle;
721 enddef;
722
723 % \end{macrocode}
724 % \end{macro}
725 %
726 % \begin{macro}{trid}
727 % |tril($, ht, base)| calculates the points on a triangle
728 % whose apex is at |z$|, of height |ht| and base width |base|
729 % pointing in the negative |x| direction (i.e., Left).
730 % \begin{macrocode}
731
732 def tril(suffix $)(expr ht, bs) =
733 path pth[];
734 z$trc = (x$+ht, y$); % midpoint of base
735 z$trl = (x$trc, y$trc-1/2bs); % base points
736 z$trr = (x$trc, y$trc+1/2bs);
737 z$tic = 1/2[z$,z$trc];
738 pth$ := z$--z$trl--z$trr--cycle;
739 enddef;
740
741 % \end{macrocode}
742 % \end{macro}
743 %
744 % \begin{macro}{trid}
745 % |trid($, ht, base)| calculates the points on a triangle
746 % whose apex is at |z$|, of height |ht| and base width |base|
747 % pointing in the negative |y| direction (i.e. Down).
748 % \begin{macrocode}
749
750 def trid(suffix $)(expr ht, bs) =
751 path pth[];
752 z$trc = (x$, y$+ht); % midpoint of base
753 z$trl = (x$+1/2bs, y$trc); % base points
754 z$trr = (x$-1/2bs, y$trc); % base points
755 z$tic = 1/2[z$,z$trc];
756 pth$ := z$--z$trl--z$trr--cycle;
757 enddef;
758
759 % \end{macrocode}
760 % \end{macro}
761 %
762 % \begin{macro}{wing}
763 % |wing($, ht, base, angle)| calculates the points on a `flying wing'
764 % whose apex is at |z$|, of height |ht| and base width |base| rotated
765 % at |angle| from pointing along the negative |x| axis.
766 % \begin{macrocode}
767
768 def wing(suffix $)(expr ht, bs, ang) =
769 path pth[];
770 pair pr[];
771 pr1 := (x$+ht,y$); % midpoint of base in default position
772 pr2 := pr1 shifted (1/2bs*down); % base points
773 pr3 := pr1 shifted (1/2bs*up);
774 pr4 := pr1 rotatedaround(z$, ang);
775 z$wil = pr2 rotatedaround(z$, ang);
776 z$wir = pr3 rotatedaround(z$, ang);
777 z$wic = 1/2[z$,pr4];
778 pth$ := z$--z$wil{(z$wic-z$wil)}..z$wic..{(z$wir-z$wic)}z$wir--cycle;
779 enddef;
780
781 % \end{macrocode}
782 % \end{macro}
783 %
784 % \begin{macro}{wingl}
785 % |wingl($, ht, base)| calculates the points on a `flying wing'
786 % whose apex is at |z$|, of height |ht| and base width |base|
787 % pointing in the negative |x| direction (i.e., Left).
788 % \begin{macrocode}
789
790 def wingl(suffix $)(expr ht, bs) =
791 path pth[];
792 z$wil = (x$+ht, y$-1/2bs); % base points
793 z$wir = (x$wil, y$+1/2bs);
794 z$wic = (1/2[x$,x$wil], y$); % midpoint of base curve
795 pth$ := z$--z$wil{(z$wic-z$wil)}..z$wic..{(z$wir-z$wic)}z$wir--cycle;
796 enddef;
797
798 % \end{macrocode}
799 % \end{macro}
800 %
801 % \begin{macro}{wingd}
802 % |wingd($, ht, base)| calculates the points on a `flying wing'
803 % whose apex is at |z$|, of height |ht| and base width |base|
804 % pointing in the negative |y| direction (i.e., Down).
805 % \begin{macrocode}
806
807 def wingd(suffix $)(expr ht, bs) =
808 path pth[];
809 z$wil = (x$+1/2bs, y$+ht); % base points
810 z$wir = (x$-1/2bs, y$wil);
811 z$wic = (x$, 1/2[y$,y$wil]); % midpoint of base curve
812 pth$ := z$--z$wil{(z$wic-z$wil)}..z$wic..{(z$wir-z$wic)}z$wir--cycle;
813 enddef;
814
815 % \end{macrocode}
816 % \end{macro}
817 %
818 % \begin{macro}{wingr}
819 % |wingr($, ht, base)| calculates the points on a `flying wing'
820 % whose apex is at |z$|, of height |ht| and base width |base|
821 % pointing in the positive |x| direction (i.e., Right).
822 % \begin{macrocode}
823
824 def wingr(suffix $)(expr ht, bs) =
825 path pth[];
826 z$wil = (x$-ht, y$+1/2bs); % base points
827 z$wir = (x$wil, y$-1/2bs);
828 z$wic = (1/2[x$,x$wil], y$); % midpoint of base curve
829 pth$ := z$--z$wil{(z$wic-z$wil)}..z$wic..{(z$wir-z$wic)}z$wir--cycle;
830 enddef;
831
832 % \end{macrocode}
833 % \end{macro}
834 %
835 % \begin{macro}{wingu}
836 % |wingu($, ht, base)| calculates the points on a `flying wing'
837 % whose apex is at |z$|, of height |ht| and base width |base|
838 % pointing in the positive |y| direction (i.e., Up).
839 % \begin{macrocode}
840
841 def wingu(suffix $)(expr ht, bs) =
842 path pth[];
843 z$wil = (x$-1/2bs, y$-ht); % base points
844 z$wir = (x$+1/2bs, y$wil);
845 z$wic = (x$, 1/2[y$,y$wil]); % midpoint of base curve
846 pth$ := z$--z$wil{(z$wic-z$wil)}..z$wic..{(z$wir-z$wic)}z$wir--cycle;
847 enddef;
848
849 % \end{macrocode}
850 % \end{macro}
851 %
852 % This would be the end of a seperate driver file, except for calling
853 % the glyph code.
854 %
855 % \subsection{The glyph code}
856 %
857 % The following code generates the glyphs for the \thisfont{} font.
858 % The characters
859 % are defined in the original alphabetic ordering.
860 %
861 % \begin{macrocode}
862
863 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
864 % end of driver code
865 % start of glyph code
866 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
867
868 % \end{macrocode}
869 %
870 % \begin{macro}{'}
871 % The \thisfont{} ' (semitic aleph).
872 % \begin{macrocode}
873
874 cmchar "Ugarite letter '";
875 beginglyph("'", 24/24);
876 z1trc=(leftloc,1/2h);
877 trir(1, trht, trbs); fill pth1;
878 z2trc=z1;
879 trir(2, trht, trbs); fill pth2;
880 z4=(rightloc,y1tic); draw z1tic--z4;
881 labels(1,1trc,2,3,4);
882 endchar;
883
884 % \end{macrocode}
885 % \end{macro}
886 %
887 % \begin{macro}{a}
888 % The \thisfont{} ' (semitic aleph).
889 % \begin{macrocode}
890
891 cmchar "Ugarite letter ' (coded as a)";
892 beginglyph("a", 24/24);
893 z1trc=(leftloc,1/2h);
894 trir(1, trht, trbs); fill pth1;
895 z2trc=z1;
896 trir(2, trht, trbs); fill pth2;
897 z4=(rightloc,y1tic); draw z1tic--z4;
898 labels(1,1trc,2,3,4);
899 endchar;
900
901 % \end{macrocode}
902 % \end{macro}
903 %
904 %
905 % \begin{macro}{b}
906 % The \thisfont{} B.
907 % \begin{macrocode}
908
909 cmchar "Ugarite letter b";
910 beginglyph("b", (th+3/2tb));
911 z1trr=(leftloc,0); % bottom pin
912 trir(1, trht, trbs); fill pth1;
913 z3trc=(x1,h); % left pin
914 trid(3, trht, trbs); fill pth3;
915 z4trr=z3trl; % right pin
916 trid(4, trht, trbs); fill pth4;
917 z2=(x4,y1);
918 trir(2, trht, trbs); fill pth2; % second bottom head
919 rt x21 = rightloc; y21=y1tic; % bodies
920 draw z1tic--z21;
921 draw z3tic--z1; draw z4tic--z2;
922 labels(1,2,3,4);
923 endchar;
924
925 % \end{macrocode}
926 % \end{macro}
927 %
928 % \begin{macro}{g}
929 % The \thisfont{} G.
930 % \begin{macrocode}
931
932 cmchar "Ugarite letter g";
933 beginglyph("g", tb);
934 z1trc=(midloc,h);
935 trid(1, trht, trbs); fill pth1;
936 z13=(x1,0); draw z1tic--z13;
937 labels(1,1trl,1trc,1trr,11,13);
938 endchar;
939
940 % \end{macrocode}
941 % \end{macro}
942 %
943 % \begin{macro}{I}
944 % The \thisfont{} letter H with a u under.
945 % \begin{macrocode}
946
947 cmchar "Ugarite letter h sub u (I)";
948 beginglyph("I", tb);
949 z1trc=(midloc,h);
950 trid(1, trht, trbs); fill pth1; % top head
951 z2trc=(x1trc,y1);
952 trid(2, trht, trbs); fill pth2; % middle head
953 z3trc=(x1trc,y2);
954 trid(3, trht, trbs); fill pth3; % bottom head
955 z13=(x1,0); draw z1tic--z13;
956 labels(1,2,3,4,5,6,11,13);
957 endchar;
958
959 % \end{macrocode}
960 % \end{macro}
961 %
962 % \begin{macro}{d}
963 % The \thisfont{} letter D.
964 % \begin{macrocode}
965
966 cmchar "Ugarite letter d";
967 beginglyph("d", (th+5/2tb));
968 z1trr=(leftloc,0);
969 trir(1, trht, trbs); fill pth1; % bottom left head
970 z11trc=(x1,h); % top left head
971 trid(11, trht, trbs); fill pth11;
972 z12trr=z11trl; % top center head
973 trid(12, trht, trbs); fill pth12;
974 z13trr=z12trl; % top right head
975 trid(13, trht, trbs); fill pth13;
976 z2=(x12,y1); % bottom center head
977 trir(2, trht, trbs); fill pth2;
978 z3=(x13,y1); % bottom right head
979 trir(3, trht, trbs); fill pth3;
980 rt x3' = rightloc; y3'=y1tic; % bodies
981 draw z1tic--z3';
982 draw z11tic--z1; draw z12tic--z2; draw z13tic--z3;
983 labels(1,2,3,4,11,12,13);
984 endchar;
985
986 % \end{macrocode}
987 % \end{macro}
988 %
989 % \begin{macro}{h}
990 % The \thisfont{} letter H.
991 % \begin{macrocode}
992
993 cmchar "Ugarite letter h";
994 beginglyph("h",24/24);
995 z2trc = (leftloc,1/2h); % center head
996 trir(2, trht, trbs); fill pth2;
997 z1trr=z2trl; % top head
998 trir(1, trht, trbs); fill pth1;
999 z3trl=z2trr; % bottom head
1000 trir(3, trht, trbs); fill pth3;
1001 y1'' = y1; y2'' = y2; y3'' = y3; % bodies
1002 x1'' = x2'' = x3'' = rightloc;
1003 draw z1tic--z1''; draw z2tic--z2''; draw z3tic--z3'';
1004 labels(1,2,3,4,5,6,7,8,9,10); endchar;
1005
1006 % \end{macrocode}
1007 % \end{macro}
1008 %
1009 % \begin{macro}{w}
1010 % The \thisfont{} letter W.
1011 % \begin{macrocode}
1012
1013 cmchar "Ugarite letter w";
1014 beginglyph("w", (5th));
1015 z1trr=(leftloc,1/2h); % top head
1016 trir(1, trht, trbs); fill pth1;
1017 z2trl=z1trr; % bottom head
1018 trir(2, trht, trbs); fill pth2;
1019 z3trc=(3/6aw, 1/2h); % center left head
1020 trir(3, trht, trbs); fill pth3;
1021 z4trc=z3; % center right head
1022 trir(4, trht, trbs); fill pth4;
1023 x1''=x3trc; y1'' = y1; % left bodies
1024 x2''=x3trc; y2'' = y2;
1025 x3''=rightloc; y3'' = y3;
1026 draw z1tic--z1'';
1027 draw z2tic--z2'';
1028 draw z3tic--z3'';
1029 labels(1,2,3,4,5,6,7,8,9,10);
1030 endchar;
1031
1032 % \end{macrocode}
1033 % \end{macro}
1034 %
1035 % \begin{macro}{z}
1036 % The \thisfont{} letter Z.
1037 % \begin{macrocode}
1038
1039 cmchar "Ugarite letter z";
1040 beginglyph("z", tb);
1041 z1trc=(midloc,h);
1042 trid(1, trht, trbs); fill pth1; % top head
1043 z2trc=(x1trc,y1);
1044 trid(2, trht, trbs); fill pth2; % middle head
1045 z1''=(x1,0); draw z1tic--z1'';
1046 labels(1,2,3,4,5,6,7,8,9,10);
1047 endchar;
1048
1049 % \end{macrocode}
1050 % \end{macro}
1051 %
1052 % \begin{macro}{H}
1053 % The \thisfont{} letter H sub d.
1054 % \begin{macrocode}
1055
1056 cmchar "Ugarite letter H sub d (H)";
1057 beginglyph("H", (4tb)); % 3tb too small
1058 numeric n[];
1059 z1trc=(leftloc,1/2h); % left head
1060 trir(1, trht, trbs); fill pth1;
1061 z2trc=(midloc,h); % top middle head
1062 trid(2, trht, trbs); fill pth2;
1063 n1 := 3/2trbs; % base of small wing % 2trbs too large
1064 n2 := 1/2n1; % height of small wing
1065 z3 = (rightloc-n2,y1);
1066 wingl(3, n2, n1); fill pth3;
1067 z4 = (x2,y1);
1068 z5=(1/2[x1,x3], y4-trht-1/2trbs); % bottom head
1069 triangle(5, trht, trbs, -45); fill pth5;
1070 z5'=whatever[z5trc,z5]; y5'=0;
1071 draw z1tic--z3;
1072 draw z2tic--z4;
1073 draw z5tic--z5';
1074 labels(1,2,3,4,5,6,7,8,9,10);
1075 endchar;
1076
1077 % \end{macrocode}
1078 % \end{macro}
1079 %
1080 % \begin{macro}{T}
1081 % The \thisfont{} letter T sub d.
1082 % \begin{macrocode}
1083
1084 cmchar "Ugarite letter T sub d (T)";
1085 beginglyph("T", (3tb));
1086 numeric n[];
1087 z1trc=(leftloc,1/2h); % left head
1088 trir(1, trht, trbs); fill pth1;
1089 z2trc=(midloc,h); % top middle head
1090 trid(2, trht, trbs); fill pth2;
1091 n1 := 2trbs; % base of small wing
1092 n2 := 1/2n1; % height of small wing
1093 z3 = (rightloc-n2,y1);
1094 wingl(3, n2, n1); fill pth3;
1095 z4 = (x2,y1);
1096 draw z1tic--z3;
1097 draw z2tic--z4;
1098 labels(1,2,3,4,5,6,7,8,9,10);
1099 endchar;
1100
1101 % \end{macrocode}
1102 % \end{macro}
1103 %
1104 % \begin{macro}{y}
1105 % The \thisfont{} letter Y.
1106 % \begin{macrocode}
1107
1108 cmchar "Ugarite letter y";
1109 beginglyph("y", (2tb));
1110 %% left pin
1111 z1trr=(leftloc,h);
1112 trid(1, trht, trbs); fill pth1; % top head
1113 z2trc=(x1trc,y1);
1114 trid(2, trht, trbs); fill pth2; % middle head
1115 z3trc=(x1trc,y2);
1116 trid(3, trht, trbs); fill pth3; % bottom head
1117 z1''=(x1,0); draw z1tic--z1'';
1118 %% right pin
1119 z11trr=z1trl;
1120 trid(11, trht, trbs); fill pth11; % top head
1121 z12trc=(x11trc,y11);
1122 trid(12, trht, trbs); fill pth12; % middle head
1123 z13trc=(x11trc,y12);
1124 trid(13, trht, trbs); fill pth13; % bottom head
1125 z11''=(x11,0); draw z11tic--z11'';
1126 labels(1,2,3,4,5,6,11,12,13);
1127 endchar;
1128
1129 % \end{macrocode}
1130 % \end{macro}
1131 %
1132 %
1133 %
1134 % \begin{macro}{k}
1135 % The \thisfont{} letter K.
1136 % \begin{macrocode}
1137
1138 cmchar "Ugarite letter k";
1139 beginglyph("k", (5th));
1140 z1trr=(leftloc,1/2h); % top head
1141 trir(1, trht, trbs); fill pth1;
1142 z2trl=z1trr; % bottom head
1143 trir(2, trht, trbs); fill pth2;
1144 z3trc=(3/6aw, 1/2h); % center left head
1145 trir(3, trht, trbs); fill pth3;
1146 x1''=x3trc; y1'' = y1; % left bodies
1147 x2''=x3trc; y2'' = y2;
1148 x3''=rightloc; y3'' = y3;
1149 draw z1tic--z1'';
1150 draw z2tic--z2'';
1151 draw z3tic--z3'';
1152 labels(1,2,3,4,5,6,7,8,9,10);
1153 endchar;
1154
1155 % \end{macrocode}
1156 % \end{macro}
1157 %
1158 %
1159 % \begin{macro}{V}
1160 % The \thisfont{} letter S with an acute accent.
1161 % \begin{macrocode}
1162
1163 cmchar "Ugarite letter s acute (X)";
1164 beginglyph("X", (2wh+tb));
1165 z1trc=(midloc,h); % top head
1166 trid(1, trht, trbs); fill pth1;
1167 z1''=(x1,0);
1168 draw z1tic--z1'';
1169 z2=(leftloc, 1/2h); % left wing
1170 wingl(2, wiht, wibs); fill pth2;
1171 z3=(rightloc, y2) ; % right wing
1172 wingr(3, wiht, wibs); fill pth3;
1173 labels(1,2,2wil,2wic,2wir,3,4,5,6,7,8,9,10);
1174 endchar;
1175
1176 % \end{macrocode}
1177 % \end{macro}
1178 %
1179 % \begin{macro}{l}
1180 % The \thisfont{} letter L.
1181 % \begin{macrocode}
1182
1183 cmchar "Ugarite letter l";
1184 beginglyph("l", (3tb));
1185 %% left pin
1186 z1trr=(leftloc,h);
1187 trid(1, trht, trbs); fill pth1; % top head
1188 z1''=(x1,0); draw z1tic--z1'';
1189 %% center pin
1190 z11trr=z1trl;
1191 trid(11, trht, trbs); fill pth11; % top head
1192 z11''=(x11,0); draw z11tic--z11'';
1193 %% right pin
1194 z21trr=z11trl;
1195 trid(21, trht, trbs); fill pth21; % top head
1196 z21''=(x21,0); draw z21tic--z21'';
1197 labels(1,2,3,4,5,6,11,12,13,21,22,23);
1198 endchar;
1199
1200 % \end{macrocode}
1201 % \end{macro}
1202 %
1203 % \begin{macro}{m}
1204 % The \thisfont{} letter M.
1205 % \begin{macrocode}
1206
1207 cmchar "Ugarite letter m";
1208 beginglyph("m", (3tb));
1209 z1trl=(rightloc,h); % right head
1210 trid(1, trht, trbs); fill pth1;
1211 z1''=(x1,0); draw z1tic--z1'';
1212 z2trc=(leftloc, 1/2[y1tic,y1'']); % left head
1213 trir(2, trht, trbs); fill pth2;
1214 z2''=(x1,y2); draw z2tic--z2'';
1215 labels(1,2,3,4,5,6);
1216 endchar;
1217
1218 % \end{macrocode}
1219 % \end{macro}
1220 %
1221 %
1222 % \begin{macro}{D}
1223 % The \thisfont{} letter D with an underbar.
1224 % \begin{macrocode}
1225
1226 cmchar "Ugarite letter d sub bar (D)";
1227 beginglyph("D", (wh+tb));
1228 z1trl=(rightloc,h); % top head
1229 trid(1, trht, trbs); fill pth1;
1230 z1''=(x1,0); draw z1tic--z1'';
1231 z2=(leftloc, 1/2h); % left wing
1232 wingl(2, wiht, wibs); fill pth2;
1233 labels(1,2,3,4,5,6,7,8,9,10);
1234 endchar;
1235
1236 % \end{macrocode}
1237 % \end{macro}
1238 %
1239 % \begin{macro}{n}
1240 % The \thisfont{} letter N.
1241 % \begin{macrocode}
1242
1243 cmchar "Ugarite letter n";
1244 beginglyph("n", (5th));
1245 z1trc=(leftloc, 1/2h); % left head
1246 trir(1, trht, trbs); fill pth1;
1247 z2trc=z1; % center head
1248 trir(2, trht, trbs); fill pth2;
1249 z3trc=z2; % right head
1250 trir(3, trht, trbs); fill pth3;
1251 z1''=(rightloc,y1); draw z1tic--z1'';
1252 labels(1,2,3,4,5);
1253 endchar;
1254
1255 % \end{macrocode}
1256 % \end{macro}
1257 %
1258 %
1259 %
1260 % \begin{macro}{Z}
1261 % The \thisfont{} letter Z with an underdot.
1262 % \begin{macrocode}
1263
1264 cmchar "Ugarite letter z sub dot (Z)";
1265 beginglyph("Z", (3th+wh));
1266 z1trr=(leftloc,1/2h); % top head
1267 trir(1, trht, trbs); fill pth1;
1268 z1''=(leftloc+3trht, y1); draw z1tic--z1'';
1269 z2trl=z1trr; % bottom head
1270 trir(2, trht, trbs); fill pth2;
1271 z2''=(x1'',y2); draw z2tic--z2'';
1272 z3=(x1'',1/2h); % wing
1273 wingl(3, wiht, wibs); fill pth3;
1274 labels(1,2,3,4,5,6,7);
1275 endchar;
1276
1277 % \end{macrocode}
1278 % \end{macro}
1279 %
1280 % \begin{macro}{s}
1281 % The \thisfont{} letter S.
1282 % \begin{macrocode}
1283
1284 cmchar "Ugarite letter s";
1285 beginglyph("s", (2tb));
1286 z1trr=(leftloc,h); % left head
1287 trid(1, trht, trbs); fill pth1;
1288 z1''=(x1,1/2h); draw z1tic--z1'';
1289 z2trr=z1trl; % right head
1290 trid(2, trht, trbs); fill pth2;
1291 z2''=(x2,y1''); draw z2tic--z2'';
1292 z3trc=(1/2[x1,x2], y1''); % bottom head
1293 trid(3, trht, trbs); fill pth3;
1294 z3''=(x3,0); draw z3tic--z3'';
1295 labels(1,2,3,4,5,6,7);
1296 endchar;
1297
1298 % \end{macrocode}
1299 % \end{macro}
1300 %
1301 % \begin{macro}{`}
1302 % The \thisfont{} letter single left quote.
1303 % \begin{macrocode}
1304
1305 cmchar "Ugarite letter `";
1306 beginglyph("`", (wh));
1307 z1=(leftloc,1/2h);
1308 wingl(1, wiht, wibs); fill pth1;
1309 labels(1,2,3,4,5,6,7);
1310 endchar;
1311
1312 % \end{macrocode}
1313 % \end{macro}
1314 %
1315 % \begin{macro}{o}
1316 % The \thisfont{} letter single left quote.
1317 % \begin{macrocode}
1318
1319 cmchar "Ugarite letter ` (coded as o)";
1320 beginglyph("o", (wh));
1321 z1=(leftloc,1/2h);
1322 wingl(1, wiht, wibs); fill pth1;
1323 labels(1,2,3,4,5,6,7);
1324 endchar;
1325
1326 % \end{macrocode}
1327 % \end{macro}
1328 %
1329 % \begin{macro}{p}
1330 % The \thisfont{} letter P.
1331 % \begin{macrocode}
1332
1333 cmchar "Ugarite letter p";
1334 beginglyph("p", (4th));
1335 z1trr=(leftloc,1/2h); % top head
1336 trir(1, trht, trbs); fill pth1;
1337 z1''=(rightloc,y1); draw z1tic--z1'';
1338 z2trl=z1trr; % bottom head
1339 trir(2, trht, trbs); fill pth2;
1340 z2''=(x1'',y2); draw z2tic--z2'';
1341 labels(1,2,3,4,5,6,7);
1342 endchar;
1343
1344 % \end{macrocode}
1345 % \end{macro}
1346 %
1347 % \begin{macro}{x}
1348 % The \thisfont{} letter S sub dot.
1349 % \begin{macrocode}
1350
1351 cmchar "Ugarite letter S sub dot (x)";
1352 beginglyph("x", (2tb));
1353 z1trr=(leftloc,h); % left head
1354 trid(1, trht, trbs); fill pth1;
1355 z1''=(x1,0); draw z1tic--z1'';
1356 z2trr=z1trl; % right head
1357 trid(2, trht, trbs); fill pth2;
1358 z2''=(x2,0); draw z2tic--z2'';
1359 labels(1,2,3,4,5,6,7);
1360 endchar;
1361
1362 % \end{macrocode}
1363 % \end{macro}
1364 %
1365 % \begin{macro}{q}
1366 % The \thisfont{} letter Q.
1367 % \begin{macrocode}
1368
1369 cmchar "Ugarite letter q";
1370 beginglyph("q", (3tb));
1371 numeric n[];
1372 z1trc=(leftloc,1/2h); % left head
1373 trir(1, trht, trbs); fill pth1;
1374 n1 := 2trbs; % base of small wing
1375 n2 := 1/2n1; % height of small wing
1376 z3 = (rightloc-n2,y1);
1377 wingl(3, n2, n1); fill pth3;
1378 draw z1tic--z3;
1379 labels(1,2,3,4,5,6,7,8,9,10);
1380 endchar;
1381
1382 % \end{macrocode}
1383 % \end{macro}
1384 %
1385 % \begin{macro}{r}
1386 % The \thisfont{} letter R.
1387 % \begin{macrocode}
1388
1389 cmchar "Ugarite letter r";
1390 beginglyph("r", (5th)); % 6th too much
1391 %% bottom
1392 z1trl=(leftloc,1/2h); % left head
1393 trir(1, trht, trbs); fill pth1;
1394 z2trc=z1; % center head
1395 trir(2, trht, trbs); fill pth2;
1396 %% top
1397 z11trr=z1trl; % left head
1398 trir(11, trht, trbs); fill pth11;
1399 z12trc=z11; % center head
1400 trir(12, trht, trbs); fill pth12;
1401 %% right
1402 z21trc=(x2+trht, 1/2[y1,y11]);
1403 trir(21, trht, trbs); fill pth21;
1404 z1''=(x21trc,y1); draw z1tic--z1'';
1405 z11''=(x21trl,y11); draw z11tic--z11'';
1406 z21''=(rightloc,y21); draw z21tic--z21'';
1407 labels(1,2,3,4,5,6,7,11,12,21);
1408 endchar;
1409
1410 % \end{macrocode}
1411 % \end{macro}
1412 %
1413 % \begin{macro}{J}
1414 % The \thisfont{} T sub bar.
1415 % \begin{macrocode}
1416
1417 cmchar "Ugarite letter T sub bar (J)";
1418 beginglyph("J", (2tb));
1419 z1trl=(rightloc,h); % vertical pin
1420 trid(1, trht, trbs); fill pth1;
1421 z1''=(x1,0); draw z1tic--z1'';
1422 z2=(x1trr,1/3h); % angled pin
1423 z2''=(rightloc,0);
1424 triangle(2, trht, trbs, angle((z2''-z2))); fill pth2;
1425 draw z2tic--z2'';
1426 labels(1,1'',2,2'');
1427 endchar;
1428
1429 % \end{macrocode}
1430 % \end{macro}
1431 %
1432 % \begin{macro}{G}
1433 % The \thisfont{} G with a dot accent.
1434 % \begin{macrocode}
1435
1436 cmchar "Ugarite letter G sup dot (G)";
1437 beginglyph("G", 24/24);
1438 z1trc=(leftloc,1/2h); % horizontal pin
1439 trir(1, trht, trbs); fill pth1;
1440 z1''=(rightloc,y1); draw z1tic--z1'';
1441 z2=(1/2[x1,x1''], y1trr); % angled pin
1442 triangle(2, trht, trbs, 45); fill pth2;
1443 z2''=whatever[z2trc,z2]; y2''=(y1+(y1-y2));
1444 draw z2tic--z2'';
1445 labels(1,2,3,4);
1446 endchar;
1447
1448 % \end{macrocode}
1449 % \end{macro}
1450 %
1451 % \begin{macro}{t}
1452 % The \thisfont{} T.
1453 % \begin{macrocode}
1454
1455 cmchar "Ugarite letter t";
1456 beginglyph("t", 24/24);
1457 z1trc=(leftloc,1/2h);
1458 trir(1, trht, trbs); fill pth1;
1459 z1''=(rightloc,y1); draw z1tic--z1'';
1460 labels(1,2,3,4);
1461 endchar;
1462
1463 % \end{macrocode}
1464 % \end{macro}
1465 %
1466 % \begin{macro}{i}
1467 % The \thisfont{} I.
1468 % \begin{macrocode}
1469
1470 cmchar "Ugarite letter i";
1471 beginglyph("i", 24/24);
1472 z1trc=(leftloc,h); % top
1473 trir(1, trht, trbs); fill pth1;
1474 z1''=(rightloc,y1); draw z1tic--z1'';
1475 z2trl=z1trr; % center
1476 trir(2, trht, trbs); fill pth2;
1477 z2''=(rightloc,y2); draw z2tic--z2'';
1478 z3trl=z2trr; % bottom
1479 trir(3, trht, trbs); fill pth3;
1480 z3''=(rightloc,y3); draw z3tic--z3'';
1481
1482 z4trc=(midloc,y3); % small vertical pin
1483 trid(4, trht, trbs); fill pth4;
1484 z4''=(x4,0); draw z4tic--z4'';
1485 labels(1,2,3,4);
1486 endchar;
1487
1488 % \end{macrocode}
1489 % \end{macro}
1490 %
1491 %
1492 % \begin{macro}{u}
1493 % The \thisfont{} letter U.
1494 % \begin{macrocode}
1495
1496 cmchar "Ugarite letter u";
1497 beginglyph("u", (4tb)); % 5tb too big
1498 z2trc=(midloc,h); % center pin
1499 trid(2, trht, trbs); fill pth2;
1500 z1trl=z2trr; % left pin
1501 trid(1, trht, trbs); fill pth1;
1502 z3trr=z2trl; % right pin
1503 trid(3, trht, trbs); fill pth3;
1504 z4trr=(leftloc,0); % bottom pin
1505 trir(4, trht, trbs); fill pth4;
1506 z1''=(x1,y4); draw z1tic--z1'';
1507 z2''=(x2,y4); draw z2tic--z2'';
1508 z3''=(x3,y4); draw z3tic--z3'';
1509 z4''=(rightloc,y4); draw z4tic--z4'';
1510 labels(1,2,3,4);
1511 endchar;
1512
1513 % \end{macrocode}
1514 % \end{macro}
1515 %
1516 %
1517 % \begin{macro}{V}
1518 % The \thisfont{} letter S with grave accent.
1519 % \begin{macrocode}
1520
1521 cmchar "Ugarite letter S with grave accent (V)";
1522 beginglyph("V", (4tb));
1523 numeric n[];
1524 n1 := 3/2trbs; % base of wing % 2trbs too large
1525 n2 := 1/2n1; % height of wing
1526 z11trc=(midloc,h); % pin
1527 trid(11, trht, trbs); fill pth11;
1528 z11''=(x11,0); draw z11tic--z11'';
1529 %% left wings
1530 z3wir=(x11trr,0); % bottom
1531 wingu(3, n2, n1); fill pth3;
1532 z1=(x3,y11); % top
1533 wingu(1, n2, n1); fill pth1;
1534 z2=1/2[z1,z3]; % middle
1535 wingu(2, n2, n1); fill pth2;
1536 %% right wings
1537 z23wil=(x11trl,0); % bottom
1538 wingu(23, n2, n1); fill pth23;
1539 z21=(x23,y11); % top
1540 wingu(21, n2, n1); fill pth21;
1541 z22=1/2[z21,z23]; % middle
1542 wingu(22, n2, n1); fill pth22;
1543 labels(1,2,3,11,21,22,23);
1544 endchar;
1545
1546 % \end{macrocode}
1547 % \end{macro}
1548 %
1549 %
1550 % \begin{macro}{:}
1551 % The \thisfont{} word divider.
1552 % \begin{macrocode}
1553
1554 cmchar "Ugarite word divider (:)";
1555 beginglyph(":", (tb));
1556 z1trc=(midloc, 3/4h);
1557 trid(1, trht, trbs); fill pth1;
1558 z2=(midloc, 1/4h); draw z1tic--z2;
1559 labels(1,1',1'',2,2',2trl,2trc,2trr,3,4);
1560 endchar;
1561
1562 % \end{macrocode}
1563 % \end{macro}
1564 %
1565 %
1566 %
1567 %
1568 % The end of the glyphs and file
1569 %
1570 % \begin{macrocode}
1571
1572 end
1573
1574 %</up>
1575 % \end{macrocode}
1576 %
1577 %
1578 %
1579 % \section{The font definition files} \label{sec:fd}
1580 %
1581 % \begin{macrocode}
1582 %<*fdot1>
1583 \DeclareFontFamily{OT1}{cugar}{}
1584 \DeclareFontShape{OT1}{cugar}{m}{n}{ <-> cugar10 }{}
1585 \DeclareFontShape{OT1}{cugar}{bx}{n}{ <-> sub cugar/m/n }{}
1586 \DeclareFontShape{OT1}{cugar}{b}{n}{ <-> sub cugar/m/n }{}
1587 \DeclareFontShape{OT1}{cugar}{m}{sl}{ <-> sub cugar/m/n }{}
1588 \DeclareFontShape{OT1}{cugar}{m}{it}{ <-> sub cugar/m/n }{}
1589 %</fdot1>
1590 % \end{macrocode}
1591 %
1592 %
1593 % \begin{macrocode}
1594 %<*fdt1>
1595 \DeclareFontFamily{T1}{cugar}{}
1596 \DeclareFontShape{T1}{cugar}{m}{n}{ <-> cugar10 }{}
1597 \DeclareFontShape{T1}{cugar}{bx}{n}{ <-> sub cugar/m/n }{}
1598 \DeclareFontShape{T1}{cugar}{b}{n}{ <-> sub cugar/m/n }{}
1599 \DeclareFontShape{T1}{cugar}{m}{sl}{ <-> sub cugar/m/n }{}
1600 \DeclareFontShape{T1}{cugar}{m}{it}{ <-> sub cugar/m/n }{}
1601 %</fdt1>
1602 % \end{macrocode}
1603 %
1604 % \section{The \Lpack{uguarite} package code} \label{sec:code}
1605 %
1606 % Announce the name and version of the package, which requires
1607 % \LaTeXe{}.
1608 % \begin{macrocode}
1609 %<*usc>
1610 \NeedsTeXFormat{LaTeX2e}
1611 \ProvidesPackage{ugarite}[2000/09/30 v1.1 package for Ugaritic fonts]
1612 % \end{macrocode}
1613 %
1614 %
1615 % \begin{macro}{\cugarfamily}
1616 % Selects the font family in the OT1 encoding.
1617 % \begin{macrocode}
1618 \newcommand{\cugarfamily}{\usefont{OT1}{cugar}{m}{n}}
1619 % \end{macrocode}
1620 % \end{macro}
1621 %
1622 % \begin{macro}{\textcugar}
1623 % Text command for the font family.
1624 % \begin{macrocode}
1625 \DeclareTextFontCommand{\textcugar}{\cugarfamily}
1626
1627 % \end{macrocode}
1628 % \end{macro}
1629 %
1630 % The commands for the signs.
1631 % \begin{macrocode}
1632 \chardef\Arq=`' \chardef\Aa=`a \chardef\Aaleph=`'
1633 \chardef\Ab=`b \chardef\Abeth=`b
1634 \chardef\Ag=`g \chardef\Agimel=`g
1635 \chardef\Ahu=`I % \chardef\A=`
1636 \chardef\Ad=`d \chardef\Adaleth=`d
1637 \chardef\Ah=`h \chardef\Ahe=`h
1638 \chardef\Aw=`w \chardef\Avav=`w
1639 \chardef\Az=`z \chardef\Azayin=`z
1640 \chardef\Ahd=`H \chardef\Aheth=`H
1641 \chardef\Atd=`T \chardef\Ateth=`T
1642 \chardef\Ay=`y \chardef\Ayod=`y
1643 \chardef\Ak=`k \chardef\Akaph=`k
1644 \chardef\Asa=`X % \chardef\A=`
1645 \chardef\Al=`l \chardef\Alamed=`l
1646 \chardef\Am=`m \chardef\Amem=`m
1647 \chardef\Adb=`D % \chardef\A=`
1648 \chardef\An=`n \chardef\Anun=`n
1649 \chardef\Azd=`Z % \chardef\A=`
1650 \chardef\As=`s \chardef\Asamekh=`s
1651 \chardef\Alq=`` \chardef\Ao=`o \chardef\Aayin=``
1652 \chardef\Ap=`p \chardef\Ape=`p
1653 \chardef\Asd=`x \chardef\Asade=`x
1654 \chardef\Aq=`q \chardef\Aqoph=`q
1655 \chardef\Ar=`r \chardef\Aresh=`r
1656 \chardef\Atb=`J % \chardef\A=`
1657 \chardef\Agd=`G % \chardef\A=`
1658 \chardef\At=`t \chardef\Atav=`t
1659 \chardef\Ai=`i % \chardef\A=`
1660 \chardef\Au=`u % \chardef\A=`
1661 \chardef\Asg=`V % \chardef\A=`
1662 \chardef\Awd=`: % \chardef\A=`
1663
1664 % \end{macrocode}
1665 %
1666 % \begin{macro}{\translitcugar}
1667 % \begin{macro}{\translitcugarfont}
1668 % |\translitcugar{|\meta{char-commands}|}| typesets a transliteration of
1669 % the \thisfont{} character commands. These are typeset with the
1670 % |\translitcugarfont|.
1671 % \begin{macrocode}
1672 \newcommand{\translitcugar}[1]{{%
1673 \@translitU\translitcugarfont #1}}
1674 \newcommand{\translitcugarfont}{\itshape}
1675
1676 % \end{macrocode}
1677 % \end{macro}
1678 % \end{macro}
1679 %
1680 % \begin{macro}{\Uunder}
1681 % We need a command to put a small U shaped cup under a letter.
1682 % \begin{macrocode}
1683 \DeclareTextCommand{\Uunder}{OT1}[1]%
1684 {{\o@lign{\relax#1\crcr\hidewidth\sh@ft{29}%
1685 \vbox to.2ex{\hbox{\char21}\vss}\hidewidth}}}
1686
1687 % \end{macrocode}
1688 % \end{macro}
1689 %
1690 % \begin{macro}{\@translitU}
1691 % This macro redefines all the character producing commands for use within
1692 % |\translitcugar|. It is important not to have any spaces in the definition.
1693 % \begin{macrocode}
1694 \newcommand{\@translitU}{%
1695 \def\Arq{'}\def\Aa{\Arq}\def\Aaleph{\Arq}%
1696 \def\Ab{b}\def\Abeth{\Ab}%
1697 \def\Ag{g}\def\Agimel{\Ag}%
1698 \def\Ahu{\Uunder{h}}%
1699 \def\Ad{d}%
1700 \def\Ah{h}\def\Ahe{\Ah}%
1701 \def\Aw{w}\def\Avav{\Aw}%
1702 \def\Az{z}\def\Azayin{\Az}%
1703 \def\Ahd{\d{h}}\def\Aheth{\Ahd}%
1704 \def\Atd{\d{t}}\def\Ateth{\Atd}%
1705 \def\Ay{y}\def\Ayod{\Ay}%
1706 \def\Ak{k}\def\Akaph{\Ak}%
1707 \def\Asa{\'{s}}%
1708 \def\Al{l}\def\Alamed{\Al}%
1709 \def\Am{m}\def\Amem{\Am}%
1710 \def\Adb{\b{d}}%
1711 \def\An{n}\def\Anun{\An}%
1712 \def\Azd{\d{z}}%
1713 \def\As{s}\def\Asamekh{\As}%
1714 \def\Alq{`}\def\Ao{\Alq}\def\Aayin{\Alq}%
1715 \def\Ap{p}\def\Ape{\Ap}%
1716 \def\Asd{\d{s}}\def\Asade{\Asd}%
1717 \def\Aq{q}\def\Aqoph{\Aq}%
1718 \def\Ar{r}\def\Aresh{\Ar}%
1719 \def\Atb{\b{t}}%
1720 \def\Agd{\.{g}}%
1721 \def\At{t}\def\Atav{\At}%
1722 \def\Ai{i}%
1723 \def\Au{u}%
1724 \def\Asg{\`{s}}%
1725 \def\Awd{:\space}%
1726 }
1727
1728 % \end{macrocode}
1729 % \end{macro}
1730 %
1731 % The end of this package.
1732 % \begin{macrocode}
1733 %</usc>
1734 % \end{macrocode}
1735 %
1736 % \section{Map file}
1737 % A short file.
1738 % \changes{v1.2}{2005/06/18}{Added map file}
1739 %
1740 % \begin{macrocode}
1741 %<*map>
1742 cugar10 Archaic-Ugaritic-Cuneiform <cugar10.pfb
1743 %</map>
1744 % \end{macrocode}
1745 %
1746 %
1747 % \Finale
1748 %
1749 \endinput
1750
1751 %% \CharacterTable
1752 %% {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
1753 %% 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
1754 %% Digits \0\1\2\3\4\5\6\7\8\9
1755 %% Exclamation \! Double quote \" Hash (number) \#
1756 %% Dollar \$ Percent \% Ampersand \&
1757 %% Acute accent \' Left paren \( Right paren \)
1758 %% Asterisk \* Plus \+ Comma \,
1759 %% Minus \- Point \. Solidus \/
1760 %% Colon \: Semicolon \; Less than \<
1761 %% Equals \= Greater than \> Question mark \?
1762 %% Commercial at \@ Left bracket \[ Backslash \\
1763 %% Right bracket \] Circumflex \^ Underscore \_
1764 %% Grave accent \` Left brace \{ Vertical bar \|
1765 %% Right brace \} Tilde \~}
1766
1767