%%
%% This is file `copsn10.mf',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% oldprsn.dtx  (with options: `up')
%% ------------------------------------------------------------------
%%   Author: Peter Wilson (Herries Press) herries dot press at earthlink dot net
%%   Copyright 1999--2005 Peter R. Wilson
%% 
%%   This work may be distributed and/or modified under the
%%   conditions of the Latex Project Public License, either
%%   version 1.3 of this license or (at your option) any
%%   later version.
%%   The latest version of the license is in
%%     http://www.latex-project.org/lppl.txt
%%   and version 1.3 or later is part of all distributions of
%%   LaTeX version 2003/06/01 or later.
%% 
%%   This work has the LPPL maintenance status "author-maintained".
%% 
%%   This work consists of the files listed in the README file.
%% ------------------------------------------------------------------
%%% COPSN10.MF  Computer Old Persian Cuneiform font 10 point design size.


font_identifier:="oldprsn"; font_size 10pt#;

u#:=.2pt#;                 % unit width
ht#:=8pt#;                 % height of characters (CM cap-height is approx 6.8pt)
s#:=1.5pt#;                % width correction (right and left)
o#:=1/20pt#;               % overshoot
px#:=.4pt#;                % horizontal width of pen
font_normal_space:=7pt#;   % width of a blank space
font_normal_shrink:=.9pt#; % width correction for blank space
font_x_height:=4.5pt#;     % height of one ex
font_quad:=10pt#;          % an em

font_coding_scheme:="Old Persian glyphs";
mode_setup;

ho#:=o#;                   % horizontal overshoot
leftloc#:=s#;              % leftmost xcoord of character
py#:=px#;                % vertical thickness of the pen

define_pixels(s,u);
define_blacker_pixels(px,py);
define_good_x_pixels(leftloc);
define_corrected_pixels(o);             % turn on overshoot correction
define_horizontal_corrected_pixels(ho);

numeric midloc, rightloc, aw;
pickup pencircle xscaled px yscaled py;
stylus:=savepen;

