%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 and/or disappear: \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 \newconditional\fontattributeisset \unexpanded\def\dosetfontattribute#1#2% {\ifcsname#1#2\endcsname \settrue\fontattributeisset % reset is done elsewhere \@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