%%% fontinst-file:  zdcompgl.mtx
%%% version:        1.0a
%%% date:           94/08/08
%%% author:         Constantin Kahn <kahn@math.uni-hannover.de>
%%% abstract:       This file defines compound glyphs for fake dc fonts.
%%%	                Almost everything in here has been lifted from Alan
%%%                 Jeffrey's latin.mtx. We use \resetglyph commands here
%%%                 for most of the compound glyphs because many of them
%%%                 may have been defined already by a prviously read in
%%%                 PostScript font.

\relax

\metrics

% Uses the fontinst package.

\needsfontinstversion{1.332}

% A top accent is set by placing the center of the accent at the given 
% position along the width of the letter, raised up by the difference 
% between the height of the letter and the xheight. This command takes a
% possible height-adjustment of the accent into account.

\setcommand\topaccent#1#2#3{
   \push
      \moveup{\add{\sub{\height{dc-\glyphname}}{\height{#2}}}{\int{#2-up}}}
      \movert{\add{\sub{\scale{\width{#1}}{#3}}{\scale{\width{#2}}{500}}}
         {\scale{\sub{\height{dc-\glyphname}}{\height{#2}}}
                {\int{italicslant}}}}
      \glyph{#2}{1000}
   \pop
   \glyph{#1}{1000}
}

% A bottom accent is set by placing the center of the accent at the given 
% position along the width of the letter. This command takes a possible
% height-adjustment of the accent into account.

\setcommand\botaccent#1#2#3{
   \push
      \moveup{\add{\sub{\depth{#2}}{\depth{dc-\glyphname}}}{\int{#2-up}}}
      \movert{\sub{\scale{\width{#1}}{#3}}{\scale{\width{#2}}{500}}}
      \glyph{#2}{1000}
   \pop
   \glyph{#1}{1000}
}

% In this context an unfakable glyph is simply a black box with the
% dimensions of the corresponding dc-glyph

\setcommand\unfakable#1{
   \setglyph{#1}
      \moveup{\neg{\depth{dc-#1}}}
      \glyphrule{\width{dc-#1}}{\add{\depth{dc-#1}}{\height{dc-#1}}}
      \resetitalic{\italic{dc-#1}}
      \moveup{\depth{dc-#1}}
      \glyphwarning{missing glyph `#1'}
   \endsetglyph
}

\comment{\section{Default values}}

\setint{quoteasymmetry}{0}
\setint{quotedblasymmetry}{250}

\setint{guilsidebearing}{30}

\setint{grave-up}{0}
\setint{acute-up}{0}
\setint{circumflex-up}{0}
\setint{tilde-up}{0}
\setint{dieresis-up}{0}
\setint{hungarumlaut-up}{0}
\setint{ring-up}{0}
\setint{caron-up}{0}
\setint{breve-up}{0}
\setint{macron-up}{0}
\setint{dotaccent-up}{0}
\setint{cedilla-up}{0}
\setint{ogonek-up}{0}

\setint{ogonek-rt}{50}

\setint{A-ring-closeup}{30}
\setint{T-cedilla-up}{20}

\setint{Lcaron-corr}{0}
\setint{dcaron-corr}{0}
\setint{lcaron-corr}{0}
\setint{tcaron-corr}{0}

\setint{Lslash-corr}{0}
\setint{lslash-corr}{0}

\ifisint{monowidth}\then
   \setint{Eth-pos}{350}
\else
   \setint{Eth-pos}{600}
\fi

\setint{Aogonek-pos}{900}
\setint{Eogonek-pos}{850}
\setint{aogonek-pos}{850}
\ifisint{cscfont}\then
  \setint{eogonek-pos}{850}
\else
  \setint{eogonek-pos}{500}
\fi

\comment{\section{Unfakable glyphs}}

\unfakable{perthousandzero}
\unfakable{thorn}
\unfakable{Thorn}
\unfakable{ng}
\unfakable{Ng}

\comment{\section{Glyphs}}

\resetglyph{ring}
   \glyph{ringfitted}{1000}
\endsetglyph

\resetglyph{ogonek}
   \movert{\int{ogonek-rt}}
   \moveup{\neg{\height{ogonek}}}
   \glyph{ogonek}{1000}
   \moveup{\height{ogonek}}
   \movert{\neg{\int{ogonek-rt}}}
\endsetglyph

% Dirty trick to get vertical positioning of ogonek (from PS font) right

\resetint{ogonek-up}
   {\add{\int{ogonek-up}}{\sub{\depth{dc-ogonek}}{\depth{ogonek}}}}

% We add sidebearings to guillemets

\resetglyph{guilsinglleft}
   \movert{\int{guilsidebearing}}
   \glyph{guilsinglleft}{1000}
   \movert{\int{guilsidebearing}}
\endresetglyph

\resetglyph{guilsinglright}
   \movert{\int{guilsidebearing}}
   \glyph{guilsinglright}{1000}
   \movert{\int{guilsidebearing}}
\endresetglyph

\resetglyph{guillemotleft}
   \movert{\int{guilsidebearing}}
   \glyph{guillemotleft}{1000}
   \movert{\int{guilsidebearing}}
\endresetglyph

\resetglyph{guillemotright}
   \movert{\int{guilsidebearing}}
   \glyph{guillemotright}{1000}
   \movert{\int{guilsidebearing}}
\endresetglyph

\setglyph{compwordmark}
   \movert{0}
\endsetglyph
\setint{compwordmark-spacing}{0}

\resetglyph{quotedbl}
   \moveup{\sub{\height{dc-quotedbl}}{\height{quotedbl}}}
   \glyph{quotedbl}{1000}
   \moveup{\neg{\sub{\height{dc-quotedbl}}{\height{quotedbl}}}}
\endsetglyph

\resetglyph{quotesinglbase}
   \movert{\scale{\width{quoteright}}{\int{quoteasymmetry}}}
   \moveup{\sub{\height{dc-quotesinglbase}}{\height{quoteright}}}
   \glyph{quoteright}{1000}
   \moveup{\neg{\sub{\height{dc-quotesinglbase}}{\height{quoteright}}}}
   \movert{\neg{\scale{\width{quoteright}}{\int{quoteasymmetry}}}}
   \resetdepth{\depth{dc-quotesinglbase}}
   \resetitalic{\italic{dc-quotesinglbase}}
\endsetglyph

\resetglyph{quotedblbase}
   \movert{\scale{\width{quotedblright}}{\int{quotedblasymmetry}}}
   \moveup{\sub{\height{comma}}{\height{quotedblright}}}
   \glyph{quotedblright}{1000}
   \moveup{\neg{\sub{\height{dc-quotedblbase}}{\height{quotedblright}}}}
   \movert{\neg{\scale{\width{quotedblright}}{\int{quotedblasymmetry}}}}
   % in the following command we refer to dc-quotesinglbase because
   % dc-quotedblbase has zero depth (in dcr10 at least) which is wrong:
   \resetdepth{\depth{dc-quotesinglbase}}
   \resetitalic{\italic{dc-quotedblbase}}
\endsetglyph

\setglyph{fi}
   \glyph{f}{1000}
   \movert{\kerning{f}{i}}
   \glyph{i}{1000}
\endsetglyph

\setglyph{ff}
   \glyph{f}{1000}
   \movert{\kerning{f}{f}}
   \glyph{f}{1000}
\endsetglyph

\setglyph{fl}
   \glyph{f}{1000}
   \movert{\kerning{f}{l}}
   \glyph{l}{1000}
\endsetglyph

\setglyph{ffi}
   \glyph{f}{1000}
   \movert{\kerning{f}{f}}
   \glyph{fi}{1000}
\endsetglyph

\setglyph{ffl}
   \glyph{f}{1000}
   \movert{\kerning{f}{f}}
   \glyph{fl}{1000}
\endsetglyph

\setglyph{hyphenchar}
   \glyph{hyphen}{1000}
\endsetglyph

\ifisint{monowidth}\then

\ifisint{cscfont}\then

\resetglyph{lslash}
   \moveup{\div{\sub{\height{l}}{\height{L}}}{2}}
   \movert{\scale{\width{lslashslash}}{\int{lslash-corr}}}
   \glyph{lslashslash}{1000}
   \movert{\neg{\scale{\width{lslashslash}}
                      {\add{1000}{\int{lslash-corr}}}}}
   \moveup{\neg{\div{\sub{\height{l}}{\height{L}}}{2}}}
   \glyph{l}{1000}
   \resetdepth{\depth{dc-lslash}}
\endsetglyph

\else

\resetglyph{lslash}
   \movert{\add{\div{\sub{\width{l}}{\width{lslashslash}}}{2}}
               {\scale{\width{lslashslash}}{\int{lslash-corr}}}}
   \glyph{lslashslash}{1000}
   \movert{\neg{\add{\div{\sub{\width{l}}{\width{lslashslash}}}{2}}
             {\scale{\width{lslashslash}}{\add{1000}{\int{lslash-corr}}}}}}
   \glyph{l}{1000}
\endsetglyph

\fi
   
\resetglyph{Lslash}
   \movert{\scale{\width{lslashslash}}{\int{Lslash-corr}}}
   \glyph{lslashslash}{1000}
   \movert{\neg{\scale{\width{lslashslash}}{\add{1000}{\int{Lslash-corr}}}}}
   \glyph{L}{1000}
\endsetglyph

\else

\ifisint{cscfont}\then

\resetglyph{lslash}
   \moveup{\div{\sub{\height{l}}{\height{L}}}{2}}
   \movert{\scale{\width{lslashslash}}{\int{lslash-corr}}}
   \glyph{lslashslash}{1000}
   \movert{\sub{\kerning{lslashslash}{l}}
               {\scale{\width{lslashslash}}{\int{lslash-corr}}}}
   \moveup{\neg{\div{\sub{\height{l}}{\height{L}}}{2}}}
   \glyph{l}{1000}
   \resetdepth{\depth{dc-lslash}}
\endsetglyph

\else

\resetglyph{lslash}
   \movert{\scale{\width{lslashslash}}{\int{lslash-corr}}}
   \glyph{lslashslash}{1000}
   \movert{\sub{\kerning{lslashslash}{l}}
               {\scale{\width{lslashslash}}{\int{lslash-corr}}}}
   \glyph{l}{1000}
\endsetglyph

\fi
   
\resetglyph{Lslash}
   \movert{\add{\neg{\add{\width{lslashslash}}{\kerning{lslashslash}{L}}}}
               {\scale{\width{lslashslash}}{\int{Lslash-corr}}}}
   \glyph{lslashslash}{1000}
   \movert{\sub{\kerning{lslashslash}{L}}
               {\scale{\width{lslashslash}}{\int{Lslash-corr}}}}
   \glyph{L}{1000}
\endsetglyph

\fi

\resetglyph{Abreve}
   \topaccent{A}{breve}{500}
\endsetglyph

\resetglyph{Aogonek}
   \botaccent{A}{ogonek}{\int{Aogonek-pos}}
\endsetglyph

\resetglyph{Cacute}
   \topaccent{C}{acute}{500}
\endsetglyph

\resetglyph{Ccaron}
   \topaccent{C}{caron}{500}
\endsetglyph

\resetglyph{Dcaron}
   \topaccent{D}{caron}{450}
\endsetglyph

\resetglyph{Ecaron}
   \topaccent{E}{caron}{500}
\endsetglyph

\resetglyph{Eogonek}
   \botaccent{E}{ogonek}{\int{Eogonek-pos}}
\endsetglyph

\resetglyph{Gbreve}
   \topaccent{G}{breve}{500}
\endsetglyph

\resetglyph{Lacute}
   \topaccent{L}{acute}{450} % `250' would be better, but this is dc style
\endsetglyph

\resetglyph{Lcaron}
   \glyph{L}{1000}
   \push
   \movert{\scale{\width{quoteright}}{\sub{\int{Lcaron-corr}}{1100}}}
   \glyph{quoteright}{1000}
   \pop
\endsetglyph

\resetglyph{Nacute}
   \topaccent{N}{acute}{500}
\endsetglyph

\resetglyph{Ncaron}
   \topaccent{N}{caron}{500}
\endsetglyph

\resetglyph{Ohungarumlaut}
   \topaccent{O}{hungarumlaut}{500}
\endsetglyph

\resetglyph{Racute}
   \topaccent{R}{acute}{500}
\endsetglyph

\resetglyph{Rcaron}
   \topaccent{R}{caron}{500}
\endsetglyph

\resetglyph{Sacute}
   \topaccent{S}{acute}{500}
\endsetglyph

\resetglyph{Scaron}
   \topaccent{S}{caron}{500}
\endsetglyph

\resetglyph{Scedilla}
   \botaccent{S}{cedilla}{500}
\endsetglyph

\resetglyph{Tcaron}
   \topaccent{T}{caron}{500}
\endsetglyph

% BEGIN_UGLY_HACK
\resetint{cedilla-up}{\add{\int{cedilla-up}}{\int{T-cedilla-up}}}

\resetglyph{Tcedilla}
   \botaccent{T}{cedilla}{460}
\endsetglyph

\resetint{cedilla-up}{\sub{\int{cedilla-up}}{\int{T-cedilla-up}}}
% END_UGLY_HACK

\resetglyph{Uhungarumlaut}
   \topaccent{U}{hungarumlaut}{500}
\endsetglyph

\resetglyph{Uring}
   \topaccent{U}{ring}{500}
\endsetglyph

\resetglyph{Ydieresis}
   \topaccent{Y}{dieresis}{500}
\endsetglyph

\resetglyph{Zacute}
   \topaccent{Z}{acute}{500}
\endsetglyph

\resetglyph{Zcaron}
   \topaccent{Z}{caron}{500}
\endsetglyph

\resetglyph{Zdotaccent}
   \topaccent{Z}{dotaccent}{500}
\endsetglyph

\resetglyph{IJ}
   \glyph{I}{1000}
   \movert{\kerning{I}{J}}
   \glyph{J}{1000}
\endsetglyph

\resetglyph{Idotaccent}
   \topaccent{I}{dotaccent}{500}
\endsetglyph

\ifisint{cscfont}\then

\resetglyph{dbar}
   \push
      \movert{\add{\sub{\scale{\width{i}}{\int{Eth-pos}}}
                       {\div{\width{macron}}{2}}}
                  {\scale{\sub{\div{\height{d}}{2}}{\height{macron}}}
                           {\int{italicslant}}}}
      \moveup{\sub{\div{\height{d}}{2}}{\height{macron}}}
      \glyph{macron}{1000}
   \pop
   \glyph{d}{1000}
   \resetdepth{\depth{dc-dbar}}
\endsetglyph

\else

\resetglyph{dbar}
   \push
      \movert{\sub{\width{d}}{\scale{\width{macron}}{925}}}
      \moveup{\sub{\div{\add{\height{d}}{\height{x}}}{2}}{\height{macron}}}
      \glyph{macron}{1000}
   \pop
   \glyph{d}{1000}
   \resetdepth{\depth{dc-dbar}}
\endsetglyph

\fi

\resetglyph{abreve}
   \topaccent{a}{breve}{500}
\endsetglyph

\resetglyph{aogonek}
   \botaccent{a}{ogonek}{\int{aogonek-pos}}
\endsetglyph

\resetglyph{cacute}
   \topaccent{c}{acute}{500}
\endsetglyph

\resetglyph{ccaron}
   \topaccent{c}{caron}{500}
\endsetglyph

\resetglyph{dcaron}
   \ifisint{cscfont}\then
      \topaccent{d}{caron}{500}
   \else
      \glyph{d}{1000}
      \movert{\sub{\width{dc-dcaron}}{\width{d}}}
      \push
      \movert{\scale{\width{quoteright}}{\sub{\int{dcaron-corr}}{800}}}
      \glyph{quoteright}{1000}
      \pop
   \fi
\endsetglyph

\resetglyph{ecaron}
   \topaccent{e}{caron}{500}
\endsetglyph


\resetglyph{eogonek}
   \botaccent{e}{ogonek}{\int{eogonek-pos}}
\endsetglyph

\resetglyph{gbreve}
   \topaccent{g}{breve}{500}
\endsetglyph

\resetglyph{lacute}
   \topaccent{l}{acute}{500}
\endsetglyph

\resetglyph{lcaron}
   \glyph{l}{1000}
   \movert{\sub{\width{dc-lcaron}}{\width{l}}}
   \push
   \moveup{\sub{\height{l}}{\height{quoteright}}}
   \movert{\scale{\width{quoteright}}{\sub{\int{lcaron-corr}}{850}}}
   \glyph{quoteright}{1000}
   \pop
\endsetglyph

\resetglyph{nacute}
   \topaccent{n}{acute}{500}
\endsetglyph

\resetglyph{ncaron}
   \topaccent{n}{caron}{500}
\endsetglyph

\resetglyph{ohungarumlaut}
   \topaccent{o}{hungarumlaut}{500}
\endsetglyph

\resetglyph{racute}
   \topaccent{r}{acute}{500}
\endsetglyph

\resetglyph{rcaron}
   \topaccent{r}{caron}{500}
\endsetglyph

\resetglyph{sacute}
   \topaccent{s}{acute}{500}
\endsetglyph

\resetglyph{scaron}
   \topaccent{s}{caron}{500}
\endsetglyph

\resetglyph{scedilla}
   \botaccent{s}{cedilla}{500}
\endsetglyph

\resetglyph{tcaron}
   \ifisint{cscfont}\then
      \topaccent{t}{caron}{500}
   \else
      \glyph{t}{1000}
      \movert{\sub{\width{dc-tcaron}}{\width{t}}}
      \push
      \movert{\scale{\width{quoteright}}{\sub{\int{tcaron-corr}}{800}}}
      \glyph{quoteright}{1000}
      \pop
   \fi
\endsetglyph

\resetglyph{tcedilla}
   \botaccent{t}{cedilla}{480}
\endsetglyph

\resetglyph{uhungarumlaut}
   \topaccent{u}{hungarumlaut}{500}
\endsetglyph

\resetglyph{uring}
   \topaccent{u}{ring}{500}
\endsetglyph

\resetglyph{ydieresis}
   \topaccent{y}{dieresis}{500}
\endsetglyph

\resetglyph{zacute}
   \topaccent{z}{acute}{500}
\endsetglyph

\resetglyph{zcaron}
   \topaccent{z}{caron}{500}
\endsetglyph

\resetglyph{zdotaccent}
   \topaccent{z}{dotaccent}{500}
\endsetglyph

\resetglyph{ij}
   \glyph{i}{1000}
   \movert{\kerning{i}{j}}
   \glyph{j}{1000}
\endsetglyph

\resetglyph{Agrave}
   \topaccent{A}{grave}{500}
\endsetglyph

\resetglyph{Aacute}
   \topaccent{A}{acute}{500}
\endsetglyph

\resetglyph{Acircumflex}
   \topaccent{A}{circumflex}{500}
\endsetglyph

\resetglyph{Atilde}
   \topaccent{A}{tilde}{500}
\endsetglyph

\resetglyph{Adieresis}
   \topaccent{A}{dieresis}{500}
\endsetglyph

% BEGIN_UGLY_HACK
\resetint{ring-up}{\sub{\int{ring-up}}{\int{A-ring-closeup}}} 

\resetglyph{Aring}
   \topaccent{A}{ring}{500}
\endsetglyph

\resetint{ring-up}{\add{\int{ring-up}}{\int{A-ring-closeup}}} 
% END_UGLY_HACK

\resetglyph{Ccedilla}
   \botaccent{C}{cedilla}{500}
\endsetglyph

\resetglyph{Egrave}
   \topaccent{E}{grave}{500}
\endsetglyph

\resetglyph{Eacute}
   \topaccent{E}{acute}{500}
\endsetglyph

\resetglyph{Ecircumflex}
   \topaccent{E}{circumflex}{500}
\endsetglyph

\resetglyph{Edieresis}
 \topaccent{E}{dieresis}{500}
\endsetglyph

\resetglyph{Iacute}
   \topaccent{I}{acute}{500}
\endsetglyph

\resetglyph{Igrave}
   \topaccent{I}{grave}{500}
\endsetglyph

\resetglyph{Icircumflex}
   \topaccent{I}{circumflex}{500}
\endsetglyph

\resetglyph{Idieresis}
   \topaccent{I}{dieresis}{500}
\endsetglyph

\resetglyph{Eth}
   \push
      \movert{\add{\sub{\scale{\width{I}}{\int{Eth-pos}}}
                       {\div{\width{macron}}{2}}}
                  {\scale{\sub{\div{\height{D}}{2}}{\height{macron}}}
                           {\int{italicslant}}}}
      \moveup{\sub{\div{\height{D}}{2}}{\height{macron}}}
      \glyph{macron}{1000}
   \pop
   \glyph{D}{1000}
   \resetdepth{\depth{dc-Eth}}
\endsetglyph

\resetglyph{Ntilde}
   \topaccent{N}{tilde}{500}
\endsetglyph

\resetglyph{Ograve}
   \topaccent{O}{grave}{500}
\endsetglyph

\resetglyph{Oacute}
   \topaccent{O}{acute}{500}
\endsetglyph

\resetglyph{Ocircumflex}
   \topaccent{O}{circumflex}{500}
\endsetglyph

\resetglyph{Otilde}
   \topaccent{O}{tilde}{500}
\endsetglyph

\resetglyph{Odieresis}
   \topaccent{O}{dieresis}{500}
\endsetglyph

\resetglyph{Ugrave}
   \topaccent{U}{grave}{500}
\endsetglyph

\resetglyph{Uacute}
   \topaccent{U}{acute}{500}
\endsetglyph

\resetglyph{Ucircumflex}
   \topaccent{U}{circumflex}{500}
\endsetglyph

\resetglyph{Udieresis}
   \topaccent{U}{dieresis}{500}
\endsetglyph

\resetglyph{Yacute}
   \topaccent{Y}{acute}{500}
\endsetglyph

\resetglyph{SS}
   \glyph{S}{1000}
   \movert{\kerning{S}{S}}
   \glyph{S}{1000}
\endsetglyph

\resetglyph{agrave}
   \topaccent{a}{grave}{500}
\endsetglyph

\resetglyph{aacute}
   \topaccent{a}{acute}{500}
\endsetglyph

\resetglyph{acircumflex}
   \topaccent{a}{circumflex}{500}
\endsetglyph

\resetglyph{atilde}
   \topaccent{a}{tilde}{500}
\endsetglyph

\resetglyph{adieresis}
   \topaccent{a}{dieresis}{500}
\endsetglyph

\resetglyph{aring}
   \topaccent{a}{ring}{500}
\endsetglyph

\resetglyph{ccedilla}
   \botaccent{c}{cedilla}{500}
\endsetglyph

\resetglyph{egrave}
   \topaccent{e}{grave}{500}
\endsetglyph

\resetglyph{eacute}
   \topaccent{e}{acute}{500}
\endsetglyph

\resetglyph{ecircumflex}
   \topaccent{e}{circumflex}{500}
\endsetglyph

\resetglyph{edieresis}
   \topaccent{e}{dieresis}{500}
\endsetglyph

\resetglyph{igrave}
   \topaccent{dotlessi}{grave}{500}
\endsetglyph

\resetglyph{iacute}
   \topaccent{dotlessi}{acute}{500}
\endsetglyph

\resetglyph{icircumflex}
   \topaccent{dotlessi}{circumflex}{500}
\endsetglyph

\resetglyph{idieresis}
   \topaccent{dotlessi}{dieresis}{500}
\endsetglyph

\ifisint{cscfont}\then

\resetglyph{eth}
   \glyph{dbar}{1000}
\endsetglyph

\else

\unfakable{eth}

\fi

\resetglyph{ntilde}
   \topaccent{n}{tilde}{500}
\endsetglyph

\resetglyph{ograve}
   \topaccent{o}{grave}{500}
\endsetglyph

\resetglyph{oacute}
   \topaccent{o}{acute}{500}
\endsetglyph

\resetglyph{ocircumflex}
   \topaccent{o}{circumflex}{500}
\endsetglyph

\resetglyph{otilde}
   \topaccent{o}{tilde}{500}
\endsetglyph

\resetglyph{odieresis}
   \topaccent{o}{dieresis}{500}
\endsetglyph

\resetglyph{ugrave}
   \topaccent{u}{grave}{500}
\endsetglyph

\resetglyph{uacute}
   \topaccent{u}{acute}{500}
\endsetglyph

\resetglyph{ucircumflex}
   \topaccent{u}{circumflex}{500}
\endsetglyph

\resetglyph{udieresis}
   \topaccent{u}{dieresis}{500}
\endsetglyph

\resetglyph{yacute}
   \topaccent{y}{acute}{500}
\endsetglyph

\endmetrics
