summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/font-tra.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/font-tra.mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/font-tra.mkiv97
1 files changed, 92 insertions, 5 deletions
diff --git a/Master/texmf-dist/tex/context/base/font-tra.mkiv b/Master/texmf-dist/tex/context/base/font-tra.mkiv
index 37ea4541a0f..353d9e7a511 100644
--- a/Master/texmf-dist/tex/context/base/font-tra.mkiv
+++ b/Master/texmf-dist/tex/context/base/font-tra.mkiv
@@ -5,7 +5,7 @@
%D subtitle=Tracing,
%D author=Hans Hagen,
%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%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
@@ -14,6 +14,80 @@
\unprotect
%D \macros
+%D {showbodyfont}
+%D
+%D One can call for a rather simple overview of a bodyfont and the
+%D relations between 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
+%D \type{\halign}.
+
+\fetchruntimecommand \showbodyfont {\f!fontprefix\s!run}
+
+%D \macros
+%D {showfontstrip, testminimalbaseline, showminimalbaseline}
+%D
+%D The next command can come in handy when combining
+%D different fonts into a collection (typeface) and
+%D determining optimal baseline distances.
+%D
+%D \showfontstrip \blank \showminimalbaseline
+
+\fetchruntimecommand \showfontstrip {\f!fontprefix\s!run}
+\fetchruntimecommand \testminimalbaseline {\f!fontprefix\s!run}
+\fetchruntimecommand \showminimalbaseline {\f!fontprefix\s!run}
+
+%D \macros
+%D {showkerning}
+%D
+%D A goody is:
+%D
+%D \showkerning{Can you guess what kerning is?}
+
+\fetchruntimecommand \showkerning {\f!fontprefix\s!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}
+
+\fetchruntimecommand \showbodyfontenvironment {\f!fontprefix\s!run}
+
+%D
+%D The following command generates a fontmap:
+%D
+%D \startbuffer
+%D \showfont[SansBold at 12pt]
+%D \stopbuffer
+%D
+%D \typebuffer
+%D \getbuffer
+
+\fetchruntimecommand \showfont {\f!fontprefix\s!run}
+\fetchruntimecommand \showfontstyle {\f!fontprefix\s!run}
+\fetchruntimecommand \showligature {\f!fontprefix\s!run}
+\fetchruntimecommand \showligatures {\f!fontprefix\s!run}
+\fetchruntimecommand \showcharratio {\f!fontprefix\s!run}
+\fetchruntimecommand \showfontparameters {\f!fontprefix\s!run}
+
+\unexpanded\def\checkcharactersinfont {\ctxcommand{checkcharactersinfont }}
+\unexpanded\def\removemissingcharacters{\ctxcommand{removemissingcharacters}}
+\unexpanded\def\showchardata #1{\ctxcommand{showchardata("#1")}}
+\unexpanded\def\showfontdata {\ctxcommand{showfontparameters()}}
+
+%D \macros
%D {doiffontpresentelse}
%D
%D \starttyping
@@ -50,6 +124,8 @@
{\begingroup
\tttf\language\minusone
\veryraggedright
+ \forgetparindent
+ \forgeteverypar
\hangindent1em
\hangafter\plusone
\dontleavehmode\hbox{\detokenize{#1}}\removeunwantedspaces
@@ -67,7 +143,11 @@
{\ctxlua{nodes.tracers.steppers.features()}}
\def\showotfsteps
- {\dontleavehmode\bgroup\tttf \language\minusone features: \showotfstepfeatures\egroup
+ {\begingroup
+ \veryraggedright
+ \forgetparindent
+ \forgeteverypar
+ \dontleavehmode\bgroup\tttf \language\minusone features: \showotfstepfeatures\egroup
\blank
\dontleavehmode\bgroup\tttf result:\egroup
\blank
@@ -84,14 +164,18 @@
\blank
\startlinecorrection
\ruledhbox % can be mode
- \bgroup\resetallattributes\showotfstepglyphs\recurselevel\egroup % reset is new, we don't want additional processing
+ \bgroup\resetallattributes\showotfstepglyphs\recurselevel\egroup % reset is new, we don't want additional processing
\stoplinecorrection
- \blank}}
+ \blank}%
+ \endgroup}
\unexpanded\def\startotfsample
{\enabletrackers[*otf.sample]% beware, kind of global
\startotfcollecting
- \begingroup}
+ \begingroup
+ \veryraggedright
+ \forgetparindent
+ \forgeteverypar}
\unexpanded\def\stopotfsample
{\endgroup
@@ -104,6 +188,9 @@
\def\showotfcomposition#1#2#3% {font*features at size}, rl=-1, text
{\begingroup
+ \veryraggedright
+ \forgetparindent
+ \forgeteverypar
\setupcolors[\c!state=\v!start]% can be option
\startotfsample
\global\setbox\otfcompositionbox\hbox{\definedfont[#1]\ifnum#2<0 \textdir TRT\else\ifnum#2>0 \textdir TLT\fi\fi\relax#3}%