summaryrefslogtreecommitdiff
path: root/tex/context/base/font-sty.mkvi
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/font-sty.mkvi')
-rw-r--r--tex/context/base/font-sty.mkvi42
1 files changed, 32 insertions, 10 deletions
diff --git a/tex/context/base/font-sty.mkvi b/tex/context/base/font-sty.mkvi
index d8f01afa7..732d2b027 100644
--- a/tex/context/base/font-sty.mkvi
+++ b/tex/context/base/font-sty.mkvi
@@ -84,7 +84,7 @@
% \appendtoks
% \let\groupedcommand\thirdofthreearguments
-% \to \simplifiedcommands
+% \to \everysimplifycommands
%D This command also defines the keyword as command. This means
%D that the example definition of \type{bold} we gave before,
@@ -216,11 +216,19 @@
\installcommandhandler \??style {style} \??style
+\setupstyle
+ [%\c!style=,
+ %\c!color=,
+ \c!method=\v!command]
+
\appendtoks
\letvalue{\??stylecheck\currentstyle}\relax
- \setuevalue{\e!start\currentstyle}{\font_styles_apply_start{\currentstyle}}%
- \setuevalue{\e!stop \currentstyle}{\font_styles_apply_stop}%
- \setuevalue {\currentstyle}{\font_styles_apply_grouped{\currentstyle}}% no longer groupedcommand here
+ \edef\p_method{\styleparameter\c!method}%
+ \ifx\p_method\v!command
+ \setuevalue{\e!start\currentstyle}{\font_styles_apply_start{\currentstyle}}%
+ \setuevalue{\e!stop \currentstyle}{\font_styles_apply_stop}%
+ \setuevalue {\currentstyle}{\font_styles_apply_grouped{\currentstyle}}% no longer groupedcommand here
+ \fi
\to \everydefinestyle
\unexpanded\def\font_styles_apply_start#name%
@@ -242,7 +250,9 @@
\unexpanded\def\font_styles_use_generic#specification%
{\let\currentstyle\s!unknown % reasonable generic tag
- \setupcurrentstyle[\c!style=,\c!color=,#specification]%
+ \letstyleparameter\c!style\empty
+ \letstyleparameter\c!color\empty
+ \setupcurrentstyle[#specification]%
\usestylestyleandcolor\c!style\c!color}
% commands
@@ -251,14 +261,20 @@
\unexpanded\def\style[#name]% as this is can be a switch we use groupedcommand
{\csname\??styleargument
- \ifcsname#name\endcsname1\else\ifcsname\??stylecheck#name\endcsname2\else3\fi\fi
+ \ifcsname\??stylecheck#name\endcsname
+ 2% defined as style
+ \else\ifcsname#name\endcsname
+ 1% defined as command
+ \else
+ 3% specification
+ \fi\fi
\endcsname{#name}}
\setvalue{\??styleargument1}#name%
- {\csname#name\endcsname}
+ {\groupedcommand{\csname#name\endcsname}{}}
\setvalue{\??styleargument2}#name%
- {\groupedcommand{\font_styles_use_defined{#name}}{}}
+ {\groupedcommand{\font_styles_use_defined{#name}}{}} % or {\font_styles_apply_grouped{#name}}
\setvalue{\??styleargument3}#specification%
{\doifassignmentelse{#specification}\font_styles_assignment\font_styles_direct{#specification}}
@@ -273,7 +289,13 @@
\unexpanded\def\startstyle[#name]%
{\begingroup
\csname\??styleenvironment
- \ifcsname#name\endcsname1\else\ifcsname\??stylecheck#name\endcsname2\else3\fi\fi
+ \ifcsname\??stylecheck#name\endcsname
+ 2% defined as style
+ \else\ifcsname#name\endcsname
+ 1% defined as command
+ \else
+ 3% specification
+ \fi\fi
\endcsname{#name}}
\unexpanded\def\stopstyle
@@ -289,7 +311,7 @@
\setvalue{\??styleenvironment3}#specification%
{\doifassignmentelse{#specification}\font_styles_start_assignment\font_styles_start_direct{#specification}}
-\def\font_styles_start_assignment#specification{\usegenericstyle{#specification}}
+\def\font_styles_start_assignment#specification{\font_styles_use_generic{#specification}}
\def\font_styles_start_direct #specification{\definedfont[#specification]\relax}
%D Still experimental (might even go away).