diff options
Diffstat (limited to 'tex/context/base/mkxl')
-rw-r--r-- | tex/context/base/mkxl/anch-box.mkxl | 117 | ||||
-rw-r--r-- | tex/context/base/mkxl/cont-new.mkxl | 2 | ||||
-rw-r--r-- | tex/context/base/mkxl/context.mkxl | 2 | ||||
-rw-r--r-- | tex/context/base/mkxl/driv-shp.lmt | 14 | ||||
-rw-r--r-- | tex/context/base/mkxl/font-imp-braille.lmt | 1 | ||||
-rw-r--r-- | tex/context/base/mkxl/math-act.lmt | 2 | ||||
-rw-r--r-- | tex/context/base/mkxl/pack-box.mkxl | 32 | ||||
-rw-r--r-- | tex/context/base/mkxl/type-imp-braille.mkxl | 10 |
8 files changed, 145 insertions, 35 deletions
diff --git a/tex/context/base/mkxl/anch-box.mkxl b/tex/context/base/mkxl/anch-box.mkxl index 88809152e..02cdf5fb8 100644 --- a/tex/context/base/mkxl/anch-box.mkxl +++ b/tex/context/base/mkxl/anch-box.mkxl @@ -19,28 +19,68 @@ anch_box_arrows_draw ; \stopMPpositiongraphic +% \tolerant\permanent\protected\def\connectboxanchors[#1]#*[#2]#*[#3]#*[#4]#*#:#5#6% +% {\begingroup +% \defineboxanchor[#5]% +% \setboxanchor[#5][#1][#3]\hpack{\xypos{\namespacedboxanchor{#5}}}% +% \ifparameter#3\or\setupboxanchorcontent[#1][#3]\fi +% \defineboxanchor[#6]% +% \setboxanchor[#6][#2][#4]\hpack{\xypos{\namespacedboxanchor{#6}}}% +% \ifparameter#4\or\setupboxanchorcontent[#1][#4]\fi +% %\startpositionoverlay{text-1}% will become configurable region +% \startpositionoverlay{text+1}% will become configurable region +% \setMPpositiongraphic +% {\namespacedboxanchor{#5}}% +% {\namedboxanchorcontentparameter{#1}\c!mp}% +% {from=\namespacedboxanchor{#5},% +% to=\namespacedboxanchor{#6},% +% distance={\namedboxanchorcontentparameter{#1}\c!distance},% +% dashtype={\namedboxanchorcontentparameter{#1}\c!dash},% +% alternative={\namedboxanchorcontentparameter{#1}\c!alternative},% +% text={\namedboxanchorcontentparameter{#1}\c!text},% +% rulethickness={\namedboxanchorcontentparameter{#1}\c!rulethickness},% +% linecolor=\namedboxanchorcontentparameter{#1}{\c!rulecolor}}% +% \stoppositionoverlay +% \endgroup} + \tolerant\permanent\protected\def\connectboxanchors[#1]#*[#2]#*[#3]#*[#4]#*#:#5#6% {\begingroup - \defineboxanchor[#5]% - \setboxanchor[#5][#1][#3]\hpack{\xypos{\namespacedboxanchor{#5}}}% + % + \edef\boxanchorone{\boxanchoringclass:#5}% + \edef\boxanchortwo{\boxanchoringclass:#6}% +% \edef\boxanchorone{#5}% +% \edef\boxanchortwo{#6}% + % + \doifnotanchorbox{\boxanchorone}{\defineboxanchor[\boxanchorone]}% + \doifnotanchorbox{\boxanchortwo}{\defineboxanchor[\boxanchortwo]}% + % + \edef\boxanchorposone{#1:#2:\namespacedboxanchor{\boxanchorone}}% + \edef\boxanchorpostwo{#1:#2:\namespacedboxanchor{\boxanchortwo}}% +% \edef\boxanchorposone{#1:#2:\number\namedboxanchor{\boxanchorone}}% +% \edef\boxanchorpostwo{#1:#2:\number\namedboxanchor{\boxanchortwo}}% + % + \setboxanchor[\boxanchorone][#1][#3]\hpack{\xypos{\boxanchorposone}}% + \setboxanchor[\boxanchortwo][#2][#4]\hpack{\xypos{\boxanchorpostwo}}% + % \ifparameter#3\or\setupboxanchorcontent[#1][#3]\fi - \defineboxanchor[#6]% - \setboxanchor[#6][#2][#4]\hpack{\xypos{\namespacedboxanchor{#6}}}% - \ifparameter#4\or\setupboxanchorcontent[#1][#4]\fi -% \startpositionoverlay{text-1}% will become configurable region - \startpositionoverlay{text+1}% will become configurable region - \setMPpositiongraphic - {\namespacedboxanchor{#5}}% - {\namedboxanchorcontentparameter{#1}\c!mp}% - {from=\namespacedboxanchor{#5},% - to=\namespacedboxanchor{#6},% - distance={\namedboxanchorcontentparameter{#1}\c!distance},% - dashtype={\namedboxanchorcontentparameter{#1}\c!dash},% - alternative={\namedboxanchorcontentparameter{#1}\c!alternative},% - text={\namedboxanchorcontentparameter{#1}\c!text},% - rulethickness={\namedboxanchorcontentparameter{#1}\c!rulethickness},% - linecolor=\namedboxanchorcontentparameter{#1}{\c!rulecolor}}% - \stoppositionoverlay + \ifparameter#4\or\setupboxanchorcontent[#2][#4]\fi % used ? + % + \normalexpanded{% + \startpositionoverlay{text+1}% will become configurable region + \setMPpositiongraphic + {\boxanchorposone}% + {\namedboxanchorcontentparameter{#1}\c!mp}% + {from=\boxanchorposone,% + to=\boxanchorpostwo,% + distance={\namedboxanchorcontentparameter{#1}\c!distance},% + dashtype={\namedboxanchorcontentparameter{#1}\c!dash},% + arrow={\namedboxanchorcontentparameter{#1}\c!arrow},% + alternative={\namedboxanchorcontentparameter{#1}\c!alternative},% + text={\namedboxanchorcontentparameter{#1}\c!text},% + rulethickness={\namedboxanchorcontentparameter{#1}\c!rulethickness},% + linecolor=\namedboxanchorcontentparameter{#1}{\c!rulecolor}}% + \stoppositionoverlay + }% \endgroup} % dedicated or not @@ -69,6 +109,7 @@ to=\namespacedboxanchor{#6},% distance={\namedboxanchorcontentparameter{#1}\c!distance},% dashtype={\namedboxanchorcontentparameter{#1}\c!dash},% + arrow={\namedboxanchorcontentparameter{#1}\c!arrow},% alternative={\namedboxanchorcontentparameter{#1}\c!alternative},% text={\namedboxanchorcontentparameter{#1}\c!text},% rulethickness={\namedboxanchorcontentparameter{#1}\c!rulethickness},% @@ -177,4 +218,42 @@ \c!xoffset=.25\exheight, \c!yoffset=.25\exheight] +% \setupboxanchorcontent [top] [rulecolor=darkyellow] +% \setupboxanchorcontent [left] [rulecolor=darkred] +% \setupboxanchorcontent [bottom][rulecolor=darkblue] +% \setupboxanchorcontent [right] [rulecolor=darkgreen] +% +% \startbuffer +% \connectboxanchors[top] [top] [text={\small\small\strut\bf var 1}]{a1}{a2} +% \connectboxanchors[top] [top] [text={\small\small\strut\bf var 2}]{b1}{b2} +% \connectboxanchors[top] [top] [text={\small\small\strut\bf var 3}]{a1}{b1} +% \connectboxanchors[bottom][bottom][text={\small\small\strut\bf var 4}]{b1}{b2} +% \connectboxanchors[bottom][bottom][text={\small\small\strut\bf var 6}]{a1}{a2} +% \connectboxanchors[bottom][bottom][rulecolor=darkgreen,distance=4ex,text={\small\small\strut\bf var 7}]{c1}{d1} +% +% % \start +% +% $\showboxes +% % \mathboxanchored{a1}{a}^{2^x} + +% % \mathboxanchored[nucleus]{a1}{a}^{2^x} + +% % \mathboxanchored{a1}{g}^2 + +% % \mathboxanchored{a1}{a} + +% a^{\mathboxanchored{a1}{2}} + +% % a^{\mathboxanchored{a1}{2}}_3 + +% \mathboxanchored{b1}{b} +% = +% \mathboxanchored{c1}{c}^2 + +% \mathboxanchored[nucleus]{d1}{d}^2 +% = +% b_{\mathboxanchored{b2}{3}} + +% \mathboxanchored{a2}{a} +% $ +% \stopbuffer +% +% \starttext +% \startTEXpage[offset=10mm]\startboxanchoring[a]\getbuffer\stopboxanchoring\stopTEXpage +% \startTEXpage[offset=11mm]\startboxanchoring[b]\getbuffer\stopboxanchoring\stopTEXpage +% \startTEXpage[offset=12mm]\startboxanchoring[+]\getbuffer\stopboxanchoring\stopTEXpage +% \stoptext + \protect diff --git a/tex/context/base/mkxl/cont-new.mkxl b/tex/context/base/mkxl/cont-new.mkxl index 21de832b0..0b29287cf 100644 --- a/tex/context/base/mkxl/cont-new.mkxl +++ b/tex/context/base/mkxl/cont-new.mkxl @@ -13,7 +13,7 @@ % \normalend % uncomment this to get the real base runtime -\newcontextversion{2022.12.05 18:49} +\newcontextversion{2022.12.07 20:21} %D This file is loaded at runtime, thereby providing an excellent place for hacks, %D patches, extensions and new features. There can be local overloads in cont-loc diff --git a/tex/context/base/mkxl/context.mkxl b/tex/context/base/mkxl/context.mkxl index 7942fb93a..9811ff9a4 100644 --- a/tex/context/base/mkxl/context.mkxl +++ b/tex/context/base/mkxl/context.mkxl @@ -29,7 +29,7 @@ %D {YYYY.MM.DD HH:MM} format. \immutable\edef\contextformat {\jobname} -\immutable\edef\contextversion{2022.12.05 18:49} +\immutable\edef\contextversion{2022.12.07 20:21} %overloadmode 1 % check frozen / warning %overloadmode 2 % check frozen / error diff --git a/tex/context/base/mkxl/driv-shp.lmt b/tex/context/base/mkxl/driv-shp.lmt index 0b9418ab8..7aba4ac01 100644 --- a/tex/context/base/mkxl/driv-shp.lmt +++ b/tex/context/base/mkxl/driv-shp.lmt @@ -1089,6 +1089,7 @@ local hlist_out, vlist_out do anchor_v = anchor_v + (height - width) end end +-- anchor_v = anchor_v + shift anchors[source] = { anchor_h, anchor_v, width, height, depth } end if usedorientation then @@ -1154,16 +1155,14 @@ local hlist_out, vlist_out do pos_v = pos_v - depth flushrule(current,pos_h + xoffset,pos_v + yoffset,pos_r,width,total,subtype) end + cur_h = cur_h + width end - -- move into above if - cur_h = cur_h + width elseif id == math_code then -- local kern = getkern(current) -- if kern ~= 0 then -- cur_h = cur_h + kern -- else --- cur_h = cur_h + effectiveglue(current,this_box) -cur_h = cur_h + effectiveglue(current,this_box,true) + cur_h = cur_h + effectiveglue(current,this_box,true) -- end elseif id == dir_code then -- We normally have proper begin-end pairs. A begin without end is (silently) handled @@ -1278,8 +1277,7 @@ cur_h = cur_h + effectiveglue(current,this_box,true) -- local id = getid(current) for current, id, subtype in nextnode, current do if id == glue_code then --- local glueheight = effectiveglue(current,this_box) -local glueheight = effectiveglue(current,this_box,true) + local glueheight = effectiveglue(current,this_box,true) if glueheight ~= 0 then if subtype >= leaders_code then local leader = getleader(current) @@ -1407,7 +1405,7 @@ local glueheight = effectiveglue(current,this_box,true) end pos_v = ref_v - (cur_v + basepoint_v) elseif hasoffset then --- local orientation, xoffset, yoffset = getorientation(current) + -- local orientation, xoffset, yoffset = getorientation(current) local xoffset, yoffset = getoffsets(current) -- local basepoint_h = shift -- local basepoint_v = height @@ -1535,8 +1533,8 @@ local glueheight = effectiveglue(current,this_box,true) end flushrule(current,pos_h + xoffset,pos_v - total - yoffset,pos_r,width,total,subtype) end + cur_v = cur_v + total end - cur_v = cur_v + total elseif id == whatsit_code then flushwhatsit[subtype](current,pos_h,pos_v) else diff --git a/tex/context/base/mkxl/font-imp-braille.lmt b/tex/context/base/mkxl/font-imp-braille.lmt index 2bbf0fd16..fb1ba6cb4 100644 --- a/tex/context/base/mkxl/font-imp-braille.lmt +++ b/tex/context/base/mkxl/font-imp-braille.lmt @@ -103,6 +103,7 @@ local function initialize(tfmdata,value) d.height = height d.depth = depth d.commands = c + d.smaller = nil else characters[u] = { width = n * width, diff --git a/tex/context/base/mkxl/math-act.lmt b/tex/context/base/mkxl/math-act.lmt index d4abed0ba..152707670 100644 --- a/tex/context/base/mkxl/math-act.lmt +++ b/tex/context/base/mkxl/math-act.lmt @@ -3451,7 +3451,7 @@ local function applytweaks(when,target,original) if action then local feature = tweak.feature local features = target.specification.features.normal - if not feature or features[feature] == true then + if feature == nil or features[feature] then local version = tweak.version if version and version ~= target.tweakversion then report_math("skipping tweak %a version %a",tweak.tweak,version) diff --git a/tex/context/base/mkxl/pack-box.mkxl b/tex/context/base/mkxl/pack-box.mkxl index ecd793056..7c64b0032 100644 --- a/tex/context/base/mkxl/pack-box.mkxl +++ b/tex/context/base/mkxl/pack-box.mkxl @@ -1236,6 +1236,24 @@ \newcount\registeredboxanchor +\installmacrostack\boxanchoringclass + +\mutable\let\boxanchoringclass\empty + +\newcount\c_anchor_auto_box_class + +\permanent\protected\def\startboxanchoring[#1]% + == auto + {\push_macro_boxanchoringclass + \iftok{#1}{+}% + \global\advance\c_anchor_auto_box_class\plusone + \edef\boxanchoringclass{\the\c_anchor_auto_box_class::}% + \else + \edef\boxanchoringclass{#1} + \fi} + +\permanent\protected\def\stopboxanchoring + {\pop_macro_boxanchoringclass} + \permanent\protected\def\registerboxanchor {\global\advance\registeredboxanchor\minusone} @@ -1243,6 +1261,13 @@ {\registerboxanchor \global\expandafter\integerdef\csname\??boxanchors#1\endcsname\registeredboxanchor} +\permanent\protected\def\doifnotanchorbox#1% + {\ifcsname\??boxanchors#1\endcsname + \expandafter\gobbleoneargument + \else + \expandafter\firstofoneargument + \fi} + \permanent\def\namedboxanchor#1% {\normalexpanded{\ifcsname\??boxanchors#1\endcsname\lastnamedcs\orelse\ifchknum#1\or#1\else\zerocount\fi}} @@ -1290,11 +1315,14 @@ %D The name might change: -\permanent\protected\def\mathboxanchored#1#2{#2\Umathsource\namedboxanchor{#1}\relax} - \permanent\protected\def\mathrowanchored #1{\alignmentwrapsource\namedboxanchor{#1}\relax} \permanent\protected\def\mathcellanchored#1{\alignmentcellsource\namedboxanchor{#1}\relax} +%permanent\protected\def\mathboxanchored#1#2{#2\Umathsource\namedboxanchor{#1}\relax} + +\permanent\tolerant\protected\def\mathboxanchored[#1]#:#2#3% + {#3\Umathsource\iftok{#1}{nucleus}#1\fi\namedboxanchor{\boxanchoringclass:#2}\relax} + % to be used as: % % \scratchcounter\registeredboxanchor diff --git a/tex/context/base/mkxl/type-imp-braille.mkxl b/tex/context/base/mkxl/type-imp-braille.mkxl index 738874ec8..17209d50c 100644 --- a/tex/context/base/mkxl/type-imp-braille.mkxl +++ b/tex/context/base/mkxl/type-imp-braille.mkxl @@ -11,6 +11,8 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. +\continuewhenlmtxmode + %D There is no need to waste money on a commercial braille font if we have dejavu. After %D all it's just dots. We also don't need features. @@ -35,7 +37,7 @@ \definefontfallback[BrailleMono] [\s!name:dejavuserif*brailletext][0x0000-0x1FFFF][force=yes] \definefontfallback[BrailleSerif][\s!name:dejavuserif*brailletext][0x0000-0x1FFFF][force=yes] \definefontfallback[BrailleSans] [\s!name:dejavuserif*brailletext][0x0000-0x1FFFF][force=yes] - \definefontfallback[BrailleMath] [\s!name:dejavuserif*braillemath][0x0000-0x1FFFF][force=yes] + %\definefontfallback[BrailleMath] [\s!name:dejavuserif*braillemath][0x0000-0x1FFFF][force=yes] \definefontfallback[BrailleMonoBold] [\s!name:dejavuserifbold*brailletext][0x0000-0x1FFFF][force=yes] \definefontfallback[BrailleSerifBold][\s!name:dejavuserifbold*brailletext][0x0000-0x1FFFF][force=yes] @@ -70,8 +72,10 @@ \starttypescript [\s!math][braille] [\s!name] \loadfontgoodies[dejavu-math] - \definefontsynonym[\s!MathRoman] [\s!file:texgyredejavu-math][\s!features={mathbraille,\s!math\mathsizesuffix},\s!fallbacks=BrailleMath] - \definefontsynonym[\s!MathRomanBold][\s!file:texgyredejavu-math][\s!features={mathbraille,\s!math\mathsizesuffix,dejavu-math-bold},\s!fallbacks=BrailleMath] + %\definefontsynonym[\s!MathRoman] [\s!file:texgyredejavu-math][\s!features={mathbraille,\s!math\mathsizesuffix},\s!fallbacks=BrailleMath] + %\definefontsynonym[\s!MathRomanBold][\s!file:texgyredejavu-math][\s!features={mathbraille,\s!math\mathsizesuffix,dejavu-math-bold},\s!fallbacks=BrailleMath] + \definefontsynonym[\s!MathRoman] [\s!file:texgyredejavu-math][\s!features={braillemath,\s!math\mathsizesuffix},\s!goodies=dejavu-math] + \definefontsynonym[\s!MathRomanBold][\s!file:texgyredejavu-math][\s!features={braillemath,\s!math\mathsizesuffix,dejavu-math-bold},\s!goodies=dejavu-math] \stoptypescript \starttypescript[braille] |