numeric trht, trbs;
numeric th, tb;
th = 6/24; tb = 8/24;
numeric wiht, wibs;
numeric wh, wb;
wh = 10/24; wb = 20/24;
def beginglyph(expr code, unit_width) =
  beginchar(code, unit_width*ht#+2s#, ht#, 0);
  midloc:=1/2w; rightloc:=(w-s); aw := rightloc-leftloc;
  trht := th*h; trbs := tb*h;
  wiht := wh*h; wibs := wb*h;
  pickup stylus enddef;

let cmchar=\;


def triangle(suffix $)(expr ht, bs, ang) =
  path pth[];
  pair pr[];
  pr1 := (x$-ht,y$);  % midpoint of base in default position
  pr2 := pr1 shifted (1/2bs*up);   % base points
  pr3 := pr1 shifted (1/2bs*down);
  z$trl = pr2 rotatedaround(z$, ang);
  z$trr = pr3 rotatedaround(z$, ang);
  z$trc = 1/2[z$trl,z$trr];
  z$tic = 1/2[z$,z$trc];
  pth$ := z$--z$trl--z$trr--cycle;
enddef;


def trir(suffix $)(expr ht, bs) =
  path pth[];
  z$trc = (x$-ht, y$);              % midpoint of base
  z$trl = (x$trc, y$trc+1/2bs);     % base points
  z$trr = (x$trc, y$trc-1/2bs);
  z$tic = 1/2[z$,z$trc];
  pth$ := z$--z$trl--z$trr--cycle;
enddef;


def triu(suffix $)(expr ht, bs) =
  path pth[];
  z$trc = (x$, y$-ht);         % midpoint of base
  z$trl = (x$-1/2bs, y$trc);   % base points
  z$trr = (x$+1/2bs, y$trc);   % base points
  z$tic = 1/2[z$,z$trc];
  pth$ := z$--z$trl--z$trr--cycle;
enddef;


def tril(suffix $)(expr ht, bs) =
  path pth[];
  z$trc = (x$+ht, y$);              % midpoint of base
  z$trl = (x$trc, y$trc-1/2bs);     % base points
  z$trr = (x$trc, y$trc+1/2bs);
  z$tic = 1/2[z$,z$trc];
  pth$ := z$--z$trl--z$trr--cycle;
enddef;


def tril(suffix $)(expr ht, bs) =
  path pth[];
  z$trc = (x$+ht, y$);              % midpoint of base
  z$trl = (x$trc, y$trc-1/2bs);     % base points
  z$trr = (x$trc, y$trc+1/2bs);
  z$tic = 1/2[z$,z$trc];
  pth$ := z$--z$trl--z$trr--cycle;
enddef;


def trid(suffix $)(expr ht, bs) =
  path pth[];
  z$trc = (x$, y$+ht);         % midpoint of base
  z$trl = (x$+1/2bs, y$trc);   % base points
  z$trr = (x$-1/2bs, y$trc);   % base points
  z$tic = 1/2[z$,z$trc];
  pth$ := z$--z$trl--z$trr--cycle;
enddef;


def wing(suffix $)(expr ht, bs, ang) =
  path pth[];
  pair pr[];
  pr1 := (x$+ht,y$);  % midpoint of base in default position
  pr2 := pr1 shifted (1/2bs*down);   % base points
  pr3 := pr1 shifted (1/2bs*up);
  pr4 := pr1 rotatedaround(z$, ang);
  z$wil = pr2 rotatedaround(z$, ang);
  z$wir = pr3 rotatedaround(z$, ang);
  z$wic = 1/2[z$,pr4];
  pth$ := z$--z$wil{(z$wic-z$wil)}..z$wic..{(z$wir-z$wic)}z$wir--cycle;
enddef;


def wingl(suffix $)(expr ht, bs) =
  path pth[];
  z$wil = (x$+ht, y$-1/2bs);      % base points
  z$wir = (x$wil, y$+1/2bs);
  z$wic = (1/2[x$,x$wil], y$);    % midpoint of base curve
  pth$ := z$--z$wil{(z$wic-z$wil)}..z$wic..{(z$wir-z$wic)}z$wir--cycle;
enddef;


def wingd(suffix $)(expr ht, bs) =
  path pth[];
  z$wil = (x$+1/2bs, y$+ht);      % base points
  z$wir = (x$-1/2bs, y$wil);
  z$wic = (x$, 1/2[y$,y$wil]);    % midpoint of base curve
  pth$ := z$--z$wil{(z$wic-z$wil)}..z$wic..{(z$wir-z$wic)}z$wir--cycle;
enddef;


def wingr(suffix $)(expr ht, bs) =
  path pth[];
  z$wil = (x$-ht, y$+1/2bs);      % base points
  z$wir = (x$wil, y$-1/2bs);
  z$wic = (1/2[x$,x$wil], y$);    % midpoint of base curve
  pth$ := z$--z$wil{(z$wic-z$wil)}..z$wic..{(z$wir-z$wic)}z$wir--cycle;
enddef;


def wingu(suffix $)(expr ht, bs) =
  path pth[];
  z$wil = (x$-1/2bs, y$-ht);      % base points
  z$wir = (x$+1/2bs, y$wil);
  z$wic = (x$, 1/2[y$,y$wil]);    % midpoint of base curve
  pth$ := z$--z$wil{(z$wic-z$wil)}..z$wic..{(z$wir-z$wic)}z$wir--cycle;
enddef;

cmchar "Old Persian letter a";
beginglyph("a", (3tb+2th));
  z1trl=(leftloc,h);                   % top pin
  trir(1, trht, trbs); fill pth1;
  z1'=(rightloc,y1); draw z1tic--z1';
  z12trc=(midloc,y1trr);               % middle pin
  trid(12, trht, trbs); fill pth12;
  z12'=(x12,0); draw z12tic--z12';
  z11trl=z12trr;                       % left pin
  trid(11, trht, trbs); fill pth11;
  z11'=(x11,0); draw z11tic--z11';
  z13trr=z12trl;                       % right pin
  trid(13, trht, trbs); fill pth13;
  z13'=(x13,0); draw z13tic--z13';
  labels(1,11,12,13);
endchar;

cmchar "Old Persian letter i";
beginglyph("i", (2tb));        %% 3tb too large
  z1trl=(leftloc,h);                   % top pin
  trir(1, trht, trbs); fill pth1;
  z1'=(rightloc,y1); draw z1tic--z1';
  z11trr=z1trr;                        % left pin
  trid(11, trht, trbs); fill pth11;
  z11'=(x11,0); draw z11tic--z11';
  z12trr=z11trl;                       % middle pin
  trid(12, trht, trbs); fill pth12;
  z12'=(x12,0); draw z12tic--z12';
  z2trc=(x11trl,y1);                   % second top head
  trir(2, trht, trbs); fill pth2;
  labels(1,2,11,12,13);
endchar;

cmchar "Old Persian letter u";
beginglyph("u", (2tb+wh));     %% 3tb+wh too large
  z31=(leftloc,1/2h);                  % left wing
  wingl(31, wiht, wibs); fill pth31;
  z1trl=(x31wil,h);                   % top pin
  trir(1, trht, trbs); fill pth1;
  z1'=(rightloc,y1); draw z1tic--z1';
  z11trr=z1trr;                        % left pin
  trid(11, trht, trbs); fill pth11;
  z11'=(x11,0); draw z11tic--z11';
  z12trr=z11trl;                       % middle pin
  trid(12, trht, trbs); fill pth12;
  z12'=(x12,0); draw z12tic--z12';
  labels(1,2,11,12,13);
endchar;

cmchar "Old Persian syllable ka (k)";
beginglyph("k", (3tb));         %% 4tb too large
  z1trr=(leftloc,h);                       % left pin
  trid(1, trht, trbs); fill pth1;
  z1'=(x1,0); draw z1tic--z1';
  z11trr=(x1trl,1/2h);                     % top pin
  trir(11, trht, trbs); fill pth11;
  z11'=(rightloc,y11); draw z11tic--z11';
  z12trl=z11trr;                           % bottom pin
  trir(12, trht, trbs); fill pth12;
  z12'=(rightloc,y12); draw z12tic--z12';
  labels(1,11,12);
endchar;

cmchar "Old Persian syllable ku (K)";
beginglyph("K", (tb+wh));
  z1=(leftloc,1/2h);                       % wing
  wingl(1, wiht, wibs); fill pth1;
  z2trr=(x1wil,h);                         % pin
  trid(2, trht, trbs); fill pth2;
  z2'=(x2,0); draw z2tic--z2';
  labels(1,2);
endchar;

cmchar "Old Persian syllable xa (x)";
beginglyph("x", (2tb+2wh));
  z1=(leftloc,1/2h);                       % left wing
  wingl(1, wiht, wibs); fill pth1;
  z2=(x1wil,y1);                           % right wing
  wingl(2, wiht, wibs); fill pth2;
  z11trr=(x2wil,h);                       % left pin
  trid(11, trht, trbs); fill pth11;
  z11'=(x11,0); draw z11tic--z11';
  z12trr=z11trl;                           % right pin
  trid(12, trht, trbs); fill pth12;
  z12'=(x12,0); draw z12tic--z12';
  labels(1,2,11,12);
endchar;

cmchar "Old Persian syllable ga (g)";
beginglyph("g", (3tb+wh));
  z1=(leftloc,1/2h);                      % wing
  wingl(1, wiht, wibs); fill pth1;
  z11trr=(x1wil,h);                       % left pin
  trid(11, trht, trbs); fill pth11;
  z11'=(x11,0); draw z11tic--z11';
  z12trr=z11trl;                           % right pin
  trid(12, trht, trbs); fill pth12;
  z12'=(x12,0); draw z12tic--z12';
  z21trc=(x12trl,y1);                      % small pin
  trir(21, trht, trbs); fill pth21;
  z21'=(rightloc,y21); draw z21tic--z21';
  labels(1,2,11,12,21);
endchar;

cmchar "Old Persian syllable gu (G)";
beginglyph("G", (2tb+th+wh));  %% 3tb+wh too large
  z1=(leftloc,1/2h);                      % wing
  wingl(1, wiht, wibs); fill pth1;
  z12trc=(x1wil, 1/2h);                   % middle pin
  trir(12, trht, trbs); fill pth12;
  z12'=(rightloc,y12); draw z12tic--z12';
  z13trl=z12trr;                          % bottom pin
  trir(13, trht, trbs); fill pth13;
  z13'=(rightloc,y13); draw z13tic--z13';
  z11trr=z12trl;                          % top pin
  trir(11, trht, trbs); fill pth11;
  z11'=(rightloc,y11); draw z11tic--z11';
  z111trc=1/2[z11trc,z11'];
  trir(111, trht, trbs); fill pth111;
  labels(1,2,3,4,5,6,11,12,13,111);
endchar;

cmchar "Old Persian syllable ca (c)";
beginglyph("c", (4tb));
  z1trl=(leftloc,h);                      % top pin
  trir(1, trht, trbs); fill pth1;
  z11trr=(x1, y1trr);                     % left pin
  trid(11, trht, trbs); fill pth11;
  z11'=(x11,0); draw z11tic--z11';
  z12trr=z11trl;                          % middle pin
  trid(12, trht, trbs); fill pth12;
  z12'=(x12,0); draw z12tic--z12';
  z2trl=z12trl;                           % bottom pin
  trir(2, trht, trbs); fill pth2;
  z2'=(rightloc,y2); draw z2tic--z2';
  z1'=(x2trl,y1); draw z1tic--z1';        % body of top pin
  labels(1,2,3,4,5,6,11,12,13);
endchar;

cmchar "Old Persian syllable ja (j)";
beginglyph("j", (th+tb+wh));
  z1trc=(leftloc,1/2h);                   % hor pin
  trir(1, trht, trbs); fill pth1;
  z2=(rightloc-wiht,y1);                  % wing
  wingl(2, wiht, wibs); fill pth2;
  draw z1tic--z2;
  z11trc=(1/2[x1,x2], h);                 % vert pin
  trid(11, trht, trbs); fill pth11;
  z11'=(x11,0); draw z11tic--z11';
  labels(1,2,3,4,11,12,13);
endchar;

cmchar "Old Persian syllable ji (J)";
beginglyph("J",(7/2tb+wh));        %% 4tb+wh too large
  z1trc=(leftloc, 1/2h);            % left pin
  trir(1, trht, trbs); fill pth1;
  z2=(x1+trbs, y1);                 % wing
  draw z1tic--z2;
  wingl(2, wiht, wibs); fill pth2;
  z12trc=(x2wil,y1);                % middle pin
  trir(12, trht, trbs); fill pth12;
  z12'=(rightloc, y12); draw z12tic--z12';
  z11trr=z12trl;                    % top pin
  trir(11, trht, trbs); fill pth11;
  z11'=(rightloc, y11); draw z11tic--z11';
  z13trl=z12trr;                    % bottom pin
  trir(13, trht, trbs); fill pth13;
  z13'=(rightloc, y13); draw z13tic--z13';
  labels(1,2,3,4,5,6,7,8,9,10,11,12,13);
endchar;

cmchar "Old Persian syllable ta (t)";
beginglyph("t", (4tb+th));    %% 5tb too large
  z3trl=(rightloc,h);               % right pin
  trid(3, trht, trbs); fill pth3;
  z3'=(x3,0); draw z3tic--z3';
  z1trl=(x3trr-trbs,h);            % left pin
  trid(1, trht, trbs); fill pth1;
  z1'=(x1,0); draw z1tic--z1';
  z11trr=(leftloc,1/2h);            % top pin
  trir(11, trht, trbs); fill pth11;
  z11'=(x1,y11); draw z11tic--z11';
  z12trl=z11trr;                    % bottom pin
  trir(12, trht, trbs); fill pth12;
  z12'=(x1,y12); draw z12tic--z12';
  z2trc=(1/2[x1,x3], y11trl);       % middle pin
  trid(2, trht, trbs); fill pth2;
  z2'=(x2,0); draw z2tic--z2';
  labels(1,2,3,4,5,6,7,8,9,10,11,12);
endchar;

cmchar "Old Persian syllable tu (T)";
beginglyph("T", (4tb+th));   %% 5tb too large
  z1trr=(leftloc,h);                 % left pin
  trid(1, trht, trbs); fill pth1;
  z1'=(x1,0); draw z1tic--z1';
  z2trr=z1trl;                       % center pin
  trid(2, trht, trbs); fill pth2;
  z2'=(x2,0); draw z2tic--z2';
  z3trr=z2trl;                       % right pin
  trid(3, trht, trbs); fill pth3;
  z3'=(x3,0); draw z3tic--z3';
  z11trl=(x3trl, 1/2h);              % short hor pin
  trir(11, trht, trbs); fill pth11;
  z11'=(rightloc,y11); draw z11tic--z11';
  labels(1,2,3,11);
endchar;

cmchar "Old Persian syllable tha (o)";
beginglyph("o", (2tb+wh));
  z1trr=(leftloc,h);                     % left pin
  trid(1, trht, trbs); fill pth1;
  z1'=(x1,0); draw z1tic--z1';
  z2=(x1,1/2h);                          % wing
  wingl(2, wiht, wibs); fill pth2;
  z3trr=(x2wil,h);                       % right pin
  trid(3, trht, trbs); fill pth3;
  z3'=(x3,0); draw z3tic--z3';
  labels(1,2,3);
endchar;

cmchar "Old Persian syllable c(cedilla)a (C)";
beginglyph("C", (2tb));
  z1trl=(leftloc,h);                   % top pin
  trir(1, trht, trbs); fill pth1;
  z1'=(rightloc,y1); draw z1tic--z1';
  z2trl=z1trr;                         % center pin
  trir(2, trht, trbs); fill pth2;
  z2'=(rightloc,y2); draw z2tic--z2';
  z11trr=z2trr;                        % left pin
  trid(11, trht, trbs); fill pth11;
  z11'=(x11,0); draw z11tic--z11';
  z12trr=z11trl;                       % right pin
  trid(12, trht, trbs); fill pth12;
  z12'=(x12,0); draw z12tic--z12';
  labels(1,2,11,12);
endchar;

cmchar "Old Persian syllable da (d)";
beginglyph("d", (2tb));
  z1trl=(leftloc,h);                   % top pin
  trir(1, trht, trbs); fill pth1;
  z1'=(rightloc,y1); draw z1tic--z1';
  z11trr=z1trr;                        % left pin
  trid(11, trht, trbs); fill pth11;
  z11'=(x11,0); draw z11tic--z11';
  z12trr=z11trl;                       % right pin
  trid(12, trht, trbs); fill pth12;
  z12'=(x12,0); draw z12tic--z12';
  labels(1,2,11,12);
endchar;

cmchar "Old Persian syllable di (P)";
beginglyph("P", (3tb+th));   %% 4tb too large
  z2trl=(rightloc,h);                  % right pin
  trid(2, trht, trbs); fill pth2;
  z2'=(x2,0); draw z2tic--z2';
  z1trl=z2trr;                         % left pin
  trid(1, trht, trbs); fill pth1;
  z1'=(x1,0); draw z1tic--z1';
  z12trc=(leftloc,1/2h);               % center pin
  trir(12, trht, trbs); fill pth12;
  z12'=(x1,y12); draw z12tic--z12';
  z11trr=z12trl;                       % top pin
  trir(11, trht, trbs); fill pth11;
  z11'=(x1,y11); draw z11tic--z11';
  z13trl=z12trr;                       % bottom pin
  trir(13, trht, trbs); fill pth13;
  z13'=(x1,y13); draw z13tic--z13';
  labels(1,2,11,12,13);
endchar;

cmchar "Old Persian syllable du (D)";
beginglyph("D", (2tb+th+wh));   %% 3tb+wh too large
  z1=(leftloc,h/2);                     % wing
  wingl(1, wiht, wibs); fill pth1;
  z2trl=(rightloc,h);                   % right pin
  trid(2, trht, trbs); fill pth2;
  z2'=(x2,0); draw z2tic--z2';
  z12trc=(x1wil,h/2);                   % center pin
  trir(12, trht, trbs); fill pth12;
  z12'=(x2,y12); draw z12tic--z12';
  z11trr=z12trl;                       % top pin
  trir(11, trht, trbs); fill pth11;
  z11'=(x2,y11); draw z11tic--z11';
  z13trl=z12trr;                       % bottom pin
  trir(13, trht, trbs); fill pth13;
  z13'=(x2,y13); draw z13tic--z13';
  labels(1,2,11,12,13);
endchar;

cmchar "Old Persian syllable na (n)";
beginglyph("n", (2tb+wh));
  z1=(rightloc-wiht, h/2);                  % wing
  wingl(1, wiht, wibs); fill pth1;
  z11trr=(leftloc,h/2);                     % top pin
  trir(11, trht, trbs); fill pth11;
  z11'=(x1,y11); draw z11tic--z11';
  z12trl=z11trr;                            % bottom pin
  trir(12, trht, trbs); fill pth12;
  z12'=(x1,y12); draw z12tic--z12';
  labels(1,11,12);
endchar;

cmchar "Old Persian syllable nu (N)";
beginglyph("N", (2tb+2wh));
  z1=(leftloc, h/2);                        % left wing
  wingl(1, wiht, wibs); fill pth1;
  z2=(x1wil, y1);                           % right wing
  wingl(2, wiht, wibs); fill pth2;
  z11trr=(x2wil,h/2);                       % top pin
  trir(11, trht, trbs); fill pth11;
  z11'=(rightloc,y11); draw z11tic--z11';
  z12trl=z11trr;                            % bottom pin
  trir(12, trht, trbs); fill pth12;
  z12'=(rightloc,y12); draw z12tic--z12';
  labels(1,2,11,12);
endchar;

cmchar "Old Persian syllable pa (p)";
beginglyph("p", (2tb));
  z1trc=(leftloc,h);                       % top pin
  trir(1, trht, trbs); fill pth1;
  z1'=(rightloc,y1); draw z1tic--z1';
  z2trl=(x1,y1);                        % middle pin
  trir(2, trht, trbs); fill pth2;
  z2'=(rightloc,y2); draw z2tic--z2';
  z3trl=(x1trc,y2);                     % bottom pin
  trir(3, trht, trbs); fill pth3;
  z3'=(rightloc,y3); draw z3tic--z3';
  z11trr=z3trr;                      % left pin
  trid(11, trht, trbs); fill pth11;
  z11'=(x11,0); draw z11tic--z11';
  z12trr=z11trl;                           % right pin
  trid(12, trht, trbs); fill pth12;
  z12'=(x12,0); draw z12tic--z12';
  labels(1,2,3,11,12);
endchar;

cmchar "Old Persian syllable fa (f)";
beginglyph("f", (tb+2wh));
  z1trr=(leftloc,h);                      % left pin
  trid(1, trht, trbs); fill pth1;
  z1'=(x1,0); draw z1tic--z1';
  z11=(x1,h/2);                           % left wing
  wingl(11, wiht, wibs); fill pth11;
  z12=(x11wil,y11);                       % right wing
  wingl(12, wiht, wibs); fill pth12;
  labels(1,11,12);
endchar;

cmchar "Old Persian syllable ba (b)";
beginglyph("b", (3tb));
  z1trl=(rightloc,h);                   % right pin
  trid(1, trht, trbs); fill pth1;
  z1'=(x1,0); draw z1tic--z1';
  z11trr=(leftloc,h/2);                 % top pin
  trir(11, trht, trbs); fill pth11;
  z11'=(x1,y11); draw z11tic--z11';
  z12trl=z11trr;                        % bottom pin
  trir(12, trht, trbs); fill pth12;
  z12'=(x1,y12); draw z12tic--z12';
  labels(1,11,12);
endchar;

cmchar "Old Persian syllable ma (m)";
beginglyph("m", (4tb+th));   %% 5tb too large
  z3trl=(rightloc,h);                  % right pin
  trid(3, trht, trbs); fill pth3;
  z3'=(x3,0); draw z3tic--z3';
  z2trl=(x3trr,y3);                    % center pin
  trid(2, trht, trbs); fill pth2;
  z2'=(x2,0); draw z2tic--z2';
  z1trl=(x2trr,h);                     % left pin
  trid(1, trht, trbs); fill pth1;
  z1'=(x1,0); draw z1tic--z1';
  z11trc=(leftloc, h/2);               % hor pin
  trir(11, trht, trbs); fill pth11;
  z11'=(x1,y11); draw z11tic--z11';
  labels(1,2,3,11);
endchar;

cmchar "Old Persian syllable mi (w)";
beginglyph("w", (2tb+wh));
  z1trr=(leftloc,h);                 % left pin
  trid(1, trht, trbs); fill pth1;
  z1'=(x1,0); draw z1tic--z1';
  z2=(x1,h/2);                       % wing
  wingl(2, wiht, wibs); fill pth2;
  z11trr=(x2wil, h/2);               % top pin
  trir(11, trht, trbs); fill pth11;
  z11'=(rightloc,y11); draw z11tic--z11';
  z12trl=z11trr;                     % bottom pin
  trir(12, trht, trbs); fill pth12;
  z12'=(rightloc,y12); draw z12tic--z12';
  labels(1,2,11,12);
endchar;

cmchar "Old Persian syllable mu (M)";
beginglyph("M", (5tb+wh));
  z5trc=(rightloc-2trbs, h/2);          % right pin
  trir(5, trht, trbs); fill pth5;
  z5'=(rightloc,y5); draw z5tic--z5';
  z4=(x5trc-wiht,y5);                   % wing
  wingl(4, wiht, wibs); fill pth4;
  z2trc=(leftloc+trht,y5);              % middle pin
  trir(2, trht, trbs); fill pth2;
  z2'=z4; draw z2tic--z2';
  z1trr=(leftloc,y2trl);                % top pin
  trir(1, trht, trbs); fill pth1;
  z1'=(3/4[x1,x2'],y1); draw z1tic--z1';
  z3trl=(leftloc,y2trr);                % bottom pin
  trir(3, trht, trbs); fill pth3;
  z3'=(x1',y3); draw z3tic--z3';
  labels(1,2,3,4);
