summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/supp-fun.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/supp-fun.mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/supp-fun.mkiv58
1 files changed, 14 insertions, 44 deletions
diff --git a/Master/texmf-dist/tex/context/base/supp-fun.mkiv b/Master/texmf-dist/tex/context/base/supp-fun.mkiv
index a8db3b6343d..33bee0306d1 100644
--- a/Master/texmf-dist/tex/context/base/supp-fun.mkiv
+++ b/Master/texmf-dist/tex/context/base/supp-fun.mkiv
@@ -5,7 +5,7 @@
%D subtitle=Fun Stuff,
%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
@@ -13,6 +13,9 @@
\unprotect
+%D Beware, these macros wil be replaced and at some point this
+%D module will not be preloaded any more.
+
%D This module implements some typographics tricks that can
%D be fun when designing document layouts. The examples use
%D macros that are typical to \CONTEXT, but non \CONTEXT\
@@ -20,21 +23,15 @@
%D macros without problems. This module will be extended
%D when the need for more of such tricks arises.
-\ifx \undefined \writestatus \input supp-mis.tex \relax \fi
-
\writestatus{loading}{ConTeXt Support Macros / Fun Stuff}
-\ifx\definefont\undefined
- \def\definedfont[#1]{\font\temp#1\relax\temp}
-\fi
-
%D \macros
%D {DroppedCaps, DroppedString, DroppedIndent, DroppedLines}
%D
%D \startbuffer
%D \DroppedCaps
-%D {\color[green]} {cmbx12}
-%D {2.2\baselineskip} {2pt} {\baselineskip} {2}
+%D {\color[green]} {SerifBold}
+%D {\the\dimexpr2.2\baselineskip} {2pt} {\the\baselineskip} {2}
%D Let's start
%D \stopbuffer
%D
@@ -58,8 +55,8 @@
%D
%D \startbuffer
%D \DroppedCaps
-%D {\color[red]} {cmbx12}
-%D {\baselineskip} {0pt} {0pt} {1}
+%D {\color[red]} {SerifBold}
+%D {\the\baselineskip} {0pt} {0pt} {1}
%D This simple
%D \stopbuffer
%D
@@ -70,8 +67,8 @@
%D
%D \startbuffer
%D \DroppedCaps
-%D {\color[red]} {cmbx12}
-%D {2\baselineskip} {0pt} {\baselineskip} {2}
+%D {\color[red]} {SerifBold}
+%D {\the\dimexpr2\baselineskip} {0pt} {\the\baselineskip} {2}
%D Is this ugly
%D \stopbuffer
%D
@@ -98,8 +95,8 @@
%D \startbuffer
%D \def\MyDroppedCaps%
%D {\DroppedCaps
-%D {\color[green]} {cmbx12}
-%D {5\baselineskip} {3pt} {3\baselineskip} {4}}
+%D {\color[green]} {SerifBold}
+%D {\the\dimexpr5\baselineskip} {3pt} {\the\dimexpr3\baselineskip} {4}}
%D
%D \MyDroppedCaps The implementation
%D \stopbuffer
@@ -537,30 +534,9 @@
\def\NormalizeFontHeight{\NormalizeFontSize\ht}
\def\NormalizeFontWidth {\NormalizeFontSize\wd}
-% \def\NormalizeFontSize#1#2#3#4#5%
-% {\bgroup
-% \dimen0=#4% #4 can be \ht0 or so
-% \setbox0\hbox{\definedfont[#5 at 10pt]#3}%
-% \ifdim\wd0>\zeropoint
-% \dimen2=#10 % #1 is \wd or \ht
-% \dimen4=10000pt
-% \divide\dimen4 \dimen2
-% \divide\dimen0 \plusthousand
-% \dimen0=\number\dimen4\dimen0
-% \xdef\TheNormalizedFontSize{\the\dimen0}%
-% \else
-% \dimen0\bodyfontsize
-% \fi
-% \definedfont[#5 at \the\dimen0]%
-% \expandafter
-% \egroup
-% \expandafter\font\expandafter#2\fontname\font\relax}
-%
-% the familiar struggle with accuracy forces us to use:
-
\def\NormalizeFontSize#1#2#3#4#5%
{\bgroup
- \dimen0=#4% #4 can be \ht0 or so
+ \dimen0=#4% #4 can be \ht0 or so
\setbox0\hbox{\definedfont[#5 at 5pt]#3}% 10pt
\ifdim\wd0>\zeropoint
\dimen2=#10 % #1 is \wd or \ht
@@ -573,13 +549,7 @@
\else
\dimen0\bodyfontsize
\fi
- % mkii
- % \definedfont[#5 at \the\dimen0]%
- % \expandafter
- % \egroup
- % \expandafter\font\expandafter#2\fontname\font\relax}
- % mkiv safe (file: prefix etc)
- \expanded{\egroup\def\noexpand#2{\definedfont[#5 at \the\dimen0]}}}
+ \normalexpanded{\egroup\def\noexpand#2{\definedfont[#5 at \the\dimen0]}}}
%D Afterwards, we have access to the calculated size by: