diff options
author | Hans Hagen <pragma@wxs.nl> | 2012-07-19 12:56:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2012-07-19 12:56:00 +0200 |
commit | bd10d98d2a79e924b87489f1077d358e80ed5b2d (patch) | |
tree | 5316e09545666673cfc771482d5644e7e8d2f99f /tex/context/base/font-sty.mkvi | |
parent | 72f7d97e8a3def88a9753d233d779d80fffd1696 (diff) | |
download | context-bd10d98d2a79e924b87489f1077d358e80ed5b2d.tar.gz |
beta 2012.07.19 12:56
Diffstat (limited to 'tex/context/base/font-sty.mkvi')
-rw-r--r-- | tex/context/base/font-sty.mkvi | 42 |
1 files changed, 32 insertions, 10 deletions
diff --git a/tex/context/base/font-sty.mkvi b/tex/context/base/font-sty.mkvi index 3e1bb96da..d704aae8a 100644 --- a/tex/context/base/font-sty.mkvi +++ b/tex/context/base/font-sty.mkvi @@ -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,17 +261,23 @@ \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}} + {\doifassignmentelse{#specification}\font_styles_assignment\font_styles_checked{#specification}} \def\font_styles_assignment#specification{\groupedcommand{\font_styles_use_generic{#specification}}{}} \def\font_styles_direct #specification{\groupedcommand{\definedfont[#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). |