endchar;

cmchar "Old Persian syllable ya (y)";
beginglyph("y", (2tb+wh));
  z1trr=(leftloc,h);                 % left pin
  trid(1, trht, trbs); fill pth1;
  z1'=(x1,0); draw z1tic--z1';
  z2=(x1,h/2);                       % wing
  wingl(2, wiht, wibs); fill pth2;
  z11trc=(x2wil, h/2);               % right pin
  trir(11, trht, trbs); fill pth11;
  z11'=(rightloc,y11); draw z11tic--z11';
  labels(1,2,11,12);
endchar;

cmchar "Old Persian syllable ra (r)";
beginglyph("r", (3tb+th));   %% 4tb too large
  z11trl=(rightloc, h);                 % right pin
  trid(11, trht, trbs); fill pth11;
  z11'=(x11,0); draw z11tic--z11';
  z2trc=(leftloc+trht,h/2);              % middle pin
  trir(2, trht, trbs); fill pth2;
  z2'=(x11,y2); draw z2tic--z2';
  z1trr=(leftloc,y2trl);                % top pin
  trir(1, trht, trbs); fill pth1;
  z1'=(x2',y1); draw z1tic--z1';
  z3trl=(leftloc,y2trr);                % bottom pin
  trir(3, trht, trbs); fill pth3;
  z3'=(x2',y3); draw z3tic--z3';
  labels(1,2,3,4);
