1%D \module 2%D [ file=font-tra, 3%D version=2009.01.02, % or so 4%D title=\CONTEXT\ Font Macros, 5%D subtitle=Tracing, 6%D author=Hans Hagen, 7%D date=\currentdate, 8%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] 9%C 10%C This module is part of the \CONTEXT\ macro||package and is 11%C therefore copyrighted by \PRAGMA. See mreadme.pdf for 12%C details. 13 14\unprotect 15 16\writestatus{loading}{ConTeXt Font Macros / Tracing} 17 18%D just use fontid 19 20%D \macros 21%D {showbodyfont} 22%D 23%D One can call for a rather simple overview of a bodyfont and the relations between 24%D its alternative fonts. 25%D 26%D \showsetup{showbodyfont} 27%D 28%D The current bodyfont (here we omitted the argument) looks like: 29%D 30%D \showbodyfont 31%D 32%D The implementation is rather straightforward in using \type {\halign}. 33 34\fetchmodulecommand \showbodyfont \f!font_run 35 36%D \macros 37%D {showfontstrip, showminimalbaseline} 38%D 39%D The next command can come in handy when combining different fonts into a 40%D collection (typeface) and determining optimal baseline distances. 41%D 42%D \showfontstrip \blank \showminimalbaseline 43 44\fetchmodulecommand \showfontstrip \f!font_run 45\fetchmodulecommand \showminimalbaseline \f!font_run 46 47%D \macros 48%D {showkerning} 49%D 50%D A goody is: 51%D 52%D \showkerning{Can you guess what kerning is?} 53 54\fetchmodulecommand \showkerning \f!font_run 55 56%D \macros 57%D {showbodyfontenvironment,showfont,showfontstyle,showligatures} 58%D 59%D The current bodyfontenvironment is: 60%D 61%D \showbodyfontenvironment 62%D 63%D This overview is generated using: 64%D 65%D \showsetup{showbodyfontenvironment} 66 67\fetchmodulecommand \showbodyfontenvironment \f!font_run 68 69%D The following command generates a fontmap: 70%D 71%D \startbuffer 72%D \showfont[SansBold at 12pt] 73%D \stopbuffer 74%D 75%D \typebuffer 76%D \getbuffer 77 78\fetchmodulecommand \showfont \f!font_run 79\fetchmodulecommand \showfontstyle \f!font_run 80\fetchmodulecommand \showligature \f!font_run 81\fetchmodulecommand \showligatures \f!font_run 82\fetchmodulecommand \showcharratio \f!font_run 83\fetchmodulecommand \showfontparameters \f!font_run 84 85\permanent\protected\def\showchardata#1{showchardata("#1")} % todo: direct implementor 86\permanent\protected\def\showfontdata {showfontparameters()} % todo: direct implementor 87 88%D \macros 89%D {doiffontpresentelse} 90%D 91%D \starttyping 92%D \doiffontpresentelse{texnansi-lmr10}{YES}{NO} 93%D \doiffontpresentelse{adam-lindsay-modern-serif}{YES}{NO} 94%D \stoptyping 95 96\permanent\protected\def\doifelsefontpresent#1{{#1}} 97 98\aliased\let\doiffontpresentelse\doifelsefontpresent 99 100%D The otf tracer code is now moved. If the individual commands are needed 101%D one can just load the module. 102 103\fetchmodulecommand \showotfcomposition \f!font_run 104\fetchmodulecommand \showotfcompositionlist \f!font_run 105\fetchmodulecommand \startotfsample \f!font_run 106\fetchmodulecommand \startotfcompositionlist \f!font_run 107 108% \permanent\protected\def\savefontdata[#1]% not yet in i-*.xml 109% {\begingroup 110% \getdummyparameters[#1]% 111% \clf_savefont { 112% filename {\dummyparameter\c!file} 113% fontname {\dummyparameter\c!name} 114% method {\dummyparameter\c!method} 115% }% 116% \endgroup} 117 118\protect \endinput 119 |