summaryrefslogtreecommitdiff
path: root/tex/context/base/spac-fnt.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/spac-fnt.mkiv')
-rw-r--r--tex/context/base/spac-fnt.mkiv91
1 files changed, 91 insertions, 0 deletions
diff --git a/tex/context/base/spac-fnt.mkiv b/tex/context/base/spac-fnt.mkiv
new file mode 100644
index 000000000..fae32c94b
--- /dev/null
+++ b/tex/context/base/spac-fnt.mkiv
@@ -0,0 +1,91 @@
+%D \module
+%D [ file=spac-fnt,
+%D version=2009.10.16, % 1997.03.31, was core-spa.tex
+%D title=\CONTEXT\ Spacing Macros,
+%D subtitle=Fonts,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{ConTeXt Spacing Macros / Fonts}
+
+%D For historic reasons here, will move:
+
+\unprotect
+
+\let\dostopattributes\relax % in case these commands end up in an edef
+
+\unexpanded\def\@@dostopattributes
+ {\stopcolor
+ \finishparbasedattributes
+ \endgroup}
+
+\unexpanded\def\@@nostopattributes
+ {\finishparbasedattributes
+ \endgroup}
+
+\unexpanded\def\doattributes#1#2#3#4%
+ {\dostartattributes{#1}{#2}{#3}{#4}\dostopattributes}
+
+% An even faster \ETEX\ version:
+
+\unexpanded\def\dostartattributes#1#2#3%
+ {\begingroup % geen \bgroup, anders in mathmode lege \hbox
+ \ifincolor
+ \ifcsname#1#3\endcsname
+ \let\dostopattributes\@@dostopattributes
+ \faststartcolor[\csname#1#3\endcsname]%
+ \else
+ \let\dostopattributes\@@nostopattributes
+ \fi
+ \else
+ \let\dostopattributes\@@nostopattributes
+ \fi
+ \ifcsname#1#2\endcsname
+ % \@EAEAEA\doconvertfont\@EA\@EA\csname#1#2\endcsname
+ \@EA\doconvertfont\csname#1#2\@EA\endcsname
+ \fi}
+
+\unexpanded\def\@@dostopattributes
+ {\faststopcolor
+ \finishparbasedattributes
+ \endgroup}
+
+\unexpanded\def\@@nostopattributes
+ {\finishparbasedattributes
+ \endgroup}
+
+%D Bonus macro, see core-sec.tex
+
+\unexpanded\def\dosetfontattribute#1#2%
+ {\ifcsname#1#2\endcsname
+ \@EA\doconvertfont\csname#1#2\@EA\endcsname
+ \fi\empty}
+
+%D Since this happens a lot, and sometimes large arguments
+%D are passed in \type {#4}, we just copy some code:
+
+\unexpanded\def\doattributes#1#2#3#4%
+ {\begingroup % geen \bgroup, anders in mathmode lege \hbox
+ \ifincolor
+ \ifcsname#1#3\endcsname
+ \let\dostopattributes\@@dostopattributes
+ \faststartcolor[\csname#1#3\endcsname]%
+ \else
+ \let\dostopattributes\endgroup
+ \fi
+ \else
+ \let\dostopattributes\endgroup
+ \fi
+ \ifcsname#1#2\endcsname
+ % \@EAEAEA\doconvertfont\@EA\@EA\csname#1#2\endcsname
+ \@EA\doconvertfont\csname#1#2\@EA\endcsname
+ \fi
+ {#4}%
+ \dostopattributes}
+
+\protect \endinput