endchar;

cmchar "Old Persian syllable ru (R)";
beginglyph("R", (tb+th+2wh));  %% 2tb+2wh too large
  z3=(rightloc-wiht,h/2);               % right wing
  wingl(3, wiht, wibs); fill pth3;
  z2=(x3-wiht,y3);                      % left wing
  wingl(2, wiht, wibs); fill pth2;
  z1trc=(leftloc,y3);                   % pin
  trir(1, trht, trbs); fill pth1;
  z1'=z2; draw z1tic--z1';
  labels(1,2,3);
endchar;

cmchar "Old Persian syllable la (l)";
beginglyph("l", (3tb+th));  %% 4tb too large
  z11trl=(rightloc,h);                    % right pin
  trid(11, trht, trbs); fill pth11;
  z11'=(x11,0); draw z11tic--z11';
  z2trc=(leftloc,h/2);                  % middle pin
  trir(2, trht, trbs); fill pth2;
  z2'=(x11,y2); draw z2tic--z2';
  z1trr=(x2,y2trl);                % top pin
  trir(1, trht, trbs); fill pth1;
  z1'=(x2',y1); draw z1tic--z1';
  z3trl=(x1trr,y2trr);                % bottom pin
  trir(3, trht, trbs); fill pth3;
  z3'=(x2',y3); draw z3tic--z3';
  labels(1,2,3,11);
