%D \module
%D   [       file=font-tra,
%D        version=2009.01.02, % or so
%D          title=\CONTEXT\ Font Macros,
%D       subtitle=Tracing,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

\unprotect

\writestatus{loading}{ConTeXt Font Macros / Tracing}

%D just use fontid

%D \macros
%D   {showbodyfont}
%D
%D One can call for a rather simple overview of a bodyfont and the relations between
%D its alternative fonts.
%D
%D \showsetup{showbodyfont}
%D
%D The current bodyfont (here we omitted the argument) looks like:
%D
%D \showbodyfont
%D
%D The implementation is rather straightforward in using \type {\halign}.

\fetchmodulecommand \showbodyfont \f!font_run

%D \macros
%D   {showfontstrip, showminimalbaseline}
%D
%D The next command can come in handy when combining different fonts into a
%D collection (typeface) and determining optimal baseline distances.
%D
%D \showfontstrip \blank \showminimalbaseline

\fetchmodulecommand \showfontstrip       \f!font_run
\fetchmodulecommand \showminimalbaseline \f!font_run

%D \macros
%D   {showkerning}
%D
%D A goody is:
%D
%D \showkerning{Can you guess what kerning is?}

\fetchmodulecommand \showkerning \f!font_run

%D \macros
%D   {showbodyfontenvironment,showfont,showfontstyle,showligatures}
%D
%D The current bodyfontenvironment is:
%D
%D \showbodyfontenvironment
%D
%D This overview is generated using:
%D
%D \showsetup{showbodyfontenvironment}

\fetchmodulecommand \showbodyfontenvironment \f!font_run

%D The following command generates a fontmap:
%D
%D \startbuffer
%D \showfont[SansBold at 12pt]
%D \stopbuffer
%D
%D \typebuffer
%D \getbuffer

\fetchmodulecommand \showfont           \f!font_run
\fetchmodulecommand \showfontstyle      \f!font_run
\fetchmodulecommand \showligature       \f!font_run
\fetchmodulecommand \showligatures      \f!font_run
\fetchmodulecommand \showcharratio      \f!font_run
\fetchmodulecommand \showfontparameters \f!font_run

\permanent\protected\def\showchardata#1{\ctxcommand{showchardata("#1")}}   % todo: direct implementor
\permanent\protected\def\showfontdata  {\ctxcommand{showfontparameters()}} % todo: direct implementor

%D \macros
%D   {doiffontpresentelse}
%D
%D \starttyping
%D \doiffontpresentelse{texnansi-lmr10}{YES}{NO}
%D \doiffontpresentelse{adam-lindsay-modern-serif}{YES}{NO}
%D \stoptyping

\permanent\protected\def\doifelsefontpresent#1{\clf_doifelsefontpresent{#1}}

\aliased\let\doiffontpresentelse\doifelsefontpresent

%D The otf tracer code is now moved. If the individual commands are needed
%D one can just load the module.

\fetchmodulecommand \showotfcomposition      \f!font_run
\fetchmodulecommand \showotfcompositionlist  \f!font_run
\fetchmodulecommand \startotfsample          \f!font_run
\fetchmodulecommand \startotfcompositionlist \f!font_run

% \permanent\protected\def\savefontdata[#1]% not yet in i-*.xml
%   {\begingroup
%    \getdummyparameters[#1]%
%    \clf_savefont {
%       filename {\dummyparameter\c!file}
%       fontname {\dummyparameter\c!name}
%       method   {\dummyparameter\c!method}
%    }%
%    \endgroup}

\protect \endinput

