\relax

\metrics

\def\chartochar#1#2{\resetglyph{#2}
	\glyph{#1}{1000}\endsetglyph\unsetglyph{#1}}


\setcommand\renameto#1#2{\setglyph{#2}
  \glyph{#1}{1000}\endsetglyph \unsetglyph{#1}}

%% The alphabet, un-dagesh'ed...
\chartochar{quotesingle}{alef}
\chartochar{b}{vet}
\chartochar{g}{gimel}
\chartochar{d}{dalet}
\chartochar{h}{he}
\chartochar{w}{vav}
\chartochar{z}{zayin}
\chartochar{x}{het}
\chartochar{X}{tet}
\chartochar{y}{yod}
\chartochar{k}{khaf}
\chartochar{cent}{finalkhaf}
\chartochar{l}{lamed}
\chartochar{m}{mem}
\chartochar{sterling}{finalmem}
\chartochar{n}{nun}
\chartochar{section}{finalnun}
\chartochar{s}{samekh}
\chartochar{v}{ayin}
\chartochar{p}{phe}
\chartochar{bullet}{finalphe}
\chartochar{c}{tsadi}
\chartochar{paragraph}{finaltsadi}
\chartochar{q}{qof}
\chartochar{r}{resh}
\chartochar{S}{shin}
\chartochar{H}{shinrightdot}
\chartochar{W}{sinleftdot}
\chartochar{t}{sav}
\chartochar{bar}{paseq}
\chartochar{at}{specialone}
\chartochar{asciitilde}{specialtwo}
\chartochar{less}{specialthree}
\chartochar{greater}{specialfour}
\chartochar{edieresis}{specialfive}
\chartochar{iacute}{specialsix}
\chartochar{igrave}{specialseven}
\chartochar{icircumflex}{specialeight}
\chartochar{N}{specialnine}
\chartochar{ordfeminine}{specialten}
\chartochar{copyright}{finalpe}

%% Now for some additional final forms...
\chartochar{dieresis}{finalkaf}
\chartochar{germandbls}{finalkhafqamats}
\chartochar{registered}{finalnunqamats}
\chartochar{trademark}{finalkhafsheva}
\chartochar{notequal}{finalkafqamats}
\chartochar{Ugrave}{holam}

%% Now for the dagesh forms...
%% We lead off with some specialcases.
\setglyph{shuruk}
  \glyph{ring}{1000}
\endsetglyph

\setglyph{zayindagesh}
  \glyph{C}{1000}\movert{80}\glyph{zayin}{1000}
\endsetglyph

\setglyph{alefdagesh}
  \movert{175}
  \moveup{270}\glyph{C}{1000}\moveup{-270}
  \movert{-150}\glyph{alef}{1000}
  \movert{42}
\endsetglyph

%% Now for the regular dagesh forms.

\setcommand\dageshform#1#2{\setglyph{#1dagesh}
	\glyph{#2}{1000}\glyph{#1}{1000}
	\endsetglyph}

\setcommand\Cdagesh#1{\dageshform{#1}{C}}
\Cdagesh{yod}
\Cdagesh{tsadi}
\Cdagesh{finaltsadi}

\setcommand\Fdagesh#1{\dageshform{#1}{F}}
\Fdagesh{gimel}
\Fdagesh{nun}

\setcommand\Gdagesh#1{\dageshform{#1}{G}}
\Gdagesh{vet}\renameto{vetdagesh}{bet}
\Gdagesh{dalet}
\Gdagesh{he}
\Gdagesh{het}
\Gdagesh{khaf}\renameto{khafdagesh}{kaf}
\Gdagesh{mem}
\Gdagesh{samekh}
\Gdagesh{resh}
\Gdagesh{sav}\renameto{savdagesh}{tav}
\Gdagesh{finalmem}

\setcommand\Jdagesh#1{\dageshform{#1}{J}}
\Jdagesh{lamed}
\ifisglyph{bentlamed}\then
	\Jdagesh{bentlamed}
	\resetglyph{bentlamed}
		\glyph{bentlamed}{1000}
		\resetheight{890}
	\endsetglyph
	\resetglyph{bentlameddagesh}
		\glyph{bentlameddagesh}{1000}
		\resetheight{890}
	\endsetglyph
\fi
\Jdagesh{ayin}
\Jdagesh{qof}

\setcommand\Kdagesh#1{\dageshform{#1}{K}}
\Kdagesh{phe}\renameto{phedagesh}{pe}
\Kdagesh{shin}
\Kdagesh{sinleftdot}
\Kdagesh{shinrightdot}

\setcommand\Ldagesh#1{\dageshform{#1}{L}}
\Ldagesh{tet}

%% Now for special characters.
\chartochar{numbersign}{quoteright}
\chartochar{hyphen}{maqaf}
\chartochar{ampersand}{rafe}
\unsetglyph{endash}
\unsetglyph{emdash}
\chartochar{ntilde}{endash}
\chartochar{oacute}{emdash}

\resetglyph{rafe}
  \movert{\neg{180}}
  \movert{\neg{160}}
  \glyph{rafe}{1000}
  \movert{320}
\endsetglyph

\resetglyph{underscore}
	\moveup{\neg{\height{rafe}}}
	\glyph{rafe}{1000}
	\moveup{\height{rafe}}
\endsetglyph	

%% \resetglyph{hyphen}
%%   \glyph{asciitilde}{1000}
%% \endsetglyph

%% We start on the vowels.
\setglyph{qamats}
  \movert{110}\movert{-310}
  \glyph{A}{1000}
  \movert{310}
  \movert{120}
\endsetglyph

\setglyph{patah}
  \movert{-192}
  \glyph{a}{1000}
  \movert{430}
  %\resetwidth{180}
  \resetheight{0}
\endsetglyph

\setglyph{segol}
  \movert{-192}
  \glyph{e}{1000}
  \movert{430}
\endsetglyph  

\setglyph{qubuts}
  \movert{-192}
  \glyph{u}{1000}
  \movert{430}
\endsetglyph

\setglyph{tsere}
  \movert{-192}
  \glyph{E}{1000}
  \movert{430}
\endsetglyph

\setglyph{hiriq}
  \movert{-192}
  \movert{-73}
  \glyph{i}{1000}
  \movert{430}
  \resetwidth{90}
\endsetglyph

\setglyph{sheva}
  \movert{-480}\movert{290}
  \glyph{Atilde}{1000}
  \movert{92}
  \resetwidth{90}
\endsetglyph

\setglyph{meteg}
  \moveup{-320}
  \glyphrule{55}{240}
  \moveup{320}
\endsetglyph

\setglyph{holamdot}
  \glyph{O}{1000}
\endsetglyph

\setglyph{lamedholam}
   \movert{-150}
   \glyph{holamdot}{1000}
   \movert{150}
   \glyph{lamed}{1000}
   \resetheight{\height{lamed}}
\endsetglyph

\setglyph{lameddageshholam}
   \movert{-150}
   \glyph{holamdot}{1000}
   \movert{150}
   \glyph{lameddagesh}{1000}
   \resetheight{\height{lamed}}
\endsetglyph

\ifisglyph{bentlamed}\then
	\setglyph{bentlamedholam}
	   \movert{-150}
	   \glyph{holamdot}{1000}
	   \movert{150}
	   \glyph{bentlamed}{1000}
	   \resetheight{890}
	\endsetglyph
	\setglyph{bentlameddageshholam}
	   \movert{-150}
	   \glyph{holamdot}{1000}
	   \movert{150}
	   \glyph{bentlameddagesh}{1000}
	   \resetheight{890}
	\endsetglyph
\fi

\setglyph{alefsubdot}
	\glyph{alef}{1000}
	\movert{\neg{\div{\width{alef}}{2}}}
	\movert{-20}
	\moveup{160}\glyph{hiriq}{1000}
	\moveup{-160}
	\movert{\neg{\width{hiriq}}}
	\movert{20}
	\movert{\div{\width{alef}}{2}}
\endsetglyph

\setglyph{finalnundagesh}
  \glyph{C}{1000}
  \glyph{finalnun}{1000}
\endsetglyph

\setglyph{hatafpatah}
  \glyph{patah}{1000}\movert{45}
  \glyph{sheva}{1000}
\endsetglyph

\setglyph{hatafqamats}
  \glyph{qamats}{1000}\movert{45}
  \glyph{sheva}{1000}
\endsetglyph

\setglyph{hatafsegol}
  \glyph{segol}{1000}\movert{45}
  \glyph{sheva}{1000}
\endsetglyph

\setcommand\consonantvowel#1#2{
  \ifisglyph{#2}\then
     \setglyph{#1#2}
         \glyph{#1}{1000}\movert{45}
         \glyph{#2}{1000}
     \endsetglyph
  \fi}

\consonantvowel{meteg}{patah}
\consonantvowel{meteg}{segol}
\consonantvowel{meteg}{qamats}
\consonantvowel{meteg}{tsere}
\consonantvowel{meteg}{hiriq}
\consonantvowel{meteg}{sheva}

\setglyph{nullchar}
	\glyphrule{1}{1}
\endsetglyph

\endmetrics