endchar;

cmchar "Old Persian syllable va (v)";
beginglyph("v", (5tb));
  z11trc=(leftloc,h/2);                    % left hor pin
  trir(11, trht, trbs); fill pth11;
  z11'=(x11+trbs,y11); draw z11tic--z11';
  z12trc=(x11',h);                         % vert pin
  trid(12, trht, trbs); fill pth12;
  z12'=(x12,0); draw z12tic--z12';
  z2=(x12+1/2trbs+2trht, h/2);             % middle pin
  trir(2, trht, trbs); fill pth2;
  z2'=(rightloc,y2); draw z2tic--z2';
  z1trr=(x2trc-trht,y2trl);                % top pin
  trir(1, trht, trbs); fill pth1;
  z1'=(x2',y1); draw z1tic--z1';
  z3trl=(x1trr,y2trr);                % bottom pin
  trir(3, trht, trbs); fill pth3;
  z3'=(x2',y3); draw z3tic--z3';
  labels(1,2,3,11);
endchar;

cmchar "Old Persian syllable vi (V)";
beginglyph("V", (2tb));
  z1trl=(midloc,1/3h);               % left pin
  trid(1, trht, trbs); fill pth1;
  z1'=(x1,0); draw z1tic--z1';
  z2trr=z1trl;                       % right pin
  trid(2, trht, trbs); fill pth2;
  z2'=(x2,0); draw z2tic--z2';
  z3trc=(x1trl,h);                   % top pin
  trid(3, trht, trbs); fill pth3;
  z3'=(x3,y1trl); draw z3tic--z3';
  z11trc=(leftloc, 1/2[y1trl,y3trl]);  % hor pin
  trir(11, trht, trbs); fill pth11;
  z11'=(rightloc,y11); draw z11tic--z11';
  labels(1,2,3,4,11);
