[comp.text] Metafont Source: Tolkien's Tengwar

urban@spp2.UUCP (Mike Urban) (12/05/86)

This shell archive contains METAFONT sources for a digitized
version of the Tengwar (Elvish script) created by J.R.R. Tolkien.
They have only been tested on a 300dpi laser printer.  No guarantee
of the quality of either the code or the output is offered.  I'm not
particularly satisfied with the quality of the code (my first non-trivial
attempt to use METAFONT), but the results look OK to me.

#!/bin/sh-----cut here-----cut here-----cut here-----cut here-----
#    This is a shell archive.
#    Run the following text with /bin/sh to extract.

mkdir tengwar
cd tengwar
cat - << \Funky!Stuff! > bars.mf
% Copyright 1986 Michael Urban
% Everyone is granted permission to copy, modify and redistribute
% this file, provided that a currently-dated copy of this
% copyright notice is included in the copy.
% License is granted to produce fonts based on the information
% in this file, provided that such fonts are redistributed
% without charge to any third party.

% SCCS ID @(#)bars.mf	1.1   10/1/86

def underbar=
begingroup;
	save x,y;
	z9 = barpoint;
	x10 = .5w; y10=0;
	x11= .8w; y11=0;
	x12=w; y12=1/80em;
	draw z9..z10{right}..z11{right}..z12;
	penlabels(5,6,7,8,9,10,11,12);
endgroup;
enddef;

def overbar=
begingroup;
	save x,y;
	z9 = barpoint;
	x10 = .7w; top y10=xht;
	x11= .2w; top y11=xht;
	x12=0;  top y12=xht-1/80em;
	draw z9..z10{left}..z11{left}..z12;
endgroup;
enddef;

Funky!Stuff!
cat - << \Funky!Stuff! > Copyright
% Copyright 1986 Michael Urban
% Everyone is granted permission to copy, modify and redistribute
% these files, provided that a currently-dated copy of this
% copyright notice is included in any copy.

% License is granted to produce fonts based on the information
% in this file, provided that such fonts are redistributed
% without charge to any third party.

Funky!Stuff!
cat - << \Funky!Stuff! > quenya.tex
\font\elvish=tengwar  scaled \magstep 2
\elvish\baselineskip=18pt
\obeylines
\leftskip 1in plus 1fil
\rightskip 1in plus 1fil
\nopagenumbers
\def\rd{\char18}
\def\z{\char26}
\def\slowbar{\char8}
\def\llowbar{\char9}
\def\shighbar{\char10}
\def\lhighbar{\char11}
\line{\hfil}
\vfill
\^e l\^u\.r\'i \^l\^DR \^l{z\kern 1pt}\llap{\'{}} s\u\i\.r\'nn
\c O\llap{\H{}}\.n \u\i n\v\i\.t\'m \'w r\^\i\^mR \^i\^L\v rn!;
\c O\'\i\.n \'w \.l\'D \c O\llap{\u{}}\^LR \^iw\^\i\.n\'iR
m\.\i\ \v i\v r\^m\.\rd\ \.l\'\z-\.m\u rw\v\i\'r\^w
\^id\u\i\'n \'p\^l\llap{\slowbar} \^w\v\rd\ \'t\u l\llap{\slowbar}\^mR
\u n l\u e\.n \c O\llap{\^{}}z\kern 1pt\llap{\'{}}n \.t\.D\^lR \.i \'i\'l\.n
\v\i m\^\i\c r\llap{\v{}} \^e\'r-t\^\i\.r-l\.i\.r\'nn.
\smallskip
s\.\i\ \^mn \.i \c O\llap{\u{}}l\^m \.nn \'i\^G\u D\^w?.
\smallskip
\^in s\.\i\ \.t\^D\v l \^w\^\rd\ \v e\v i\v lz\llap{\'{}}
\'w \^f\c n\llap{\^{}}R m\^\i\c r\llap{\^{}}t \'i\'lD\^\i\.r \v iR\^t\'n,
\^iR \.i\c l\llap{\'{}}\ \.t\'iR \u i\u dl\^i\'w \v l\v b\'e;
\^iR \.{\char3}\^dn\v\i \.r\'i\v l \^Ce\^t \v mR\.n\'i
\.i \^fl\^m\.l\^nR \.i\'b \'mt,
\^iR h\.i\.{\char3}\'i \u iD\u\i \^p \^C\^l\.C\c r\llap{\v{}} m\.i\.r \v e\^i\'l.
s\.\i\ \^wn\^A n\^\i\ r\v\i\'m\v l \^wn\^A \^w\.l\^mR!
nm\^\i \.r\'i! n\^e \.h\u r\^w\c l\llap{\'{}} w\.l\^mR;
n\^e \'i\c l\llap{\'{}} \.h\u r\^w! \^nm\^\i \.r\'i-
\vfill\eject\end
Funky!Stuff!
cat - << \Funky!Stuff! > sindarin.tex
\font\elvish=tengwar scaled \magstep 2
\elvish\baselineskip=18pt
\obeylines
\leftskip 1in plus 1fil
\rightskip 1in plus 1fil
\nopagenumbers
\line{\hfil}
\vfill
a elbereth jilthoRiel,
silivreR pena w\'iriel
o weRel \.ajlar eleRath;
R\.a shaered palaRd\'iriel
o jaladhremiR enorath,
faR\"ulos le linathoR
Rev aear s\'i Rev aearoR;-
\vfill\eject\end
Funky!Stuff!
cat - << \Funky!Stuff! > READ-ME
This directory contains the following files:

Metafont files for the Tengwar font.   The normal design size is
of course 10 points, although for ornamental purposes the
best size seems to be about 14 points.  Thus,

	\mode:=localmode; mag:=magstep2; input tengwar

is the best command line to use.

	tengwar.mf	The main file.
	tiw.mf		"input" file to include all the other pieces.

	telcor.mf	Stem definitions for the table letters.
	luvar.mf	Bow definitions for the table letters.
	bars.mf		Horizontal bars that are part of table letters.

	tincotema.mf	These four files are the four columns of the
	parmatema.mf	  regular table letters (1--24).
	calmatema.mf
	quessetema.mf

	additionals.mf	Characters 25--36 from the bottom of the table.
	fullvowels.mf   The unique vowel characters from the Mode
			of Beleriand.

	accents.mf	Diacritical vowels, dots below, bars, etc.
	carriers.mf	Things to put accents on.

	punctuation.mf	Punctuation marks.
	numerals.mf	JRRT's numerals as reported by Christopher
			Tolkien (British Tolkien Society 1981).

	ligtable.mf	Some convenient ligatures.

Two samples using plain TeX accenting macros to generate pretty stuff:

	quenya.tex	Namarie
	sindarin.tex	A Elbereth Gilthoniel

Miscellaneous other stuff:

	READ-ME		This file.
	Copyright	My legal mark, in the spirit of TeX and GNU. Note
			that this font is *not* public domain; I retain the
			copyright.  However, distribution is free as long
			as you keep it free.

----------------------------------------------------------------

The letter values are, necessarily, somewhat idiosyncratic.  By and large,
they are optimized for an English (Westron) mode using the "full" vowels
from the Mode of Beleriand.  Obviously, using diacritical vowels will
require an input file that looks like line noise (see quenya.tex), or
will require sufficiently ingenious TeX macros and "active" characters
to perform the accenting where needed.  This is left as an exercise
for the reader.   In any case, it is recommended that you print a table
out using "testfont.tex" so you can see what's where.

The punctuation marks are based on those found in "Namarie".  I'm not 
thrilled over the look of the question mark, but did not have an
assortment of examples for this character as I did for the others.

The numerals purport to be genuine creations of J.R.R. Tolkien,
unearthed by Christopher Tolkien in 1981.  I worked from a photocopy
of an article attributed to the British Tolkien Society and copyright
by Christopher Tolkien (which copyright appears to have been
violated by whoever made the photocopy).  I presume that duplicating
these numerals in digital form is governed by the same laws as duplicating
the other letters from Lord of the Rings (which is also copyright).
I hope this is all legal.  To the best of my knowledge, this is the
first digitized Tengwar font that incorporates these numerals.  I  don't
especially care for the look of these numerals, but once again, there
was only the single page of specimens to work with, and this page
did not show numerals mixed with letters in the same calligraphic style.
If the numerals do not look sufficiently different from letters, the
practice of the Eldar was to accent each numeral with a dot above; for
a long string of numerals, a continuous bar above the string could be
used (experiment with \vrule or \hrule for this).  Finally, numerals
were written in a decimal base, but with the low-order digits FIRST.
So the speed of light would be ``000681'' miles/second, if the Eldar had
reckoned in miles.

I have not experimented with the "meta" possibilities for this font,
although I have made something of an attempt to parametrize
most of the glyphs.  You are encouraged to experiment with
the parameter settings and are *DEFINITELY* encouraged to
send me any interesting settings (and changes that might be
required to accomodate those settings).

	Mike Urban
	...!trwrb!trwspp!spp2!urban
	...!vortex!trwspp!spp2!urban
Funky!Stuff!
cat - << \Funky!Stuff! > tiw.mf
% Copyright 1986 Michael Urban
% Everyone is granted permission to copy, modify and redistribute
% this file, provided that a currently-dated copy of this
% copyright notice is included in the copy.
% License is granted to produce fonts based on the information
% in this file, provided that such fonts are redistributed
% without charge to any third party.

% SCCS ID @(#)tiw.mf	1.1   10/1/86

pair bowpoint, barpoint, hookpoint;

input telcor;
input luvar;

input bars;

input tincotema; input parmatema; 
input calmatema;
input quessetema;

input additionals;
input fullvowels;
input carriers;
input accents;

input punctuation;
input numerals;
Funky!Stuff!
cat - << \Funky!Stuff! > accents.mf
% Copyright 1986 Michael Urban
% Everyone is granted permission to copy, modify and redistribute
% this file, provided that a currently-dated copy of this
% copyright notice is included in the copy.
% License is granted to produce fonts based on the information
% in this file, provided that such fonts are redistributed
% without charge to any third party.

% SCCS ID @(#)accents.mf	1.1   10/1/86

def centerpt=
	(w-((w-leadgap)/2), xht+3.2thin)
enddef;
	
beginchar (19, shortwidth, cap#, 0); "The acute accent (e)";
	begingroup;
	save x,y;
	pickup elvishpen;
	z0 = centerpt;
	top y1=h; %z1-z0=whatever*(dir tilt);
	rt x1 = w;
	draw z0--z1;
	endgroup;
endchar;

beginchar ("}", shortwidth, cap#, 0); "The double acute accent (e')";
	begingroup;
	save x,y;
	pickup elvishpen;
	z0 = centerpt;
	top y1=h; %z1-z0=whatever*(dir tilt);
	rt x1 = w;
	draw z0--z1;
	draw ((z0--z1) shifted (2.5*thin*right));
	endgroup;
endchar;


beginchar ("_", shortwidth, cap#, 0); "The dot-above accent (i)";
	begingroup;
	save x,y;
	pickup pensquare scaled thick rotated 45;
	z0 = centerpt;
	drawdot z0;
	endgroup;
endchar;

beginchar (127, shortwidth, cap#, 0); "The umlaut accent (double i)";
	begingroup;
	save x, y;
	pickup pensquare scaled thick rotated 45;
	z0 = centerpt;
	z1 = z0 + thick*left;
	z2 = z0 + thick*right;
	drawdot z1; drawdot z2;
	endgroup;
endchar;

beginchar (25, shortwidth, 0, -6thin#); "The schwa accent (dot below)";
	begingroup;
	save x, y;
	pickup pensquare scaled thick rotated 45;
	z0 = centerpt;
	x1 = x0;
	y1 = -3thin;
	drawdot z1; 
	endgroup;
endchar;

beginchar (24, shortwidth, 0, -6thin#); "The 'y' accent (two dots below)";
	begingroup;
	save x, y;
	pickup pensquare scaled thick rotated 45;
	z0 = centerpt;
	x1 = x0 - thick;
	x2 = x0 + thick;
	y1 = y2 = -3thin;
	drawdot z1; drawdot z2;
	endgroup;
endchar;

beginchar ("^", shortwidth, cap#, 0); "The circumflex (3-dot 'a')";
	begingroup;
	save x,y;
	pickup elvishpen;

	agap := w/6;
	alength := 1.5*thick;

	z0 = centerpt;

	z1 = z0 + agap*left;
	z2=z1+alength*(dir (tilt+90));

	z3 = z0 + agap*up;
	z4 = z3 + alength*up;

	z5 = z0 + agap*right;
	z6 = z5 + alength*(dir tilt);

	draw z1--z2; draw z3--z4; draw z5--z6;
	endgroup;
endchar;

beginchar (20, shortwidth, cap#, 0); "The right-loop accent (o)";
	begingroup;
	save x,y, rightcurl;
	path rightcurl;
	pickup elvishpen;
	z0 = centerpt;
	top y1=h; x1 = .7[x0, w];
	rt x2=w; y2 = .7[y0, h];
	x3 = .8[x0,w]; y1-y2 = y2-y3;
	rightcurl = (z0..tension 2.0..z1{right}..z2..z3);
	draw rightcurl;
	endgroup;
endchar;

beginchar (22, shortwidth, cap#, 0); "The double right-loop accent (o')";
	begingroup;
	save x,y, rightcurl;
	path rightcurl;
	pickup elvishpen;
	z0 = centerpt;
	top y1=h; x1 = .7[x0, w];
	rt x2=w; y2 = .7[y0, h];
	x3 = .8[x0,w]; y1-y2 = y2-y3;
	rightcurl = (z0..tension 2.0..z1{right}..z2..z3);
	draw rightcurl;
	draw (rightcurl shifted (3*thin,0));
	endgroup;
endchar;

beginchar (21, shortwidth, cap#, 0); "The left-loop accent (u)";
	begingroup;
	save x,y;
	pickup elvishpen;
	z0 = centerpt;
	lft x1 = 1/3[leadgap, x0]; top y1 = 3/4[y0,h];
	top y2 = h; x2 = x0;
	y3 = y1; x3-x0 = x0-x1;
	draw z1..z2{right}..z0{down};
	endgroup;
endchar;
beginchar (23, shortwidth, cap#, 0); "The left-loop accent (u)";
	begingroup;
	save x,y, leftcurl;
	path leftcurl;
	pickup elvishpen;
	z0 = centerpt;
	lft x1 = 1/3[leadgap, x0]; top y1 = 3/4[y0,h];
	top y2 = h; x2 = x0;
	y3 = y1; x3-x0 = x0-x1;
	leftcurl =  (z1..z2{right}..z0{down});
	draw leftcurl;
	draw leftcurl shifted ((x1-x0)*right);
	endgroup;
endchar;

beginchar (8, shortwidth, 0, .4xht#); "Short bottom bar";
	begingroup;
	save x,y;
	pickup elvishpen;
	lft x0 = leadgap; rt x1 = w;
	y0=y1=-d;
	draw z0--z1;
	endgroup;
endchar;

beginchar (9, 1em#, 0, .4xht#); "Long bottom bar";
	begingroup;
	save x,y;
	pickup elvishpen;
	lft x0 = leadgap; rt x1 = w;
	y0=y1=-d;
	draw z0--z1;
	endgroup;
endchar;

beginchar (10, shortwidth, .5[xht#,cap#], 0); "Short top bar";
	begingroup;
	save x,y;
	pickup elvishpen;
	lft x0 = leadgap; rt x1 = w;
	y0=y1=h;
	draw z0--z1;
	endgroup;
endchar;
beginchar (11, 1em#, .5[xht#,cap#], 0); "Long top bar";
	begingroup;
	save x,y;
	pickup elvishpen;
	lft x0 = leadgap; rt x1 = w;
	y0=y1=h;
	draw z0--z1;
	endgroup;
endchar;
Funky!Stuff!
cat - << \Funky!Stuff! > additionals.mf
% Copyright 1986 Michael Urban
% Everyone is granted permission to copy, modify and redistribute
% this file, provided that a currently-dated copy of this
% copyright notice is included in the copy.
% License is granted to produce fonts based on the information
% in this file, provided that such fonts are redistributed
% without charge to any third party.

% SCCS ID @(#)additionals.mf	1.1   10/1/86

def commonr=
	pickup elvishpen;
	save x,y,sweep;
	path sweep;
	lft x0 = leadgap; top y0 = h;
	lft x1 = 0; z0-z1 = whatever*(dir tilt);
	x2 = .75w; top y2=h;
	rt x3 = w; y3 = .5h;
	lft x4 = leadgap; y4 = -.65d;
	x5 = .5w; y5 = -d;
	x6 = .85w; z6-z5 = whatever*(dir tilt);
	sweep = (z2..z3{down}..z4{down}..z5{right}..z6);
	z7 = sweep intersectionpoint 
		((-infinity,0)--(infinity,0));
	draw sweep;
	draw z1--z0..z7;
enddef;

beginchar("r", shortwidth, xht#, dep#); "The letter r (romen)";
	begingroup;
	commonr;
	endgroup;
endchar;
beginchar(18, shortwidth, xht#, dep#); "The ligature rh (arda)";
	begingroup;
	commonr;
	z8 = point .5 of (z0..z7);
	x9 = x1;
	z8-z9 = whatever*(dir tilt);
	x10 = x0; y10=y9;
	draw z8--z9..tension 3.0..z10{dir tilt};
	endgroup;
endchar;
	
def commonl=
	save x,y;
	pickup elvishpen;
	path tilde;

	lft x1=leadgap;top y1=h;
	rt x4 = w; y4=h;
	y2-y1 = y4-y3 = 3(y4-y1);
	z2-z1=z4-z3=whatever*(dir tilt);
	tilde = ( z1..controls z2 and z3..z4); % straight from Page 152 of MFbook
	z5 = point .6 of tilde;
	lft x6 = leadgap+1/20em; y6 = -.25d;
	x7 = .5[leadgap, w]; bot y7=-d;
	rt x8 = w-leadgap; y8 = 0;
	y9=.25h; z9-z8=whatever*(dir (tilt+90));
	draw tilde;
	z10 = point .6 of (z5..z6{down});
enddef;
beginchar("l", .8em#, xht#, dep#); "The letter l (lambe)";
	begingroup;
	commonl;
	draw z5..z6{down}..z7{right}..z8..z9;
	endgroup;
endchar;

beginchar("L", .8em#, xht#, dep#); "The ligature ld (alda)";
	begingroup;
	commonl;
	draw z5..tension 1.5..z10..z9..z8..z7..z6;
	endgroup;
endchar;

def commonsz=
	pickup elvishpen;
	save x,y,spath;
	path spath,zspath,zpath;
	x0 =.9w; top y0=height;
	x0-x1 = .08w; z0-z1=whatever*(dir(tilt-10));
	y3=xht/2; lft x3=leadgap;
	x4 = w/2+leadgap; bot y4=0;
	rt x5 = w; y5 = xht/2; %z5-z4 = whatever*(dir tilt);
	z6-z5=whatever*(dir (tilt+90)); 
	x6=x5-.3w;
	spath=(z0..z1..tension 2.2..z3{down}..z4{right}..z5{up}..z6{dir(tilt+90)});
	zspath=(z0..z1..tension 2.2..z3{down}..z4{right}..z5);
	x7=x3; y7= -.6d;
	x8=x4; bot y8=-d;
	x9=x5; y9= -.6d;
	z10-z9= z6-z5;
	zpath=(z4..tension 2.2..z7{down}..z8{right}..z9{up}..z10{dir(tilt+90)});
enddef;
beginchar("s", shortwidth, cap#, 0); "The letter s (silme)";
	begingroup;
	save height;
	height=h;
	commonsz;
	draw spath;
	endgroup;
endchar;
	
beginchar(3, shortwidth, xht#, dep#); "The letter s reversed (silme nuquerna)";
	begingroup;
	save height;
	height=cap;
	commonsz;
	draw (spath rotatedabout ( (.5[leadgap,w],xht/2), 180));
	endgroup;
endchar;

beginchar ("z", shortwidth, cap#, dep#); "The letter z (aze)";
	begingroup;
	save height; height=h;
	commonsz;
	draw zspath;
	draw zpath;
	endgroup;
endchar;

beginchar (26, shortwidth, cap#, dep#); "The letter z reversed (aze nuquerna)";

	begingroup;
	save height; height=cap;
	commonsz;
	draw (zspath rotatedabout ( (.5[leadgap,w],0), 180));
	draw (zpath rotatedabout ( (.5[leadgap,w],0), 180));
	endgroup;
endchar;

beginchar("e", shortwidth, xht#, 0); "The letter e (yanta)";
	begingroup;
	save x,y;
	pickup elvishpen;
	top y0 = h; x0=.5[0, w];
	lft x1 = 0; y1=0;
	y2=0; rt x2=w;
	y3=y0; x3=x0-.7thick;
	z4-z1 = whatever*(z0-z2);
	x1-x4=.2thin;
	z6-z2 = whatever*(z0-z1);
	x6=w;
	draw z3..z0--z2..z6;
	draw z4..z1--z0;
	endgroup;
endchar;
	
beginchar("h", shortwidth, cap#, 0); "The letter h (hyarmen)";
	begingroup;
	save x,y;
	pickup elvishpen;
	top y0 = h; x0=leadgap;
	lft x1 = leadgap+.3thick; y1=0;
	y2=0; rt x2=w;
	y3=y0; x3=x0-.7thick;
	z4-z1 = whatever*(z0-z2);
	x1-x4=.2thin;
	z5 =  point .5 of (z0--z2);
	z6-z2 = whatever*(z5-z1);
	x6=w;
	draw z3..z0--z2..z6;
	draw z4..z1--z5;
	endgroup;
%
% This character requires a bit more height than the others so that
% accents get raised enough.  
%
	charht := .3[xht#,cap#];
oldendchar;

beginchar ("u", shortwidth, xht#, 0); "The letter u (ure)";
	begingroup;
	save x,y;
	pickup elvishpen;
	lft x0 = leadgap;
	top y1 = h;
	rt x2 = w;
	bot y3 = 0;
	y0 = .65h; x1 = leadgap+.35w;
	y2 = .35h; x3 = leadgap+.65w;
	draw z0..z1..z2..z3..cycle;
	endgroup;
endchar;


beginchar (15, shortwidth+thick#, cap#,0); "The ligature hw (hwesta sindarinwa)";
	begingroup;
	save x,y;
	pickup elvishpen;
	nutelco(w-thick, longstem, stemdepth)
	z7=bowpoint;
	bot y8 = 0; x8=1/2[x7,leadgap];
	lft x9 = leadgap; y9=1/2xht;
	top y10 = xht; x10=x8;
	draw z7{down}..z8{left}..z9{up}..z10{right}..cycle;
	rt x11 = w-thick; y11 = 0;
	z12= (w, 0);
	draw z11--z12;
	endgroup;
endchar;

Funky!Stuff!
cat - << \Funky!Stuff! > calmatema.mf
% Copyright 1986 Michael Urban
% Everyone is granted permission to copy, modify and redistribute
% this file, provided that a currently-dated copy of this
% copyright notice is included in the copy.
% License is granted to produce fonts based on the information
% in this file, provided that such fonts are redistributed
% without charge to any third party.

% SCCS ID @(#)calmatema.mf	1.1   10/1/86


beginchar("C", shortwidth,xht#,dep#); "The ligature CH (calma)";
	pickup elvishpen;
	nutelco(w,shortstem, stemdepth);
	nuluva (bowpoint, 0, true);
endchar;

beginchar("j", 1em#,xht#,dep#); "The letter j (anga)";
	pickup elvishpen;
	nutelco(w,shortstem, stemdepth);
	nuluva (bowpoint,w-bowsize*em+leadgap, true);
	nuluva (bowpoint, leadgap, true);
endchar;

beginchar("S", shortwidth,cap#,0); "The ligature SH (harma)";
	pickup elvishpen;
	nutelco(w,longstem, stemdepth);
	nuluva (bowpoint, leadgap, true);
endchar;

beginchar("Z", 1em#,cap#,0); "The ligature ZH (anca)";
	pickup elvishpen;
	nutelco(w,longstem, stemdepth);
	nuluva (bowpoint,w-bowsize*em+leadgap, true);
	nuluva (bowpoint, leadgap, true);
endchar;

beginchar("O", shortwidth,xht#,0); "The letter o (anna)";
	pickup elvishpen;
	nutelco(w,shortstem, stemdepth);
	nuluva (bowpoint, leadgap, true);
endchar;

beginchar("Y", 1em#,xht#,0); "The ligature ny (ngoldo)";
	pickup elvishpen;
	nutelco(w,shortstem, stemdepth);
	nuluva (bowpoint,w-bowsize*em+leadgap, true);
	nuluva (bowpoint, leadgap, true);
endchar;
Funky!Stuff!
cat - << \Funky!Stuff! > carriers.mf
% Copyright 1986 Michael Urban
% Everyone is granted permission to copy, modify and redistribute
% this file, provided that a currently-dated copy of this
% copyright notice is included in the copy.
% License is granted to produce fonts based on the information
% in this file, provided that such fonts are redistributed
% without charge to any third party.

% SCCS ID @(#)carriers.mf	1.1   10/1/86

def commoncarrier=
	pickup elvishpen;
	x0=x1-thick; top y0=h;
	x1=1/2[leadgap,w]; y1=y0;
	x2=x1;  y2=-d/2;
	x3=x0; y3=-d;
	draw z0--z1{down}..z2{down}..z3;
enddef;

beginchar ("i",3*leadgap#,xht#,.2dep#);  "Short carrier";
	begingroup;
	save x,y;
	commoncarrier;
	endgroup;
endchar;

beginchar (16,3*leadgap#,xht#,dep#);  "Long carrier";
	begingroup;
	save x,y;
	commoncarrier;
	endgroup;
endchar;
Funky!Stuff!
cat - << \Funky!Stuff! > fullvowels.mf
% Copyright 1986 Michael Urban
% Everyone is granted permission to copy, modify and redistribute
% this file, provided that a currently-dated copy of this
% copyright notice is included in the copy.
% License is granted to produce fonts based on the information
% in this file, provided that such fonts are redistributed
% without charge to any third party.

% SCCS ID @(#)fullvowels.mf	1.1   10/1/86

beginchar ("a",shortwidth, xht#, 0); "The letter a (modus beleriandi)";
	begingroup;
	save x,y;
	pickup elvishpen;
	top y1= h; x1 = .75[leadgap, w];
	lft x2= leadgap; y2= .4h;
	bot y3= 0; x3=  .5[leadgap, w];
	y4= .2h; rt x4=w;
	draw z1..z2{down}..z3{right}..z4;
	endgroup;
endchar;

beginchar ("y", shortwidth, xht#, 1/2dep#); "The letter y (modus beleriandi)";
	begingroup;
	save x,y;
	pickup elvishpen;
	x1=leadgap; y1=.5h;
	x2 = 2/3[x1,w]; top y2=h;
	rt x3=w; y3=0;
	lft x4=leadgap; y4=-d;
	draw z1..z2{right}..z3..z4;
	endgroup;
endchar;


beginchar("o", shortwidth,xht#,0); "The letter o (anna ar taith)";
	pickup elvishpen;
	nutelco(w,shortstem, stemdepth);
	nuluva (bowpoint, leadgap, true);
	draw barpoint..barpoint+3thin*right;
endchar;

Funky!Stuff!
cat - << \Funky!Stuff! > ligtable.mf
% Copyright 1986 Michael Urban
% Everyone is granted permission to copy, modify and redistribute
% this file, provided that a currently-dated copy of this
% copyright notice is included in the copy.
% License is granted to produce fonts based on the information
% in this file, provided that such fonts are redistributed
% without charge to any third party.

% SCCS ID @(#)ligtable.mf	1.1   10/1/86

ligtable "t": "h" =: "T";
ligtable "d": "h" =: "D";
ligtable "c": "h" =: "C";
ligtable "s": "h" =: "S";
ligtable "n": "g" =: "N";
ligtable "h": "w" =: oct"027";

Funky!Stuff!
cat - << \Funky!Stuff! > luvar.mf
% Copyright 1986 Michael Urban
% Everyone is granted permission to copy, modify and redistribute
% this file, provided that a currently-dated copy of this
% copyright notice is included in the copy.
% License is granted to produce fonts based on the information
% in this file, provided that such fonts are redistributed
% without charge to any third party.

% SCCS ID @(#)luvar.mf	1.1   10/1/86

def luva(expr startpt, endx, looped) = 
begingroup;
	save x,y;
	z5 = startpt;
	top y6=xht; x6=.5[x5,endx];
	rt x7=endx; y7=.47xht;
    if looped :
	bot y8 =0; x8=1/4[x6,endx];
	y9 = .7thick; z9=whatever*(dir (tilt+90))+z8;
	draw z5..z6..z7{down}..z8{left}..z9;   % lu'va (bow)
    else:
	bot y8 =0; x8=.7[x6,endx];
	draw z5..z6..z7{down}..z8;%{dir (tilt+180)};
    fi;
	bowpoint:= z7;
	hookpoint := z8;
	penlabels(5,6,7,8,9);
endgroup;
enddef;

def nuluva(expr startpt, endx, looped) = 
begingroup;
	save x,y;
	z5 = startpt;
	bot y6=0; x6=.5[x5,endx];
	lft x7=endx; y7=.45xht;
    if looped :
	top y8 =xht; x8=1/4[x6,endx];
	y9 = xht-.7thick; z9=whatever*(dir (tilt-90))+z8;
	draw z5..z6..z7{up}..z8{right}..z9;   % lu'va (bow)
    else:
	top y8 =xht; x8=.7[x6,endx];
	draw z5..z6..z7{up}..z8;%{dir (tilt)};
    fi;
	bowpoint:= z7;
	hookpoint := z8;
	penlabels(5,6,7,8,9);
endgroup;
enddef;

Funky!Stuff!
cat - << \Funky!Stuff! > numerals.mf
% Copyright 1986 Michael Urban
% Everyone is granted permission to copy, modify and redistribute
% this file, provided that a currently-dated copy of this
% copyright notice is included in the copy.
% License is granted to produce fonts based on the information
% in this file, provided that such fonts are redistributed
% without charge to any third party.

% SCCS ID @(#)numerals.mf	1.1   10/1/86

def firstbow(expr start,finish,looped) =
	begingroup;
	save x,y,t;
	x0 = start; top y0=xht;
	x1 = x0; bot y1=0;
	x2=finish; bot y2=0;
	if looped:
		t=1.0;
	else:
		t=1.0;
	fi;
	draw z0{down}..z1..tension t..z2;
	bowpoint:=z1;
	penlabels (0,1,2);
	endgroup;
enddef;

def secondstem(expr start, finishpoint) =
	begingroup;
	save x,y, stem;
	path stem;
	z0=(start, h);
	z1 = z0 + serifthick*left;
	z2 = z0 + serifthick*right;
	z3= (start, 0);
	x4 = 1/2[x3, (xpart finishpoint)]; y4 = -d;
	draw z1--z0;%--z2;
	stem = ( z0..z3{down}..z4..tension 1.2..finishpoint);
	draw stem;
	top y5 = xht; 
	barpoint := stem intersectionpoint
		((-infinity,y5)--(infinity, y5));
	penlabels (0,1,2,3,4);
	
	endgroup;
enddef;


def thirdstem(expr start)=
	begingroup;
	save x,y,stem;
	path stem;
	z0=(start, h);
	z1 = z0 + serifthick*left;
	z2 = z0 + serifthick*right;
	z3= (start, 0);
	x4 = .5[0,start]; y4 = -d;
	x5=0; y5 = 1/2 (-d);
	draw z1--z0;%--z2;
	stem = ( z0..z3{down}..z4..z5);
	draw stem;
	bowpoint := stem intersectionpoint
		((-infinity,bowstart)--(infinity, bowstart));
	barpoint := stem intersectionpoint
		((-infinity,0)--(infinity, 0));
	penlabels (0,1,2,3,4,5);
	endgroup;
enddef;


beginchar ("0", shortwidth, xht#, 1/2dep#); "The numeral 0";
	begingroup;
	save x,y;
	pickup elvishpen;
	lft x1=leadgap; y1=.5h;
	x2 = 1/2[x1,w]; top y2=h;
	rt x3=w; y3=0;
	x4=leadgap; y4=-d;
	draw z1..z2{right}..z3{down}..z4;
	endgroup;
endchar;

beginchar ("1", shortwidth, xht#, 0); "The numeral 1";
	begingroup;
	save x, y;
	pickup elvishpen;

	firstbow(leadgap, w-thick, true);
	top y10=h;
	barpoint:=(w,y10);
	overbar;
	endgroup;
endchar;

beginchar ("2", .75em#, xht#, 0); "The numeral 2";
	begingroup;
	save x, y;
	pickup elvishpen;

	firstbow (1/2[leadgap,w], w-thick, true);
	firstbow (leadgap, xpart bowpoint, false);
	top y10=h;
	barpoint:=(w,y10);
	overbar;
	endgroup;
endchar;

beginchar ("3", 1em#, xht#, 0); "The numeral 3";
	begingroup;
	save x, y;
	pickup elvishpen;

	firstbow (2/3[leadgap,w], w-thick, true);
	firstbow (1/3[leadgap,w], xpart bowpoint, false);
	firstbow (leadgap, xpart bowpoint, false);
	top y10=h;
	barpoint:=(w,y10);
	overbar;
	endgroup;
endchar;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

beginchar ("4", shortwidth, 3/4[xht#,cap#], 3/4xht#); "The numeral 4";
	begingroup;
	save x, y;
	pickup elvishpen;

	rt x0 = w; y0 = -d/3;
	secondstem (leadgap, z0);
	endgroup;
endchar;

beginchar ("5", .75em#, 3/4[xht#, cap#], 3/4xht#); "The numeral 5";
	begingroup;
	save x, y;
	pickup elvishpen;

	firstbow (1/2[leadgap,w], w-thick, true);
	secondstem (leadgap, bowpoint);
	top y10=xht;
	draw barpoint--(w,y10);
	endgroup;
endchar;

beginchar ("6", 1em#, 3/4[xht#, cap#], 3/4xht#); "The numeral 6";
	begingroup;
	save x, y;
	pickup elvishpen;

	firstbow (2/3[leadgap,w], w-thick, true);
	firstbow (1/3[leadgap,w], xpart bowpoint, false);
	secondstem (leadgap, bowpoint);
	top y10=xht;
	draw barpoint--(w,y10);
	endgroup;
endchar;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

thirdwidth := 2.5*leadgap;

beginchar ("7", 3*leadgap#, 3/4[xht#, cap#], 3/4xht#); "The numeral 7";
	begingroup;
	save x, y;
	pickup elvishpen;

	thirdstem (thirdwidth);
	endgroup;
endchar;


beginchar ("8", .75em#, 3/4[xht#, cap#], 3/4xht#); "The numeral 8";
	begingroup;
	save x, y;
	pickup elvishpen;

	thirdstem (thirdwidth);
	luva (bowpoint, w, false);
	underbar;
	endgroup;
endchar;


beginchar ("9", 1em#, 3/4[xht#, cap#], 3/4xht#); "The numeral 9";
	begingroup;
	save x, y;
	pickup elvishpen;

	thirdstem (thirdwidth);
	luva (bowpoint, 1/2[thirdwidth,w], false);
	luva (bowpoint, w, false);
	underbar;
	endgroup;
endchar;



Funky!Stuff!
cat - << \Funky!Stuff! > parmatema.mf
% Copyright 1986 Michael Urban
% Everyone is granted permission to copy, modify and redistribute
% this file, provided that a currently-dated copy of this
% copyright notice is included in the copy.
% License is granted to produce fonts based on the information
% in this file, provided that such fonts are redistributed
% without charge to any third party.

% SCCS ID @(#)parmatema.mf	1.1   10/1/86

beginchar("p", shortwidth,xht#,dep#); "The letter p (parma)";
	pickup elvishpen;
	telco(leadgap,shortstem, stemdepth);
	luva (bowpoint, w, false);
	underbar;
endchar;

beginchar("b", 1em#,xht#,dep#); "The letter b (umbar)";
	pickup elvishpen;
	telco(leadgap,shortstem, stemdepth);
	luva (bowpoint, bowsize*em, false);
	luva (bowpoint, w, false);
	underbar;
endchar;


beginchar("f", shortwidth, cap#, 0); "the letter f (formen)";
	pickup elvishpen;
	telco(leadgap, longstem, stemdepth);
	luva (bowpoint, w, false);
	underbar;
endchar;

beginchar("v", 1em#, cap#, 0); "the letter v (ampa)";
	pickup elvishpen;
	telco(leadgap, longstem, stemdepth);
	luva (bowpoint, bowsize*em, false);
	luva (bowpoint, w, false);
	underbar;
endchar;


beginchar (14, 1em#, cap#, dep#); "the word 'OF'";
	pickup elvishpen;
	telco(leadgap, longstem, stemdepth);
	luva (bowpoint, bowsize*em, false);
	luva (bowpoint, w, false);
	underbar;
endchar;

%
% Should also be a related "of the" glyph
%

beginchar ("w", shortwidth, xht#, 0); "the letter w (vala)";
	pickup elvishpen;
	telco (leadgap, shortstem, stemdepth);
	luva (bowpoint, w, false);
	underbar;
endchar;

beginchar ("m", 1em#, xht#, 0); "the letter m (malta)";
	pickup elvishpen;
	telco(leadgap, shortstem, stemdepth);
	luva (bowpoint, bowsize*em, false);
	luva (bowpoint, w, false);
	underbar;
endchar;
Funky!Stuff!
cat - << \Funky!Stuff! > punctuation.mf
% Copyright 1986 Michael Urban
% Everyone is granted permission to copy, modify and redistribute
% this file, provided that a currently-dated copy of this
% copyright notice is included in the copy.
% License is granted to produce fonts based on the information
% in this file, provided that such fonts are redistributed
% without charge to any third party.

% SCCS ID @(#)punctuation.mf	1.1   10/1/86

beginchar (",", 3*leadgap#, xht#, 0); "The punctuation comma (one dot)";
	begingroup;
	save x, y;
	pickup pensquare scaled thick rotated 45;
	z1 = (1/2w, h/2);
	drawdot z1;
	endgroup;
endchar;

beginchar (";", 2*leadgap#, xht#, 0); "The punctuation semicolon (two dots)";
	begingroup;
	save x, y;
	pickup pensquare scaled thick rotated 45;
	z1 = (w/2, h-2thin);
	z2 = (w/2, 2thin);
	drawdot z1;
	drawdot z2;
	endgroup;
endchar;

beginchar (".", 3*leadgap#, xht#, 0); "The punctuation period (four dots)";
	begingroup;
	save x, y;
	pickup pensquare scaled thick rotated 45;
	z1 = (w/3, h-2thin);
	z2 = (w/3, 2thin);
	z3 = (w, h-2thin);
	z4 = (w, 2thin);
	drawdot z1;
	drawdot z2;
	drawdot z3;
	drawdot z4;
	endgroup;
endchar;

beginchar ("!", .7shortwidth, cap#, 0); "The exclamation point";
	begingroup;
	save x, y;
	pickup elvishpen;
	rt x1 = w; top y1=h;
	y2 = y3 = h/2;
	z1-z2 = z3-z4 = whatever*(dir 40);
	x4 = leadgap; %bot y4=0;
	draw z1..controls z2 and z3..z4;
	endgroup;
endchar;

beginchar ("?", .7shortwidth, cap#, 0); "The question mark";
	begingroup;
	save x, y;
	pickup elvishpen;
	telco (leadgap, longstem, stemdepth);
	z1 = bowpoint;
	top y2 = xht; x2 = .6[leadgap, w];
	rt x3 = w; y3 = .7xht;
	lft x4 = leadgap; bot y4 = 0;
	draw z1..tension 2.0..z2..z3..z4;
	z6-z5 = z2-z1;
	top y6 = h; x6 = x2;
	z7-z6 = z3-z2;
	draw z5..tension 2.0..z6..z7..tension 1.5..z1;
	endgroup;
endchar;

beginchar ("-", shortwidth, xht#, 0); "The dash (tilde)";
	begingroup;
	save x, y;
	pickup elvishpen;
	x1 = leadgap; 
	x4 = w; 
	y1 = .4h; y4 = .6h;
	z2-z1 = z4-z3 = whatever*(dir tilt);
	y2-y1 = 3 (y4-y1);
	draw z1..controls z2 and z3..z4;
	endgroup;
endchar;
Funky!Stuff!
cat - << \Funky!Stuff! > quessetema.mf
% Copyright 1986 Michael Urban
% Everyone is granted permission to copy, modify and redistribute
% this file, provided that a currently-dated copy of this
% copyright notice is included in the copy.
% License is granted to produce fonts based on the information
% in this file, provided that such fonts are redistributed
% without charge to any third party.

% SCCS ID @(#)quessetema.mf	1.1   10/1/86

beginchar("k", shortwidth,xht#,dep#); "The letter k (quesse)";
	pickup elvishpen;
	nutelco(w,shortstem, stemdepth);
	nuluva (bowpoint, 0, false);
	overbar;
endchar;

beginchar("g", 1em#,xht#,dep#); "The letter g (ungwe)";
	pickup elvishpen;
	nutelco(w,shortstem, stemdepth);
	nuluva (bowpoint,w-bowsize*em+leadgap, false);
	nuluva (bowpoint, leadgap, false);
	overbar;
endchar;

beginchar("K", shortwidth,cap#,0); "The ligature KH (hwesta)";
	pickup elvishpen;
	nutelco(w,longstem, stemdepth);
	nuluva (bowpoint, leadgap, false);
	overbar;
endchar;

beginchar("G", 1em#,cap#,0); "The ligature GH (unque)";
	pickup elvishpen;
	nutelco(w,longstem, stemdepth);
	nuluva (bowpoint,w-bowsize*em+leadgap, false);
	nuluva (bowpoint, leadgap, false);
	overbar;
endchar;


beginchar("A", shortwidth,xht#,0); "The letter A (Vilya)";
	pickup elvishpen;
	nutelco(w,shortstem, stemdepth);
	nuluva (bowpoint, leadgap, false);
	overbar;
endchar;


beginchar("N", 1em#,xht#,0); "The ligature NG (Ngwalme)";
	pickup elvishpen;
	nutelco(w,shortstem, stemdepth);
	nuluva (bowpoint,w-bowsize*em+leadgap, false);
	nuluva (bowpoint, leadgap, false);
	overbar;
endchar;

Funky!Stuff!
cat - << \Funky!Stuff! > telcor.mf
% Copyright 1986 Michael Urban
% Everyone is granted permission to copy, modify and redistribute
% this file, provided that a currently-dated copy of this
% copyright notice is included in the copy.
% License is granted to produce fonts based on the information
% in this file, provided that such fonts are redistributed
% without charge to any third party.

% SCCS ID @(#)telcor.mf	1.1   10/1/86

def telco (expr posn, stemtop, stembottom) =
	begingroup;
	save x,y,stem;
	path stem;
	y0 = stemtop*h;
	lft x0 = posn;
	y1 = h; z1-z0=whatever*dir(seriftilt);
	x3 = x0; y3 = -stembottom*d;
	y4 = -d; z3-z4=whatever*dir(180-seriftilt);
	stem = z1..tension 3.0..z0{down}..z3{down}..z4;
	draw stem;
	bowpoint := stem intersectionpoint
		((-infinity,bowstart)--(infinity, bowstart));
	barpoint := stem intersectionpoint
		((-infinity,0)--(infinity, 0));
	penlabels(0,1,2,3,4);
	endgroup;
enddef;

def nutelco (expr posn, stemtop, stembottom) =
	begingroup;
	save x,y,stem;
	path stem;
	y0 = stemtop*h;
	rt x0 = posn;
	y1 = h; z1-z0=whatever*dir(seriftilt);
	x3 = x0; y3 = -stembottom*d;
	y4 = -d; z3-z4=whatever*dir(seriftilt);
	stem = z1..tension 3.0..z0{down}..z3--z4;
	draw stem;
	bowpoint := stem intersectionpoint
		((-infinity, xht-bowstart)--(infinity, xht-bowstart));
	if y0 > xht :
		barpoint := stem intersectionpoint
		((-infinity, xht)--(infinity, xht));
	else :
		barpoint := z0;
	fi ;
	penlabels(0,1,3,4);
	endgroup;
enddef;

Funky!Stuff!
cat - << \Funky!Stuff! > tengwar.mf
% Copyright 1986 Michael Urban
% Everyone is granted permission to copy, modify and redistribute
% this file, provided that a currently-dated copy of this
% copyright notice is included in the copy.
% License is granted to produce fonts based on the information
% in this file, provided that such fonts are redistributed
% without charge to any third party.

% SCCS ID @(#)tengwar.mf	1.1   10/1/86

mode_setup;
em#:=10pt#; cap#=.8em#; dep#=.4em#; xht#=.4em#;
shortwidth := .6em#;

thick#:=9/80em#; thin#:=3/80em#;
leadgap# := .1em#;
bowstart#= .66xht#;
serifthick# := 1.1thick#;

tilt:=50; seriftilt := 110; botseriftilt:=80;
shortstem := .7;
longstem := .85;
stemdepth := .9;
bowsize := .58;

define_pixels(em,cap,dep,xht,bowstart);
define_pixels(thin,thick,serifthick,leadgap);

pen elvishpen; elvishpen = pencircle xscaled thick yscaled thin rotated tilt;

%
% Because even "tall" characters want to be accented in the same place,
% but because we want to use "h" in "beginchar" definitions
% in a typical plain-MF way,
% we force all characters to have a character height of xht#.  This is
% something a kludge, and makes tall characters stick into preceding lines
% when the baselines aren't sufficiently separated.  But that's how the
% title-page inscription looks anyway.
%
let oldendchar = endchar;
def endchar=
	charht := xht#;
	oldendchar;
enddef;

input tiw;

font_normal_space .45em#;
font_normal_stretch .22em#;
font_normal_shrink .15em#;
font_x_height xht#;
font_quad 1em#;
font_extra_space 1/6em#;
designsize:=1em#;

input ligtable;

bye;
Funky!Stuff!
cat - << \Funky!Stuff! > tincotema.mf
% Copyright 1986 Michael Urban
% Everyone is granted permission to copy, modify and redistribute
% this file, provided that a currently-dated copy of this
% copyright notice is included in the copy.
% License is granted to produce fonts based on the information
% in this file, provided that such fonts are redistributed
% without charge to any third party.

% SCCS ID @(#)tincotema.mf	1.1   10/1/86

beginchar("t", shortwidth,xht#,dep#); "The letter t (tinco)";
	pickup elvishpen;
	telco(leadgap,shortstem, stemdepth);
	luva (bowpoint, w, true);
endchar;

beginchar("d", 1em#,xht#,dep#); "The letter d (ando)";
	pickup elvishpen;
	telco(leadgap,shortstem, stemdepth);
	luva (bowpoint, bowsize*em, true);
	luva (bowpoint, w, true);
endchar;

beginchar("T", shortwidth, cap#, 0); "the ligature th (thule)";
	pickup elvishpen;
	telco(leadgap, longstem, stemdepth);
	luva (bowpoint, w, true);
endchar;

beginchar("D", 1em#, cap#, 0); "the ligature dh (anto)";
	pickup elvishpen;
	telco(leadgap, longstem, stemdepth);
	luva (bowpoint, bowsize*em, true);
	luva (bowpoint, w, true);
endchar;

beginchar (004, 1em#, cap#, dep#); "the word 'THE'";
	pickup elvishpen;
	telco(leadgap, longstem, stemdepth);
	luva (bowpoint, bowsize*em, true);
	luva (bowpoint, w, true);
endchar;

beginchar ("R", shortwidth, xht#, 0); "the weak letter R (ore)";
	pickup elvishpen;
	telco (leadgap, shortstem, stemdepth);
	luva (bowpoint, w, true);
endchar;

beginchar ("n", 1em#, xht#, 0); "the letter n (numen)";
	pickup elvishpen;
	telco(leadgap, shortstem, stemdepth);
	luva (bowpoint, bowsize*em, true);
	luva (bowpoint, w, true);
endchar;
Funky!Stuff!
cd ..
-- 

   Mike Urban
	...!trwrb!trwspp!spp2!urban 

"You're in a maze of twisty UUCP connections, all alike"