summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/meta-tex.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/meta-tex.mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/meta-tex.mkiv49
1 files changed, 43 insertions, 6 deletions
diff --git a/Master/texmf-dist/tex/context/base/meta-tex.mkiv b/Master/texmf-dist/tex/context/base/meta-tex.mkiv
index 6afc7efc52d..ab4f93daed5 100644
--- a/Master/texmf-dist/tex/context/base/meta-tex.mkiv
+++ b/Master/texmf-dist/tex/context/base/meta-tex.mkiv
@@ -13,11 +13,33 @@
\unprotect
-\long\def\startTeXtexts#1\stopTeXtexts{[do we need TeXtexts in MkIV]}
-\long\def\doTeXtext[#1]#2{[do we need TeXtexts in MkIV]}
-\long\def\TeXtext{\dosingleempty\doTeXtext}
+% Ok, we support this in MkIV because Mojca kept the pressure on. It
+% looks a bit like a hack.
-\def\definetextext[#1]#2{\setvalue{textext@@#1}{#2}}
+\long\def\startTeXtexts#1\stopTeXtexts
+ {#1}
+
+\long\def\TeXtext
+ {\dosingleempty\doTeXtext}
+
+\long\def\doTeXtext[#1]#2#3% contrary to mkii we don't process yet but we do expand
+ {\long\setxvalue{@@st@@::#2}{\noexpand\dodoTeXtext{#1}{#3}}}
+
+\long\def\dodoTeXtext#1#2%
+ {\begingroup
+ \setbox\nextbox\hbox{\executeifdefined{textext@@#1}\firstofoneargument{#2}}%
+ \executeifdefined{textext::#1}{\getvalue{textext::depth}}%
+ \box\nextbox
+ \endgroup}
+
+\def\getTeXtext#1%
+ {\getvalue{@@st@@::#1}}
+
+\setvalue{textext::d}{\setbox\nextbox\hbox{\lower\dp\nextbox\box\nextbox}} % unchecked
+\setvalue{textext::n}{} % unchecked
+
+\setvalue {textext::depth}{\getvalue{textext::d}}
+\setvalue{textext::nodepth}{\getvalue{textext::n}}
% \definetextext[framed]{\framed}
%
@@ -25,11 +47,26 @@
% draw \sometxt[framed]{black} rotated 45 ;
% \stopMPcode
-\def\definetextext[#1]#2{\setvalue{@@st@@[#1]}{#2}}
+\def\definetextext[#1]#2{\setvalue{@@st@@[#1]}{#2}\setvalue{@@st@@[#1] }{#2}} % we don't grab spaces after [#1]
\long\def\sometxt#1#{\dosometxt{#1}} % grab optional [args]
\long\def\dosometxt#1#2%
- {textext("\ifcsname @@st@@#1\endcsname\csname @@st@@#1\endcsname{#2}\else#2\fi")}
+ {textext.drt("\ifcsname @@st@@#1\endcsname\csname @@st@@#1\endcsname{#2}\else#2\fi")}
+
+% Best use the mp macro instead since it provides positioning.
+%
+% \startuseMPgraphic{testgraphic}
+% draw \sometxt{\ruledhbox{\strut hans hagen}} scaled 3;
+% % draw textext.drt("\ruledhbox{\strut hans hagen}") scaled 3;
+% % draw textext.dlft("\ruledhbox{\strut hans hagen}") scaled 3;
+% % draw textext.lft("\ruledhbox{\strut hans hagen}") scaled 3;
+% draw llcorner currentpicture -- urcorner currentpicture withcolor yellow;
+% draw lrcorner currentpicture -- ulcorner currentpicture withcolor yellow;
+% draw boundingbox currentpicture withcolor blue ;
+% draw origin withcolor red withpen pencircle scaled 1pt;
+% \stopuseMPgraphic
+%
+% {\showstruts\useMPgraphic{testgraphic}}
\protect \endinput