endchar;

cmchar "Old Persian syllable sa (s)";
beginglyph("s", (3tb+th));  %% 4tb too large
  z12trr=(leftloc,h);                         % vert pin
  trid(12, trht, trbs); fill pth12;
  z12'=(x12,0); draw z12tic--z12';
  z2=(x12+1/2trbs+2trht, h/2);             % middle pin
  trir(2, trht, trbs); fill pth2;
  z2'=(rightloc,y2); draw z2tic--z2';
  z1trr=(x2trc-trht,y2trl);                % top pin
  trir(1, trht, trbs); fill pth1;
  z1'=(x2',y1); draw z1tic--z1';
  z3trl=(x1trr,y2trr);                % bottom pin
  trir(3, trht, trbs); fill pth3;
  z3'=(x2',y3); draw z3tic--z3';
  labels(1,2,3,11,12);
endchar;

cmchar "Old Persian syllable sva (S)";
beginglyph("S", (2wh));
  z1=(leftloc,1/2wibs);                 % left wing
  wingl(1, wiht, wibs); fill pth1;
  z2=(x1+wiht,y1);                      % right wing
  wingl(2, wiht, wibs); fill pth2;
  z3trl=(leftloc,h);                    % pin
  trir(3, trht, trbs); fill pth3;
  z3'=(rightloc,y3); draw z3tic--z3';
  labels(1,2,3);
endchar;

