% Copyright 1997, 1998 Sebastian Rahtz,
% copyright 1998, 1999, 2003 the fontinst maintenance team and 
% any individual authors listed elsewhere in this file.  
% All rights reserved.
%
% This file is part of the fontinst system version 1.9.
% -----------------------------------------------------
%
% It may be distributed under the terms of the LaTeX Project Public
% License, as described in lppl.txt in the base LaTeX distribution.
% Either version 1.0 or, at your option, any later version.
%
%%% ====================================================================
%%%  @TeX-font-metrics-file{
%%%     author          = "Sebastian Rahtz and Ulrik Vieth and 
%%%                        Walter Schmidt and Lars Hellstr{\"o}m",
%%%     version         = "1.926",
%%%     date            = "2005-05-24",
%%%     time            = "22:30:49 +02:00",
%%%     filename        = "textcomp.mtx",
%%%     email           = "w-a-schmidt@arcor.de",
%%%     URL             = "http://www.tug.org/applications/fontinst/",
%%%     codetable       = "ISO/ASCII",
%%%     keywords        = "metrics, TeX, PostScript",
%%%     supported       = "yes",
%%%     abstract        = "This is a font metrics file, for use with the
%%%                        fontinst utility. It provides the defaults
%%%                        used to install the text companion glyphs.",
%%%     package         = "fontinst",
%%%     dependencies    = "fontinst.sty, fontdoc.sty",
%%%  }
%%% ====================================================================

\relax

\documentclass[twocolumn]{article}
\usepackage{fontdoc}[2002/06/30] %Just guessing.

\title{The \textsf{fontinst} text companion glyphs}
\author{Sebastian Rahtz\and Ulrik Vieth\and Walter Schmidt\and 
   Lars Hellstr\"om}
\date{Version 1.926}

\showbranches

\begin{document}
\maketitle

\section{Introduction}

This document describes the glyphs used by the \textsf{fontinst}
package when generating \TeX{} text companion fonts.

\metrics

\needsfontinstversion{1.917}

% \unfakable is a glyph which can't be faked.

\setcommand\unfakable#1{
   \setglyph{#1}
      \glyphrule{500}{500}
      \glyphwarning{missing glyph `#1'}
   \endsetglyph
}
% \unfakableaccent is similar, but has an ``accent position''
\setcommand\unfakableaccent#1{
   \setglyph{#1}
      \moveup{\add{\int{xheight}}{50}}
      \movert{\scale{\add{\int{xheight}}{50}}{\int{italicslant}}}
      \glyphrule{250}{\sub{\sub{\int{ascender}}{\int{xheight}}}{100}}
      \movert{\neg{\scale{\add{\int{xheight}}{50}}{\int{italicslant}}}}
      \glyphwarning{missing glyph `#1'}
   \endsetglyph
}

% \fakeglyph replaces glyph #1 by #2, if it exists.

\setcommand\fakeglyph#1#2{
   \ifisglyph{#2}\then
      \setglyph{#1}
         \glyph{#2}{1000}
      \endsetglyph
   \Fi
}


\begincomment
\section{Default values}
\endcomment

\setint{italicslant}{0}
\setint{xheight}{\height{x}}
\setint{capheight}{\height{A}}
\setint{ascender}{\height{d}}
\setint{descender}{\depth{g}}
\setint{underlinethickness}{40}

% Vertical symmetry axis. (WaS)
\setint{vaxis}{\scale{\sub{\height{parenleft}}{\depth{parenleft}}}{500}}


\begincomment
\section{Oldstyle numerals}
\endcomment

\unfakable{zerooldstyle}
\unfakable{oneoldstyle}
\unfakable{twooldstyle}
\unfakable{threeoldstyle}
\unfakable{fouroldstyle}
\unfakable{fiveoldstyle}
\unfakable{sixoldstyle}
\unfakable{sevenoldstyle}
\unfakable{eightoldstyle}
\unfakable{nineoldstyle}


\begincomment
\section{Capital accents}
\endcomment

\fakeglyph{capitalgrave}{grave}
\fakeglyph{capitalacute}{acute}
\fakeglyph{capitalcircumflex}{circumflex}
\fakeglyph{capitaltilde}{tilde}
\fakeglyph{capitaldieresis}{dieresis}
\fakeglyph{capitalhungarumlaut}{hungarumlaut}
\fakeglyph{capitalring}{ring}
\fakeglyph{capitalcaron}{caron}
\fakeglyph{capitalbreve}{breve}
\fakeglyph{capitalmacron}{macron}
\fakeglyph{capitaldotaccent}{dotaccent}
\fakeglyph{capitalcedilla}{cedilla}
\fakeglyph{capitalogonek}{ogonek}


\begincomment
\section{ASCII-style accents}
\endcomment

\ifisglyph{asciitilde}\then
   \setglyph{tildelow}
      \glyph{asciitilde}{1000}
   \endsetglyph
\Fi

\ifisglyph{grave}\then
   \setglyph{asciigrave}
      \glyph{grave}{1000}
   \endsetglyph
\Fi

\ifisglyph{breve}\then
   \setglyph{asciibreve}
      \glyph{breve}{1000}
   \endsetglyph
\Fi

\ifisglyph{acute}\then
   \setglyph{asciiacutedbl}
      \ifisint{monowidth}\then
         \glyph{acute}{1000}
         \glyph{acute}{1000}
      \Else
         \glyph{acute}{1000}
         \movert{\neg{\scale{\width{acute}}{333}}}
         \glyph{acute}{1000}
      \Fi
   \endsetglyph
\Fi

\ifisglyph{grave}\then
   \setglyph{asciigravedbl}
      \ifisint{monowidth}\then
         \glyph{grave}{1000}
         \glyph{grave}{1000}
      \Else
         \glyph{grave}{1000}
         \movert{\neg{\scale{\width{grave}}{333}}}
         \glyph{grave}{1000}
      \Fi
   \endsetglyph
\Fi

\ifisglyph{caron}\then
   \setglyph{asciicaron}
      \glyph{caron}{1000}
   \endsetglyph
\Fi

\ifisglyph{dieresis}\then
   \setglyph{asciidieresis}
      \glyph{dieresis}{1000}
   \endsetglyph
\Fi

\ifisglyph{macron}\then
   \setglyph{asciimacron}
      \glyph{macron}{1000}
   \endsetglyph
\Fi

\ifisglyph{acute}\then
   \setglyph{asciiacute}
      \glyph{acute}{1000}
   \endsetglyph
\Fi


\begincomment
\section{Glyphs}
\endcomment

\setglyph{capitalcompwordmark}
   \glyphrule{0}{\int{capheight}}
\endsetglyph
\setint{capitalcompwordmark-spacing}{0}

\setglyph{ascendercompwordmark}
   \glyphrule{0}{\int{ascender}}
\endsetglyph
\setint{ascendercompwordmark-spacing}{0}

% centers wrt/ vertical symmetry axis. (WaS)
\ifisglyph{asterisk}\then
   \resetglyph{asteriskcentered}
      \moveup{\neg{\sub
         {\scale{\sub{\height{asterisk}}{\depth{asterisk}}}{500}}
         {\int{vaxis}}
      }}
      \glyph{asterisk}{1000}
      \resetdepth{0}
   \endresetglyph
\Fi

% assumes that 2/3em = 667 and \width{endash} about 500
\ifisglyph{endash}\then
   \setglyph{twelveudash}
      \ifisint{monowidth}\then
         \glyph{hyphen}{1000}
         \glyph{hyphen}{1000}
      \Else
         \glyph{endash}{1000}
         \movert{\sub{667}{\mul{2}{\width{endash}}}}
         \glyph{endash}{1000}
         \comment{This assumes that \(2/3\,\mathrm{em} = 667\) and 
           that the leading of the \texttt{endash} is less than 
           \(333/4\).}
      \Fi
   \endsetglyph
\Fi

% assumes that 3/4em = 750 and \width{endash} = 500
\ifisglyph{endash}\then
   \setglyph{threequartersemdash}
      \ifisint{monowidth}\then
         \glyph{hyphen}{1000}
         \glyph{hyphen}{1000}
      \Else
         \glyph{endash}{1000}
         \movert{\sub{750}{\mul{2}{\width{endash}}}}
         \glyph{endash}{1000}
         \comment{This assumes that the leading of the 
           \texttt{endash} is less than \(250/4\).}
      \Fi
   \endsetglyph
\Fi

% questionable fakery, doesn't really work with all fonts
\ifisglyph{bracketleft}\then
   \setglyph{openbracketleft}
      \ifisint{monowidth}\then
         \glyph{bracketleft}{1000}
         \glyph{bracketleft}{1000}
      \Else
         \glyph{bracketleft}{1000}
         \movert{\neg{\scale{\width{bracketleft}}{666}}}
         \glyph{bracketleft}{1000}
         \comment{This is questionable fakery, which doesn't 
            really work with all fonts.}
      \Fi
   \endsetglyph
\Fi

% questionable fakery, doesn't really work with all fonts
\ifisglyph{bracketright}\then
   \setglyph{openbracketright}
      \ifisint{monowidth}\then
         \glyph{bracketright}{1000}
         \glyph{bracketright}{1000}
      \Else
         \glyph{bracketright}{1000}
         \movert{\neg{\scale{\width{bracketright}}{666}}}
         \glyph{bracketright}{1000}
         \comment{This is questionable fakery, which doesn't 
            really work with all fonts.}
      \Fi
   \endsetglyph
\Fi

% questionable fakery, doesn't really work with all fonts
\ifisglyph{bar}\then
   \setglyph{bardbl}
      \ifisint{monowidth}\then
         \glyph{bar}{1000}
         \glyph{bar}{1000}
      \Else
         \glyph{bar}{1000}
         \movert{\neg{\scale{\width{bar}}{333}}}
         \glyph{bar}{1000}
         \comment{This is questionable fakery, which doesn't 
            really work with all fonts.}
      \Fi
   \endsetglyph
\Fi

\ifareglyphs{degree,C}\then
   \setglyph{centigrade}
      \glyph{degree}{1000}
      \glyph{C}{1000}
      \resetitalic{\italic{C}}
   \endsetglyph
\Fi

\ifisglyph{Euro}\then
   \setglyph{euro}
      \glyph{Euro}{1000}
   \endsetglyph
\Else\ifisglyph{C}\then
   \setglyph{euro}
      \movert{50}
      \push
         \moveup{\half{\sub{\height{C}}{\depth{C}}}}
         \movert{\scale
            {\half{\sub{\height{C}}{\depth{C}}}}
            {\int{italicslant}}
         }
         \push
            \moveup{\scale{\int{underlinethickness}}{1500}}
            \glyphrule{\scale{\width{C}}{750}}{\int{underlinethickness}}
         \pop
         \moveup{\scale{\int{underlinethickness}}{-1500}}
         \glyphrule{\scale{\width{C}}{700}}{\int{underlinethickness}}
         \comment{That this bar is slightly shorter than the previous 
           is deliberate. That the two bars are not quite centered 
           around the vertical midpoint is also deliberate.}
      \pop
      \movert{50}
      \comment{This movement should be much larger for some fonts, 
        e.g. New Century Schoolbook Italic, but experiments indicate 
        that it is independent of the italic slant.}
      \glyph{C}{1000}
      \resetitalic{\italic{C}}
   \endsetglyph
\Fi\Fi

\ifareglyphs{question,exclam}\then
   \setglyph{interrobang}
      \push
        \movert{\add{\half{\sub{\width{question}}{\width{exclam}}}}{-50}}
        \comment{The extra $-50$ serves to separate the exclamation mark 
          from the right side of the question mark.}
        \glyph{exclam}{1000}
      \pop
      \glyph{question}{1000}
   \endsetglyph
\Fi
\ifareglyphs{questiondown,exclamdown}\then
   \setglyph{interrobangdown}
      \push
        \movert{\add
          {\half{\sub{\width{questiondown}}{\width{exclamdown}}}}
          {50}
        }
        \glyph{exclamdown}{1000}
      \pop
      \glyph{questiondown}{1000}
   \endsetglyph
\Fi


\begincomment
\section{Unfakable glyphs}
In general, every glyph is unfakable unless we know how to fake it.
\endcomment

\unfakableaccent{capitalgrave}                % 8r,8y
\unfakableaccent{capitalacute}                % 8r,8y
\unfakableaccent{capitalcircumflex}           % 8r,8y
\unfakableaccent{capitaltilde}                % 8r,8y
\unfakableaccent{capitaldieresis}             % 8r,8y
\unfakableaccent{capitalhungarumlaut}         % 8r,8y
\unfakableaccent{capitalring}                 % 8r,8y
\unfakableaccent{capitalcaron}                % 8r,8y
\unfakableaccent{capitalbreve}                % 8r,8y
\unfakableaccent{capitalmacron}               % 8r,8y
\unfakableaccent{capitaldotaccent}            % 8r,8y
\unfakable{capitalcedilla}              % 8r,8y
\unfakable{capitalogonek}               % 8r,8y
\unfakable{quotesinglbase}              % 8r,8y
\unfakable{quotedblbase}                % 8r,8y
\unfakable{twelveudash}                 % faked 8r,8x
\unfakable{threequartersemdash}         % 8x (Adobe)
\unfakable{arrowleft}
\unfakable{arrowright}
\unfakableaccent{tieaccentlowercase}
\unfakableaccent{tieaccentcapital}
\unfakableaccent{newtieaccentlowercase}
\unfakableaccent{newtieaccentcapital}
\unfakable{blank}
\unfakable{dollar}                      % 8r,8y
\unfakable{quotesingle}                 % 8r,8y
\unfakable{asteriskcentered}            % faked 8r,8y
\unfakable{comma}                       % 8r,8y
\unfakable{hyphendbl}
\unfakable{period}                      % 8r,8y
\unfakable{fraction}                    % 8r,8y
\unfakable{angbracketleft}
\unfakable{minus}                       % 8r,8y
\unfakable{angbracketright}
\unfakable{Omegainv}
\unfakable{bigcircle}
\unfakable{Omega}
\unfakable{openbracketleft}             % faked 8r,8y
\unfakable{openbracketright}            % faked 8r,8y
\unfakable{arrowup}
\unfakable{arrowdown}
\unfakable{asciigrave}                  % 8r,8y
\unfakable{born}
\unfakable{divorced}
\unfakable{died}
\unfakable{leaf}
\unfakable{married}
\unfakable{musicalnote}
\unfakable{tildelow}                    % 8r,8y
\unfakable{hyphendblchar}
\unfakable{asciibreve}                  % 8r,8y
\unfakable{asciicaron}                  % 8r,8y
\unfakable{asciiacutedbl}               % faked 8r,8y
\unfakable{asciigravedbl}               % faked 8r,8y
\unfakable{dagger}                      % 8r,8y
\unfakable{daggerdbl}                   % 8r,8y
\unfakable{bardbl}                      % faked 8r,8y
\unfakable{perthousand}                 % 8r,8y
\unfakable{bullet}                      % 8r,8y
\unfakable{centigrade}                  % faked 8r,8y
\unfakable{dollaroldstyle}              % 8x (Adobe)
\unfakable{centoldstyle}                % 8x (Adobe)
\unfakable{florin}                      % 8r,8y
\unfakable{colonmonetary}               % 8x (Adobe)
\unfakable{won}
\unfakable{naira}
\unfakable{guarani}
\unfakable{peso}
\unfakable{lira}                        % 8x (URW)
\unfakable{recipe}
\unfakable{interrobang}
\unfakable{interrobangdown}
\unfakable{dong}
\unfakable{trademark}                   % 8r,8y
\unfakable{pertenthousand}              % faked 8x
\unfakable{pilcrow}
\unfakable{baht}
\unfakable{numero}
\unfakable{discount}
\unfakable{estimated}
\unfakable{openbullet}
\unfakable{servicemark}
\unfakable{quillbracketleft}
\unfakable{quillbracketright}
\unfakable{cent}                        % 8r,8y
\unfakable{sterling}                    % 8r,8y
\unfakable{currency}                    % 8r,8y
\unfakable{yen}                         % 8r,8y
\unfakable{brokenbar}                   % 8r,8y
\unfakable{section}                     % 8r,8y
\unfakable{asciidieresis}               % 8r,8y
\unfakable{copyright}                   % 8r,8y
\unfakable{ordfeminine}                 % 8r,8y
\unfakable{copyleft}
\unfakable{logicalnot}                  % 8r,8y
\unfakable{circledP}
\unfakable{registered}                  % 8r,8y
\unfakable{asciimacron}                 % 8r,8y
\unfakable{degree}                      % 8r,8y
\unfakable{plusminus}                   % 8r,8y
\unfakable{twosuperior}                 % 8r,8y
\unfakable{threesuperior}               % 8r,8y
\unfakable{asciiacute}                  % 8r,8y
\unfakable{mu}                          % 8r,8y
\unfakable{paragraph}                   % 8r,8y
\unfakable{periodcentered}              % 8r,8y
\unfakable{referencemark}
\unfakable{onesuperior}                 % 8r,8y
\unfakable{ordmasculine}                % 8r,8y
\unfakable{radical}
\unfakable{onequarter}                  % 8r,8y
\unfakable{onehalf}                     % 8r,8y
\unfakable{threequarters}               % 8r,8y
\unfakable{euro}                        % faked 8r,8y
\unfakable{multiply}                    % 8r,8y
\unfakable{divide}                      % 8r,8y


% \begincomment
% \section{Accents}
% \TeX's math accent-positioning requires accents to have zero depth, 
% but is that really relevant for these accents?
% \endcomment
% 
% \setcommand\zerodepth#1{
%    \ifisglyph{#1}\then
%       \resetglyph{#1}
%          \glyph{#1}{1000}
%          \resetdepth{0}
%       \endresetglyph
%    \Fi
% }
% \zerodepth{capitalgrave}
% \zerodepth{capitalacute}
% \zerodepth{capitalcircumflex}
% \zerodepth{capitaltilde}
% \zerodepth{capitaldieresis}
% \zerodepth{capitalhungarumlaut}
% \zerodepth{capitalring}
% \zerodepth{capitalcaron}
% \zerodepth{capitalbreve}
% \zerodepth{capitalmacron}
% \zerodepth{capitaldotaccent}

\endmetrics

\section{Changes}

1999/10/25: Definition of \verb|\unfakable| simplified. (UV\&LH)
Rationale: It is thoroughly confusing if the size of the black box
created by \verb|\unfakable| depends on the metrics of an unencoded
glyph that isn't accessible and therefore unavailable for all
pratical purposes.

February--March 2003: Explicitly centering the 
\texttt{asteriskcentered}. Introduced the \textit{vaxis} integer. (WaS)

2003/07/09:
Making use of \verb|\showbranches|, \verb|\begincomment|, and 
\verb|\endcomment|. Make definitions of \texttt{twelveudash} and 
\texttt{threequartersemdash} less dependent on the exact width of 
\texttt{endash}. Added a fake definition of \texttt{euro}. (LH)

2003/07/10:
Commented out section on zero-depth accents. (LH) Rationale: 
\texttt{TS1}-encoded fonts are, to my knowledge, never used in math. 

2003/07/13:
Added some \verb|\resetitalic| commands. Added fakes for 
\texttt{interrobang} and \texttt{interrobangdown}. Using an 
\verb|\unfakableaccent| for unfakable accents. (LH) Rationale: 
The result becomes much more readable.

\end{document}