cmchar "Old Persian syllable za (z)";
beginglyph("z", (4tb));
  z1trr=(leftloc,h);                    % left pin
  trid(1, trht, trbs); fill pth1;
  z1'=(x1,0); draw z1tic--z1';
  z2trl=(rightloc,h);                    % right pin
  trid(2, trht, trbs); fill pth2;
  z2'=(x2,0); draw z2tic--z2';
  z11trc=(x1trl,h/2);                    % hor pins
  trir(11, trht, trbs); fill pth11;
  z11'=(x2trr,y11); draw z11tic--z11';
  z12trc=1/2[z11trc,z11'];
  trir(12, trht, trbs); fill pth12;
  labels(1,2,11);
endchar;

cmchar "Old Persian syllable ha (h)";
beginglyph("h", (2tb+2wh));
  z1=(leftloc,h/2);                % left wing
  wingl(1, wiht, wibs); fill pth1;
  z2=(rightloc-wiht,y1);            % right wing
  wingl(2, wiht, wibs); fill pth2;
  z11trr=(x1wil,y1);                % top pin
  trir(11, trht, trbs); fill pth11;
  z11'=(x2,y11); draw z11tic--z11';
  z12trl=z11trr;                    % bottom pin
  trir(12, trht, trbs); fill pth12;
  z12'=(x2,y12); draw z12tic--z12';
  labels(1,2,11,12);
endchar;

cmchar "Old Persian word: king (X)";
beginglyph("X", (3tb+2wh));
  z4=(rightloc-wiht, h/2);                  % right wing
  wingl(4, wiht, wibs); fill pth4;
  z11trc=(x4,h);                           % center vert pin
  trid(11, trht, trbs); fill pth11;
  z11'=(x11,0); draw z11tic--z11';
  z3wir=(x11trr,y4wir);                    % left wing
  wingl(3, wiht, wibs); fill pth3;
  z1trr=(leftloc,y4);                      % top pin
  trir(1, trht, trbs); fill pth1;
  z1'=(x3,y1); draw z1tic--z1';
  z2trl=z1trr;                             % bottom pin
  trir(2, trht, trbs); fill pth2;
  z2'=(x1',y2); draw z2tic--z2';
  labels(1,2,3,4,11);
endchar;

cmchar "Old Persian word: country (version a) (q)";
beginglyph("q", (9/4tb+wh));  %% 5/2tb+wh too large
  numeric n[];
  n1 := 1/2wiht;
  n2 := 1/2wibs;
  z12trl=(rightloc,h);                    % right pin
  trid(12, trht, trbs); fill pth12;
  z12'=(x12,0); draw z12tic--z12';
  z11trl=z12trr;                          % left pin
  trid(11, trht, trbs); fill pth11;
  z11'=(x11,0); draw z11tic--z11';
  z1=(leftloc, h-1/2n2);                  % top left wing
  wingl(1, n1, n2); fill pth1;
  z2=(x1wil, y1);                         % top right wing
  wingl(2, n1, n2); fill pth2;
  z3=(x1, 1/2n2);                         % bottom left wing
  wingl(3, n1, n2); fill pth3;
  z4=(x2, y3);                            % bottom right wing
  wingl(4, n1, n2); fill pth4;
  labels(1,2,3,4,11,12);
endchar;

cmchar "Old Persian word: country (version b) (Q)";
beginglyph("Q", (5/4tb+wh));  %% 3/2tb+wh too large
  numeric n[];
  n1 := 1/2wiht;
  n2 := 1/2wibs;
  z11trl=(rightloc,h);                    % right pin
  trid(11, trht, trbs); fill pth11;
  z11'=(x11,0); draw z11tic--z11';
  z1=(leftloc, h-1/2n2);                  % top left wing
  wingl(1, n1, n2); fill pth1;
  z2=(x1wil, y1);                         % top right wing
  wingl(2, n1, n2); fill pth2;
  z3=(x1, 1/2n2);                         % bottom left wing
  wingl(3, n1, n2); fill pth3;
  z4=(x2, y3);                            % bottom right wing
  wingl(4, n1, n2); fill pth4;
  labels(1,2,3,4,11,12);
endchar;

cmchar "Old Persian word: earth (L)";
beginglyph("L", (3wh));
  z1=(leftloc, wiht);              % left wing
  wingl(1, wiht, wibs); fill pth1;
  z2=(x1wil, y1);                  % center wing
  wingl(2, wiht, wibs); fill pth2;
  z3=(x2wil, y1);                  % right wing
  wingl(3, wiht, wibs); fill pth3;
  z11trr=(x1,y1wir);               % top pin
  trir(11, trht, trbs); fill pth11;
  z11'=(rightloc,y11); draw z11tic--z11';
  z12trc=(x2,y11);
  trir(12, trht, trbs); fill pth12;
  z13trc=(x3,y11);
  trir(13, trht, trbs); fill pth13;
  labels(1,2,3,11,12,13);
endchar;

cmchar "Old Persian word: god (B)";
beginglyph("B", (2tb+2wh));
  z4=(rightloc-wiht, h/2);       % right wing
  wingl(4, wiht, wibs); fill pth4;
  z3=(x4-wiht, y4);              % left wing
  wingl(3, wiht, wibs); fill pth3;
  z1trc=(leftloc,y4);            % pin
  trir(1, trht, trbs); fill pth1;
  z1'=z3; draw z1tic--z1';
  z2trc=1/2[z1trc,z1'];
  trir(2, trht, trbs); fill pth2;
  labels(1,2,3,4);
endchar;

cmchar "Old Persian word: Auramazda (version a) (e)";
beginglyph("e", (3tb+wh));
  z43=(rightloc-wiht, h/2);       % wing
  wingl(43, wiht, wibs); fill pth43;
  z46trc=(x43,h);                 % vert pin
  trid(46, trht, trbs); fill pth46;
  z46'=(x46,0); draw z46tic--z46';
  z14trr=(leftloc,h/2);           % pin 3
  trir(14, trht, trbs); fill pth14;
  z14'=(x46,y14); draw z14tic--z14';
  z24trc=1/2[z14trc,z14']; z34trc=2/3[z14trc,z14'];
  trir(24, trht, trbs); fill pth24;

  z12trl=z14trr;                  % pin 2
  trir(12, trht, trbs); fill pth12;
  z12'=(x46,y12); draw z12tic--z12';
  z22=(x24,y12); z32=(x34,y12);
  trir(22, trht, trbs); fill pth22;

  labels(12,14,21,22,23,24,25,31,32,33,34,35,41,42,43,44,45,46);
endchar;

cmchar "Old Persian word: Auramazda (version b) (E)";
beginglyph("E", (4tb));
%%  z43=(rightloc-wiht, h/2);       % wing
%%  wingl(43, wiht, wibs); fill pth43;
  z46trc=(rightloc,h+trht);                 % vert pin
  trid(46, trht, trbs); fill pth46;
  z46'=(x46,-1/2trbs); draw z46tic--z46';
  z14trr=(leftloc,h/2);           % pin 3
  trir(14, trht, trbs); fill pth14;
  z14'=(x46,y14); draw z14tic--z14';
  z24trc=1/3[z14trc,z14']; z34trc=2/3[z14trc,z14'];
  trir(24, trht, trbs); fill pth24;
  trir(34, trht, trbs); fill pth34;

  z12trl=z14trr;                  % pin 2
  trir(12, trht, trbs); fill pth12;
  z12'=(x46,y12); draw z12tic--z12';
  z22=(x24,y12); z32=(x34,y12);
  trir(22, trht, trbs); fill pth22;
  trir(32, trht, trbs); fill pth32;

  z21trl=(x24trc, y12trr);        % pin 1
  trir(21, trht, trbs); fill pth21;
  z21'=(x46,y21); draw z21tic--z21';
  z31=(x34,y21);
  trir(31, trht, trbs); fill pth31;

  z25trr=(x24trc, y14trl);        % pin 4
  trir(25, trht, trbs); fill pth25;
  z25'=(x46,y25); draw z25tic--z25';
  z35=(x34,y25);
  trir(35, trht, trbs); fill pth35;
  labels(12,14,21,22,23,24,25,31,32,33,34,35,41,42,43,44,45,46);
endchar;

cmchar "Old Persian word: Auramazda (version c) (F)";
beginglyph("F", (4tb+wh));
  z43=(rightloc-wiht, h/2);       % wing
  wingl(43, wiht, wibs); fill pth43;
  z46trc=(x43,h+trht);                 % vert pin
  trid(46, trht, trbs); fill pth46;
  z46'=(x46,-1/2trbs); draw z46tic--z46';
  z14trr=(leftloc,y43);           % pin 3
  trir(14, trht, trbs); fill pth14;
  z14'=(x46,y14); draw z14tic--z14';
  z24trc=1/3[z14trc,z14']; z34trc=2/3[z14trc,z14'];
  trir(24, trht, trbs); fill pth24;
  trir(34, trht, trbs); fill pth34;

  z12trl=z14trr;                  % pin 2
  trir(12, trht, trbs); fill pth12;
  z12'=(x46,y12); draw z12tic--z12';
  z22=(x24,y12); z32=(x34,y12);
  trir(22, trht, trbs); fill pth22;
  trir(32, trht, trbs); fill pth32;

  z21trl=(x24trc, y12trr);        % pin 1
  trir(21, trht, trbs); fill pth21;
  z21'=(x46,y21); draw z21tic--z21';
  z31=(x34,y21);
  trir(31, trht, trbs); fill pth31;

  z25trr=(x24trc, y14trl);        % pin 4
  trir(25, trht, trbs); fill pth25;
  z25'=(x46,y25); draw z25tic--z25';
  z35=(x34,y25);
  trir(35, trht, trbs); fill pth35;
  labels(12,14,21,22,23,24,25,31,32,33,34,35,41,42,43,44,45,46);
endchar;

cmchar "Old Persian numeral 1 (1)";
beginglyph("1", (tb));
  z1trc=(midloc,h);
  trid(1, trht, trbs); fill pth1;
  z1'=(x1,0); draw z1tic--z1';
  labels(1,2);
endchar;

cmchar "Old Persian numeral 2 (2)";
beginglyph("2", (tb));
  z1trc=(midloc,h);
  trid(1, trht, trbs); fill pth1;
  z1'=(x1,0); draw z1tic--z1';
  z2trc=1/2[z1trc,z1'];
  trid(2, trht, trbs); fill pth2;
  labels(1,2);
endchar;

cmchar "Old Persian numeral 10 (3)";
beginglyph("3", (wh));
  z1=(leftloc,h/2);
  wingl(1, wiht, wibs); fill pth1;
  labels(1,2);
endchar;

cmchar "Old Persian numeral 20 (4)";
beginglyph("4", (1/2wh));
  z1=(leftloc,3/4h);
  wingl(1, 1/2wiht, 1/2wibs); fill pth1;
  z2=(leftloc,1/4h);
  wingl(2, 1/2wiht, 1/2wibs); fill pth2;
  labels(1,2);
endchar;

cmchar "Old Persian numeral 100 (5)";
beginglyph("5", (tb+2th));
  z1trl=(leftloc,h);                   % top pins
  trir(1, trht, trbs); fill pth1;
  z2trr=(rightloc,h);
  tril(2, trht, trbs); fill pth2;
  draw z1tic--z2tic;
  z11trc=(1/2[x1,x2],y1trr);           % vertical pin
  trid(11, trht, trbs); fill pth11;
  z11'=(x11,0); draw z11tic--z11';
  labels(1,2,11);
endchar;

cmchar "Old Persian word divider (:)";
beginglyph(":", (3tb));
  numeric alpha;
  alpha := trbs;
  z1=(leftloc+alpha, h-alpha);
  z2=(rightloc-alpha, alpha);
  triangle(1, trht, trbs, angle((z2-z1)));
  fill pth1; draw z1tic--z2;
  labels(1,2);
endchar;

end

