summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2022-04-19 20:58:40 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2022-04-19 20:58:40 +0200
commitb9a7e870cf47674c90331b41f9267768992b49cb (patch)
tree7b7bb2ee92af1767712ffcfbec47995c8894e214 /tex
parentb155eafa1e2d73692eed08ecabeb5ad589ac11dc (diff)
downloadcontext-b9a7e870cf47674c90331b41f9267768992b49cb.tar.gz
2022-04-19 19:52:00
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/mkii/cont-new.mkii2
-rw-r--r--tex/context/base/mkii/context.mkii2
-rw-r--r--tex/context/base/mkii/mult-ro.mkii8
-rw-r--r--tex/context/base/mkiv/cont-new.mkiv2
-rw-r--r--tex/context/base/mkiv/context.mkiv2
-rw-r--r--tex/context/base/mkiv/mult-def.lua3
-rw-r--r--tex/context/base/mkiv/mult-low.lua6
-rw-r--r--tex/context/base/mkiv/mult-prm.lua1
-rw-r--r--tex/context/base/mkiv/publ-ini.lua21
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin24625 -> 24624 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin257116 -> 257224 bytes
-rw-r--r--tex/context/base/mkxl/anch-pos.lmt2
-rw-r--r--tex/context/base/mkxl/cont-new.mkxl2
-rw-r--r--tex/context/base/mkxl/context.mkxl2
-rw-r--r--tex/context/base/mkxl/lpdf-rul.lmt71
-rw-r--r--tex/context/base/mkxl/math-ini.mkxl2
-rw-r--r--tex/context/base/mkxl/meta-ini.mkxl17
-rw-r--r--tex/context/base/mkxl/mlib-int.lmt16
-rw-r--r--tex/context/base/mkxl/mlib-pps.mkxl2
-rw-r--r--tex/context/base/mkxl/mult-sys.mkxl1
-rw-r--r--tex/context/base/mkxl/node-nut.lmt2
-rw-r--r--tex/context/base/mkxl/node-res.lmt2
-rw-r--r--tex/context/base/mkxl/node-rul.mkxl13
-rw-r--r--tex/context/base/mkxl/node-tsk.lmt50
-rw-r--r--tex/context/base/mkxl/pack-rul.mkxl62
-rw-r--r--tex/context/base/mkxl/spac-hor.mkxl7
-rw-r--r--tex/context/base/mkxl/spac-ver.mkxl22
-rw-r--r--tex/context/base/mkxl/supp-box.mkxl2
-rw-r--r--tex/context/base/mkxl/syst-ini.mkxl18
-rw-r--r--tex/context/base/mkxl/task-ini.lmt5
-rw-r--r--tex/context/base/mkxl/toks-aux.lmt3
-rw-r--r--tex/context/base/mkxl/typo-ada.lmt118
-rw-r--r--tex/context/base/mkxl/typo-ada.mkxl81
-rw-r--r--tex/context/base/mkxl/typo-bld.lmt17
-rw-r--r--tex/context/interface/mkii/keys-ro.xml8
-rw-r--r--tex/context/modules/mkiv/m-escrito.lua30
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
37 files changed, 477 insertions, 127 deletions
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii
index c4a402aba..7f4ff92d9 100644
--- a/tex/context/base/mkii/cont-new.mkii
+++ b/tex/context/base/mkii/cont-new.mkii
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2022.04.15 20:13}
+\newcontextversion{2022.04.19 19:50}
%D This file is loaded at runtime, thereby providing an
%D excellent place for hacks, patches, extensions and new
diff --git a/tex/context/base/mkii/context.mkii b/tex/context/base/mkii/context.mkii
index 5855fa19f..f149ddb8e 100644
--- a/tex/context/base/mkii/context.mkii
+++ b/tex/context/base/mkii/context.mkii
@@ -20,7 +20,7 @@
%D your styles an modules.
\edef\contextformat {\jobname}
-\edef\contextversion{2022.04.15 20:13}
+\edef\contextversion{2022.04.19 19:50}
%D For those who want to use this:
diff --git a/tex/context/base/mkii/mult-ro.mkii b/tex/context/base/mkii/mult-ro.mkii
index 99e44c530..4525d6a47 100644
--- a/tex/context/base/mkii/mult-ro.mkii
+++ b/tex/context/base/mkii/mult-ro.mkii
@@ -281,7 +281,6 @@
\setinterfacevariable{inright}{indreapta}
\setinterfacevariable{inrightedge}{inparteadreapta}
\setinterfacevariable{inrightmargin}{inmargineadreapta}
-\setinterfacevariable{integral}{integral}
\setinterfacevariable{interaction}{interactiune}
\setinterfacevariable{interactionmenu}{meniuinteractiune}
\setinterfacevariable{interactive}{interactive}
@@ -642,6 +641,7 @@
% definitions for interface constants for language ro
%
\setinterfaceconstant{action}{actiune}
+\setinterfaceconstant{adaptive}{adaptive}
\setinterfaceconstant{address}{adresa}
\setinterfaceconstant{after}{dupa}
\setinterfaceconstant{afterhead}{dupatitlu}
@@ -716,6 +716,7 @@
\setinterfaceconstant{bottom}{jos}
\setinterfaceconstant{bottomafter}{bottomafter}
\setinterfaceconstant{bottombefore}{bottombefore}
+\setinterfaceconstant{bottomcolor}{bottomcolor}
\setinterfaceconstant{bottomcommand}{bottomcommand}
\setinterfaceconstant{bottomdistance}{distantajos}
\setinterfaceconstant{bottomframe}{framejos}
@@ -919,6 +920,7 @@
\setinterfaceconstant{inputfile}{inputfile}
\setinterfaceconstant{insidesection}{insidesection}
\setinterfaceconstant{instance}{instance}
+\setinterfaceconstant{integral}{integral}
\setinterfaceconstant{intent}{intent}
\setinterfaceconstant{interaction}{interactiune}
\setinterfaceconstant{interlinespace}{spatiereinterliniara}
@@ -961,6 +963,7 @@
\setinterfaceconstant{leftquote}{minicitatstanga}
\setinterfaceconstant{leftsample}{leftsample}
\setinterfaceconstant{leftsentence}{propozitiestanga}
+\setinterfaceconstant{leftsource}{leftsource}
\setinterfaceconstant{leftspeech}{leftspeech}
\setinterfaceconstant{leftstyle}{stilstanga}
\setinterfaceconstant{leftsubsentence}{subpropozitiestanga}
@@ -1007,6 +1010,7 @@
\setinterfaceconstant{middle}{mijloc}
\setinterfaceconstant{middlecolor}{middlecolor}
\setinterfaceconstant{middlecommand}{middlecommand}
+\setinterfaceconstant{middlesource}{middlesource}
\setinterfaceconstant{middlespeech}{middlespeech}
\setinterfaceconstant{middlestyle}{middlestyle}
\setinterfaceconstant{middletext}{textmijloc}
@@ -1179,6 +1183,7 @@
\setinterfaceconstant{rightquote}{minicitatdreapta}
\setinterfaceconstant{rightsample}{rightsample}
\setinterfaceconstant{rightsentence}{propozitiedreapta}
+\setinterfaceconstant{rightsource}{rightsource}
\setinterfaceconstant{rightspeech}{rightspeech}
\setinterfaceconstant{rightstyle}{stildreapta}
\setinterfaceconstant{rightsubsentence}{subpropozitiedreapta}
@@ -1314,6 +1319,7 @@
\setinterfaceconstant{toffset}{toffset}
\setinterfaceconstant{tolerance}{toleranta}
\setinterfaceconstant{top}{sus}
+\setinterfaceconstant{topcolor}{topcolor}
\setinterfaceconstant{topcommand}{topcommand}
\setinterfaceconstant{topdistance}{distantasus}
\setinterfaceconstant{topframe}{framesus}
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index da58655a3..d34252711 100644
--- a/tex/context/base/mkiv/cont-new.mkiv
+++ b/tex/context/base/mkiv/cont-new.mkiv
@@ -13,7 +13,7 @@
% \normalend % uncomment this to get the real base runtime
-\newcontextversion{2022.04.15 20:13}
+\newcontextversion{2022.04.19 19:50}
%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/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv
index 70f35d7d6..a6ef280ad 100644
--- a/tex/context/base/mkiv/context.mkiv
+++ b/tex/context/base/mkiv/context.mkiv
@@ -49,7 +49,7 @@
%D {YYYY.MM.DD HH:MM} format.
\edef\contextformat {\jobname}
-\edef\contextversion{2022.04.15 20:13}
+\edef\contextversion{2022.04.19 19:50}
%D Kind of special:
diff --git a/tex/context/base/mkiv/mult-def.lua b/tex/context/base/mkiv/mult-def.lua
index c0a9d70e0..0a8b71e30 100644
--- a/tex/context/base/mkiv/mult-def.lua
+++ b/tex/context/base/mkiv/mult-def.lua
@@ -7343,6 +7343,9 @@ return {
["pe"]="کنش",
["ro"]="actiune",
},
+ ["adaptive"]={
+ ["en"]="adaptive",
+ },
["address"]={
["cs"]="adresa",
["de"]="adresse",
diff --git a/tex/context/base/mkiv/mult-low.lua b/tex/context/base/mkiv/mult-low.lua
index c76fe4884..e345195d5 100644
--- a/tex/context/base/mkiv/mult-low.lua
+++ b/tex/context/base/mkiv/mult-low.lua
@@ -203,7 +203,9 @@ return {
--
"normalizelinenormalizecode", "parindentskipnormalizecode", "swaphangindentnormalizecode", "swapparsshapenormalizecode",
"breakafterdirnormalizecode", "removemarginkernsnormalizecode", "clipwidthnormalizecode", "flattendiscretionariesnormalizecode",
- "discardzerotabskipsnormalizecode", "flattenleadersnormalizecode",
+ "discardzerotabskipsnormalizecode", "flattenhleadersnormalizecode",
+ --
+ "normalizeparnormalizeparcode", "flattenvleadersnormalizeparcode",
--
"nopreslackclassoptioncode", "nopostslackclassoptioncode",
"lefttopkernclassoptioncode", "righttopkernclassoptioncode", "leftbottomkernclassoptioncode", "rightbottomkernclassoptioncode",
@@ -269,7 +271,7 @@ return {
--
"doglobal", "dodoglobal", "redoglobal", "resetglobal",
--
- "donothing", "untraceddonothing", "dontcomplain", "lessboxtracing", "forgetall",
+ "donothing", "untraceddonothing", "dontcomplain", "moreboxtracing", "lessboxtracing", "noboxtracing", "forgetall",
--
"donetrue", "donefalse", "foundtrue", "foundfalse",
--
diff --git a/tex/context/base/mkiv/mult-prm.lua b/tex/context/base/mkiv/mult-prm.lua
index 927a1bd42..32de6f81a 100644
--- a/tex/context/base/mkiv/mult-prm.lua
+++ b/tex/context/base/mkiv/mult-prm.lua
@@ -498,6 +498,7 @@ return {
"nohrule",
"norelax",
"normalizelinemode",
+ "normalizeparmode",
"nospaces",
"novrule",
"numericscale",
diff --git a/tex/context/base/mkiv/publ-ini.lua b/tex/context/base/mkiv/publ-ini.lua
index 9d43f69f4..d6a7bf3de 100644
--- a/tex/context/base/mkiv/publ-ini.lua
+++ b/tex/context/base/mkiv/publ-ini.lua
@@ -22,7 +22,7 @@ if not modules then modules = { } end modules ['publ-ini'] = {
-- gain is not that large anyway because not much publication stuff is flushed.
local next, rawget, type, tostring, tonumber = next, rawget, type, tostring, tonumber
-local match, find, gsub = string.match, string.find, string.gsub
+local match, find, gsub, lower = string.match, string.find, string.gsub, string.lower
local concat, sort, tohash = table.concat, table.sort, table.tohash
local mod = math.mod
local formatters = string.formatters
@@ -1316,6 +1316,12 @@ do
local typesetters = { }
publications.typesetters = typesetters
+ local lowered = setmetatableindex(function(t,k)
+ k = lower(k)
+ t[k] = k
+ return k
+ end)
+
local function defaulttypesetter(field,value,manipulator)
if value and value ~= "" then
value = tostring(value)
@@ -1422,6 +1428,8 @@ do
local function get(dataset,tag,field,what,check,catspec) -- somewhat more extensive
local current = rawget(datasets,dataset)
if current then
+ tag = lowered.tag
+ field = lowered.field
local data = current.luadata[tag]
if data then
local category = data.category
@@ -1471,6 +1479,8 @@ do
local function btxflush(name,tag,field)
local dataset = rawget(datasets,name)
if dataset then
+ tag = lowered.tag
+ field = lowered.field
local fields = dataset.luadata[tag]
if fields then
local manipulator, field = splitmanipulation(field)
@@ -1497,6 +1507,8 @@ do
local function btxfield(name,tag,field)
local dataset = rawget(datasets,name)
if dataset then
+ tag = lowered.tag
+ field = lowered.field
local fields = dataset.luadata[tag]
if fields then
local category = fields.category
@@ -1522,6 +1534,8 @@ do
local function btxdetail(name,tag,field)
local dataset = rawget(datasets,name)
if dataset then
+ tag = lowered.tag
+ field = lowered.field
local fields = dataset.luadata[tag]
if fields then
local details = dataset.details[tag]
@@ -1552,8 +1566,11 @@ do
local function btxdirect(name,tag,field)
local dataset = rawget(datasets,name)
if dataset then
+ tag = lowered.tag
+ field = lowered.field
local fields = dataset.luadata[tag]
if fields then
+ field = lowered.field
local manipulator, field = splitmanipulation(field)
local value = fields[field]
if value then
@@ -1572,6 +1589,8 @@ do
local function okay(name,tag,field)
local dataset = rawget(datasets,name)
if dataset then
+ tag = lowered.tag
+ field = lowered.field
local fields = dataset.luadata[tag]
if fields then
local category = fields.category
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index e12289f4f..d464c29ca 100644
--- a/tex/context/base/mkiv/status-files.pdf
+++ b/tex/context/base/mkiv/status-files.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf
index d77df12eb..9c4d2c54e 100644
--- a/tex/context/base/mkiv/status-lua.pdf
+++ b/tex/context/base/mkiv/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/mkxl/anch-pos.lmt b/tex/context/base/mkxl/anch-pos.lmt
index 07e338cb6..d3b52ad4d 100644
--- a/tex/context/base/mkxl/anch-pos.lmt
+++ b/tex/context/base/mkxl/anch-pos.lmt
@@ -819,7 +819,7 @@ function jobpositions.used()
if positionsused == nil then
positionsused = false
for k, v in next, collected do
- if k ~= "shared" and next(v) then
+ if k ~= "shared" and type(v) == "table" and next(v) then
positionsused = true
break
end
diff --git a/tex/context/base/mkxl/cont-new.mkxl b/tex/context/base/mkxl/cont-new.mkxl
index 0b9cb38b8..6dbbe3ccb 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.04.15 20:13}
+\newcontextversion{2022.04.19 19:50}
%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 9ae6ef38f..a34772bbb 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.04.15 20:13}
+\immutable\edef\contextversion{2022.04.19 19:50}
%overloadmode 1 % check frozen / warning
%overloadmode 2 % check frozen / error
diff --git a/tex/context/base/mkxl/lpdf-rul.lmt b/tex/context/base/mkxl/lpdf-rul.lmt
index 1dfcc11a3..371549e19 100644
--- a/tex/context/base/mkxl/lpdf-rul.lmt
+++ b/tex/context/base/mkxl/lpdf-rul.lmt
@@ -33,6 +33,10 @@ local floor = math.floor
local getrandom = utilities.randomizer.get
local formatters = string.formatters
+local setdimen = tex.setdimen
+local setcount = tex.setcount
+local setmacro = tokens.setters.macro
+
local codeinjections = backends.registered.pdf.codeinjections
-- This is very pdf specific. Maybe move some to lpdf-rul.lua some day.
@@ -82,18 +86,21 @@ FakeWord(%width%,%height%,%depth%,%line%,%color%);
%initializations%
FakeRule(%width%,%height%,%depth%,%line%,%color%);
]],
+-- ["fake:rest"] = replacer [[
+--RuleDirection := "%direction%" ;
+--RuleOption := "%option%" ;
+--RuleWidth := %width% ;
+--RuleHeight := %height% ;
+--RuleDepth := %depth% ;
+--RuleH := %h% ;
+--RuleV := %v% ;
+--RuleThickness := %line% ;
+--RuleFactor := %factor% ;
+--RuleOffset := %offset% ;
+--def RuleColor = %color% enddef ;
+--%data%;
+-- ]]
["fake:rest"] = replacer [[
-RuleDirection := "%direction%" ;
-RuleOption := "%option%" ;
-RuleWidth := %width% ;
-RuleHeight := %height% ;
-RuleDepth := %depth% ;
-RuleH := %h% ;
-RuleV := %v% ;
-RuleThickness := %line% ;
-RuleFactor := %factor% ;
-RuleOffset := %offset% ;
-def RuleColor = %color% enddef ;
%data%;
]]
}
@@ -107,21 +114,35 @@ def RuleColor = %color% enddef ;
local total = ht + dp
local code = (predefined[name] or predefined["fake:rest"]) {
data = p.data or "",
- -- width = p.width * bpfactor,
- -- height = p.height * bpfactor,
- -- depth = p.depth * bpfactor,
- width = h * bpfactor,
- height = v * bpfactor * ht / total,
- depth = v * bpfactor * dp / total,
- factor = (p.factor or 0) * bpfactor, -- needs checking
- offset = p.offset or 0,
- line = (p.line or 65536) * bpfactor,
- color = mpcolor(p.ma,p.ca,p.ta),
- option = p.option or "",
- direction = p.direction or lefttoright_code,
- h = h * bpfactor,
- v = v * bpfactor,
+ -- -- width = p.width * bpfactor,
+ -- -- height = p.height * bpfactor,
+ -- -- depth = p.depth * bpfactor,
+ -- width = h * bpfactor,
+ -- height = v * bpfactor * ht / total,
+ -- depth = v * bpfactor * dp / total,
+ -- factor = (p.factor or 0) * bpfactor, -- needs checking
+ -- offset = p.offset or 0,
+ -- line = (p.line or 65536) * bpfactor,
+ -- color = mpcolor(p.ma,p.ca,p.ta),
+ -- option = p.option or "",
+ -- direction = p.direction or lefttoright_code,
+ -- h = h * bpfactor,
+ -- v = v * bpfactor,
}
+ --
+ setdimen("d_rule_width", h)
+ setdimen("d_rule_height", v * ht / total)
+ setdimen("d_rule_depth", v * dp / total)
+ setdimen("d_rule_h", h)
+ setdimen("d_rule_v", v)
+ setdimen("d_rule_line", p.line or 65536)
+ setdimen("d_rule_offset", p.offset or 0)
+ setmacro("m_rule_factor", p.factor or 0)
+ setmacro("m_rule_option", p.option or "")
+ setmacro("m_rule_direction", p.direction or lefttoright_code)
+ setmacro("m_rule_color", mpcolor(p.ma,p.ca,p.ta))
+ print("!!!",mpcolor(p.ma,p.ca,p.ta))
+ --
if not initialized then
initialized = true
simplemetapost("rulefun",formatters["randomseed := %s;"](getrandom("rulefun",0,4095)))
diff --git a/tex/context/base/mkxl/math-ini.mkxl b/tex/context/base/mkxl/math-ini.mkxl
index f63827906..0b3bdf54d 100644
--- a/tex/context/base/mkxl/math-ini.mkxl
+++ b/tex/context/base/mkxl/math-ini.mkxl
@@ -1582,7 +1582,7 @@
\permanent\protected\def\mfunctionlabeltext{\math_function_handle\mathlabeltext}
\permanent\tolerant\protected\def\definemathfunction[#1]#*[#2]%
- {\frozen\defcsname#1\endcsname{\math_function_handle_label{#1}{#2}}}
+ {\frozen\protected\defcsname#1\endcsname{\math_function_handle_label{#1}{#2}}}
\protected\def\math_function_handle_label#1#2% tag settings
{\begingroup
diff --git a/tex/context/base/mkxl/meta-ini.mkxl b/tex/context/base/mkxl/meta-ini.mkxl
index 82cf516c2..86eaea3ae 100644
--- a/tex/context/base/mkxl/meta-ini.mkxl
+++ b/tex/context/base/mkxl/meta-ini.mkxl
@@ -1012,9 +1012,17 @@
%D This one is not optimized because it's only used for small snippets, if it
%D is used at all.
+%D
+%D \starttyping
+%D test \MPcode {draw unitcircle scaled 1.5ExHeight} test test \MPcode [doublefun]
+%D {draw unitcircle scaled 3mm shifted (0,-1mm)} test
+%D \stoptyping
-\permanent\tolerant\protected\def\MPcode#=#:#*#=%
- {\ifparameter#1\or
+\permanent\tolerant\protected\def\MPcode[#1]#:#2%
+ {\dontleavehmode
+ \begingroup
+ \obeyMPboxdepth
+ \ifparameter#1\or
\meta_begin_graphic_group{#1}%
\meta_enable_include
\meta_process_graphic{#2}%
@@ -1022,8 +1030,9 @@
\else
\let\currentMPinstance\defaultMPinstance
\meta_enable_include
- \meta_process_graphic{#1}%
- \fi}
+ \meta_process_graphic{#2}%
+ \fi
+ \endgroup}
% a bit nasty (also needed for compatibility:
diff --git a/tex/context/base/mkxl/mlib-int.lmt b/tex/context/base/mkxl/mlib-int.lmt
index ae883b1e8..ace2fee17 100644
--- a/tex/context/base/mkxl/mlib-int.lmt
+++ b/tex/context/base/mkxl/mlib-int.lmt
@@ -16,6 +16,7 @@ local get = tex.get
local emwidths = fonts.hashes.emwidths
local exheights = fonts.hashes.exheights
+local registerscript = metapost.registerscript
local registerdirect = metapost.registerdirect
local on_right_page = structures.pages.on_right
@@ -169,6 +170,21 @@ registerdirect("InPageBody", in_body_page )
registerdirect("defaultcolormodel", defaultcolormodel)
+-- see node-rul.*
+
+registerdirect("RuleWidth", function() return getdimen("d_rule_width") * factor end)
+registerdirect("RuleHeight", function() return getdimen("d_rule_height") * factor end)
+registerdirect("RuleDepth", function() return getdimen("d_rule_depth") * factor end)
+registerdirect("RuleH", function() return getdimen("d_rule_h") * factor end)
+registerdirect("RuleV", function() return getdimen("d_rule_v") * factor end)
+registerdirect("RuleThickness", function() return getdimen("d_rule_line") * factor end)
+registerdirect("RuleOffset", function() return getdimen("d_rule_offset") * factor end)
+registerdirect("RuleDirection", function() return getmacro("c_rule_direction") end)
+registerdirect("RuleFactor", function() return getmacro("m_rule_factor") end)
+registerdirect("RuleOption", function() return getmacro("m_rule_option") end)
+--------------("RuleColor", function() return getmacro("m_rule_color") end)
+registerscript("RuleColor", function() return getmacro("m_rule_color") end)
+
-- see typo-ada.*
registerdirect("AdaptiveWidth", function() return getdimen("d_adaptive_width") * factor end)
diff --git a/tex/context/base/mkxl/mlib-pps.mkxl b/tex/context/base/mkxl/mlib-pps.mkxl
index 00ab5281d..39dafb2f6 100644
--- a/tex/context/base/mkxl/mlib-pps.mkxl
+++ b/tex/context/base/mkxl/mlib-pps.mkxl
@@ -277,7 +277,7 @@
\permanent\protected\lettonothing\MPLIBstopgetpattern
-% For now here ... will be cleaned up:
+% For now here ... will be cleaned up and become macro calls instead:
\newtoks\mptexttoks
\newbox \mptextbox
diff --git a/tex/context/base/mkxl/mult-sys.mkxl b/tex/context/base/mkxl/mult-sys.mkxl
index caae5b365..71342e582 100644
--- a/tex/context/base/mkxl/mult-sys.mkxl
+++ b/tex/context/base/mkxl/mult-sys.mkxl
@@ -176,6 +176,7 @@
\definesystemconstant {data}
\definesystemconstant {dd}
\definesystemconstant {decimal}
+\definesystemconstant {delay}
\definesystemconstant {DefaultFont}
\definesystemconstant {default}
\definesystemconstant {depth}
diff --git a/tex/context/base/mkxl/node-nut.lmt b/tex/context/base/mkxl/node-nut.lmt
index 6fb25c313..dbc4696cc 100644
--- a/tex/context/base/mkxl/node-nut.lmt
+++ b/tex/context/base/mkxl/node-nut.lmt
@@ -63,6 +63,7 @@ local nuts = {
effectiveglue = direct.effectiveglue,
endofmath = direct.endofmath,
exchange = direct.exchange,
+ flattenleaders = direct.flattenleaders,
findattribute = direct.findattribute,
findnode = direct.findnode,
firstglyph = direct.firstglyph,
@@ -258,6 +259,7 @@ local nuts = {
traverseglyph = direct.traverseglyph,
traverseid = direct.traverseid,
traverselist = direct.traverselist,
+ traverseleader = direct.traverseleader,
unprotectglyph = direct.unprotectglyph,
unprotectglyphs = direct.unprotectglyphs,
unsetattribute = direct.unsetattribute,
diff --git a/tex/context/base/mkxl/node-res.lmt b/tex/context/base/mkxl/node-res.lmt
index da4283e7f..672f3c5a5 100644
--- a/tex/context/base/mkxl/node-res.lmt
+++ b/tex/context/base/mkxl/node-res.lmt
@@ -597,12 +597,14 @@ do
traversers.glyph = nuts.traverseglyph (glyph)
traversers.list = nuts.traverselist (glyph)
traversers.content = nuts.traversecontent(glyph)
+ traversers.leader = nuts.traverseleader (glyph)
treversers.node = nuts.traverse (glyph,true)
treversers.char = nuts.traversechar (glyph,true)
treversers.glyph = nuts.traverseglyph (glyph,true)
treversers.list = nuts.traverselist (glyph,true)
treversers.content = nuts.traversecontent(glyph,true)
+ treversers.leader = nuts.traverseleader (glyph,true)
nuts.traversers = traversers
nuts.treversers = treversers
diff --git a/tex/context/base/mkxl/node-rul.mkxl b/tex/context/base/mkxl/node-rul.mkxl
index 231a2f32b..4f13b16f1 100644
--- a/tex/context/base/mkxl/node-rul.mkxl
+++ b/tex/context/base/mkxl/node-rul.mkxl
@@ -280,6 +280,19 @@
%D
%D \typebuffer \getbuffer
+\newdimen\d_rule_width
+\newdimen\d_rule_height
+\newdimen\d_rule_depth
+\newdimen\d_rule_h
+\newdimen\d_rule_v
+\newdimen\d_rule_line
+\newdimen\d_rule_offset
+
+\mutable\let\m_rule_direction\empty
+\mutable\let\m_rule_factor \empty
+\mutable\let\m_rule_option \empty
+\mutable\let\m_rule_color \empty
+
\startuseMPgraphic{rules:under:random}
draw
((0,RuleDepth) ... (RuleWidth,RuleDepth)) randomized (4*RuleThickness)
diff --git a/tex/context/base/mkxl/node-tsk.lmt b/tex/context/base/mkxl/node-tsk.lmt
index 197d28538..ed6b3e13b 100644
--- a/tex/context/base/mkxl/node-tsk.lmt
+++ b/tex/context/base/mkxl/node-tsk.lmt
@@ -778,6 +778,56 @@ nonut = [[
}
+tasks.new {
+ name = "vboxhandlers",
+ processor = nodeprocessor,
+ sequence = {
+ "before", -- for users
+ "normalizers",
+ "after", -- for users
+ },
+ templates = {
+
+default = [[
+return function(head)
+ return head
+end
+]],
+
+process = [[
+local tonut = nodes.tonut
+local tonode = nodes.nuts.tonode
+
+%localize%
+
+return function(head,groupcode)
+ local nuthead = tonut(head)
+
+%actions%
+ return tonode(nuthead)
+end
+]],
+
+step = [[
+ nuthead = tonut((%action%(tonode(nuthead),groupcode)))
+]],
+
+nut = [[
+ nuthead = %action%(nuthead,groupcode)
+]],
+
+nohead = [[
+ %action%(tonode(nuthead),groupcode)
+]],
+
+nonut = [[
+ %action%(nuthead,groupcode)
+]],
+
+ }
+
+}
+
-- these operate on the content on a line, so no injections
tasks.new {
diff --git a/tex/context/base/mkxl/pack-rul.mkxl b/tex/context/base/mkxl/pack-rul.mkxl
index cce05e985..2ae83cb98 100644
--- a/tex/context/base/mkxl/pack-rul.mkxl
+++ b/tex/context/base/mkxl/pack-rul.mkxl
@@ -1029,6 +1029,44 @@
%D \defineframed[test][hoffset=1cm]
%D \stoptyping
+%D A byproduct of \type {\uleaders} in the 2022 math upgrade project:
+%D
+%D \starttyping
+%D \startsetups adaptive:test:a
+%D \setbox\usedadaptivebox\vbox to \usedadaptivetotal \bgroup
+%D \externalfigure
+%D [cow.pdf]
+%D [width=\framedmaxwidth,
+%D frame=on,
+%D height=\usedadaptivetotal]%
+%D \egroup
+%D \stopsetups
+%D
+%D \startsetups adaptive:test:b
+%D \setbox\usedadaptivebox\vbox to \usedadaptivetotal \bgroup
+%D \externalfigure
+%D [cow.pdf]
+%D [width=\usedadaptivewidth,
+%D frame=on,
+%D height=\usedadaptivetotal]%
+%D \egroup
+%D \stopsetups
+%D
+%D \framed[height=18cm,align=middle,adaptive=yes,top=,bottom=] {%
+%D \begstrut \samplefile{tufte} \endstrut
+%D \par
+%D \adaptivevbox
+%D [strut=yes,setups=adaptive:test:a]
+%D {\showstruts\strut\hsize5cm\hss}%
+%D \par
+%D \adaptivevbox
+%D [strut=yes,setups=adaptive:test:b]
+%D {\showstruts\strut\hsize5cm\hss}%
+%D \par
+%D \begstrut \samplefile{tufte} \endstrut
+%D }
+%D \stoptyping
+
\newdimen\d_framed_width
\newdimen\d_framed_height
\newdimen\d_framed_frameoffset
@@ -1192,8 +1230,13 @@
\fi
% the next check could move to heightalternative
\ifconditional\c_framed_has_height
- % obey user set height, also downward compatible
+ \ifcstok{\framedparameter\c!adaptive}\v!yes
+ \let\p_framed_adaptive\s!delay
+ \else
+ \let\p_framed_adaptive\empty
+ \fi
\else
+ \let\p_framed_adaptive\empty
\edef\p_framed_lines{\framedparameter\c!lines}%
\ifempty\p_framed_lines
\orelse\ifcase\p_framed_lines
@@ -1278,12 +1321,12 @@
\fi
\pack_framed_check_extra_offsets
\edef\p_framed_background{\framedparameter\c!background}%
-% \ifempty\p_framed_background
-% \let\pack_framed_forgetall\forgetall
-% \else
-% \let\pack_framed_forgetall\relax
-% \forgetall
-% \fi
+ % \ifempty\p_framed_background
+ % \let\pack_framed_forgetall\forgetall
+ % \else
+ % \let\pack_framed_forgetall\relax
+ % \forgetall
+ % \fi
\edef\framedwidth {\the\ifdim\d_framed_width >\zeropoint \d_framed_width \else\zeropoint\fi}% public
\edef\framedheight{\the\ifdim\d_framed_height>\zeropoint \d_framed_height\else\zeropoint\fi}% public
\edef\framedoffset{\the\dimexpr\ifconditional\c_framed_has_offset\localoffset \else\zeropoint\fi}% public
@@ -2218,7 +2261,7 @@
\fi}
\def\pack_framed_format_format_yes
- {\vbox to \d_framed_height
+ {\vbox to \d_framed_height \p_framed_adaptive
\bgroup
\let\postprocessframebox\relax
% \pack_framed_forgetall
@@ -2423,6 +2466,9 @@
\else
\clf_doreshapeframedbox
\fi\b_framed_normal\relax
+ \ifx\p_framed_adaptive\s!delay
+ \adaptivecheckbox\b_framed_normal
+ \fi
\fi}
\def\pack_framed_reshape_analyze
diff --git a/tex/context/base/mkxl/spac-hor.mkxl b/tex/context/base/mkxl/spac-hor.mkxl
index ee9001e62..9bde93997 100644
--- a/tex/context/base/mkxl/spac-hor.mkxl
+++ b/tex/context/base/mkxl/spac-hor.mkxl
@@ -19,13 +19,16 @@
\aliased\let\parfillrightskip\parfillskip
-\bitwiseflip \normalizelinemode \parindentskipnormalizecode
\bitwiseflip \normalizelinemode \normalizelinenormalizecode
+\bitwiseflip \normalizelinemode \parindentskipnormalizecode
\bitwiseflip \normalizelinemode \clipwidthnormalizecode
\bitwiseflip \normalizelinemode \flattendiscretionariesnormalizecode
-\bitwiseflip \normalizelinemode \flattenleadersnormalizecode % neglectable overhead
+\bitwiseflip \normalizelinemode \flattenhleadersnormalizecode
%bitwiseflip \normalizelinemode \discardzerotabskipsnormalizecode
+\bitwiseflip \normalizeparmode \normalizeparnormalizeparcode
+\bitwiseflip \normalizeparmode \flattenvleadersnormalizeparcode
+
\let\v_spac_indentation_current\empty % amount/keyword
\newdimen \d_spac_indentation_par
diff --git a/tex/context/base/mkxl/spac-ver.mkxl b/tex/context/base/mkxl/spac-ver.mkxl
index be7b2bf5e..12cf8c687 100644
--- a/tex/context/base/mkxl/spac-ver.mkxl
+++ b/tex/context/base/mkxl/spac-ver.mkxl
@@ -2368,4 +2368,26 @@
\permanent\protected\def\ignoreparskip{\c_spac_vspacing_ignore_parskip\plusone}
+%D New, use with care:
+%D
+%D \starttyping
+%D test test test \hfill\break
+%D test \blankbefore test
+%D test \blankbefore[2*line] test
+%D test \blankbefore test
+%D test test test \hfill\break
+%D test \blankbefore test
+%D test \blankbefore test
+%D test \blankbefore test
+%D test test test \hfill\break
+%D test \blankafter test
+%D test \blankafter test
+%D test \blankafter test
+%D test test test \hfill\break
+%D test test test \hfill\break
+%D \stoptyping
+
+\permanent\tolerant\protected\def\blankbefore[#1]{\vadjust pre {\ifcstok{#1}\emptytoks\blank\else\blank[#1]\fi}}
+\permanent\tolerant\protected\def\blankafter [#1]{\vadjust post{\ifcstok{#1}\emptytoks\blank\else\blank[#1]\fi}}
+
\protect \endinput
diff --git a/tex/context/base/mkxl/supp-box.mkxl b/tex/context/base/mkxl/supp-box.mkxl
index ed5668ce3..ed4f1da45 100644
--- a/tex/context/base/mkxl/supp-box.mkxl
+++ b/tex/context/base/mkxl/supp-box.mkxl
@@ -2911,7 +2911,7 @@
%D \showboxhere 0 % always on console, less clutter
%D \stoptyping
-\untraced\permanent\protected\def\showboxhere{\showbox nolevels content online }
+\untraced\permanent\protected\def\showboxhere{\showbox nolevels content online all }
% % possible extra interface, currently disabled
%
diff --git a/tex/context/base/mkxl/syst-ini.mkxl b/tex/context/base/mkxl/syst-ini.mkxl
index 3d25aa087..2bc352cf0 100644
--- a/tex/context/base/mkxl/syst-ini.mkxl
+++ b/tex/context/base/mkxl/syst-ini.mkxl
@@ -656,9 +656,17 @@
\hfuzz \maxdimen
\vfuzz \maxdimen}
+\permanent\protected\def\noboxtracing
+ {\showboxdepth \zerocount
+ \showboxbreadth\zerocount}
+
\permanent\protected\def\lessboxtracing
- {\showboxdepth \plusthree
- \showboxbreadth\plusfive}
+ {\showboxdepth \plusfive
+ \showboxbreadth\plusten}
+
+\permanent\protected\def\moreboxtracing
+ {\showboxbreadth\maxcount
+ \showboxdepth \maxcount}
%D Some expected plain variants follow. We don't reuse registers because we don't
%D want clashes. These will go away and packages that need them have to define them.
@@ -837,8 +845,10 @@
%D When we want to see a box we can as well show all of it.
-\showboxdepth \maxcount
-\showboxbreadth\maxcount
+% \showboxdepth \maxcount
+% \showboxbreadth\maxcount
+
+\lessboxtracing
%D Just for tracing purposes we set:
diff --git a/tex/context/base/mkxl/task-ini.lmt b/tex/context/base/mkxl/task-ini.lmt
index 9e06dac99..3b657414a 100644
--- a/tex/context/base/mkxl/task-ini.lmt
+++ b/tex/context/base/mkxl/task-ini.lmt
@@ -136,7 +136,7 @@ appendaction("contributers", "normalizers", "nodes.handlers.wipe",
appendaction("adjusters", "normalizers", "nodes.handlers.adjusters", nil, "nut", "enabled" )
-appendaction("vboxbuilders", "normalizers", "nodes.adaptive.handle", nil, "nut", "disabled" )
+appendaction("vboxbuilders", "normalizers", "nodes.adaptive.handlehorizontal", nil, "nut", "disabled" )
appendaction("vboxbuilders", "normalizers", "nodes.handlers.backgroundsvbox", nil, "nut", "disabled" )
------------("vboxbuilders", "normalizers", "typesetters.margins.localhandler", nil, "nut", "disabled" )
appendaction("vboxbuilders", "normalizers", "builders.vspacing.vboxhandler", nil, "nut", "enabled" )
@@ -144,7 +144,6 @@ appendaction("vboxbuilders", "normalizers", "builders.profiling.vboxhandler",
appendaction("vboxbuilders", "normalizers", "typesetters.checkers.handler", nil, "nut", "disabled" )
appendaction("vboxbuilders", "normalizers", "typesetters.synchronize.handler", nil, "nut", "disabled" )
-appendaction("mvlbuilders", "normalizers", "nodes.adaptive.handle", nil, "nut", "disabled" )
appendaction("mvlbuilders", "normalizers", "nodes.handlers.backgroundspage", nil, "nut", "disabled" )
appendaction("mvlbuilders", "normalizers", "typesetters.margins.globalhandler", nil, "nut", "disabled" )
appendaction("mvlbuilders", "normalizers", "nodes.handlers.migrate", nil, "nut", "disabled" )
@@ -153,6 +152,8 @@ appendaction("mvlbuilders", "normalizers", "builders.profiling.pagehandler",
appendaction("mvlbuilders", "normalizers", "typesetters.checkers.handler", nil, "nut", "disabled" )
appendaction("mvlbuilders", "normalizers", "typesetters.synchronize.handler", nil, "nut", "disabled" )
+appendaction("vboxhandlers", "normalizers", "nodes.adaptive.handlevertical", nil, "nut", "disabled" )
+
appendaction("everypar", "normalizers", "nodes.handlers.checkparcounter", nil, "nut", "disabled" )
appendaction("alignments", "normalizers", "nodes.handlers.aligncharacter", nil, "nut", "disabled" )
diff --git a/tex/context/base/mkxl/toks-aux.lmt b/tex/context/base/mkxl/toks-aux.lmt
index e1d3fabf4..9377bad42 100644
--- a/tex/context/base/mkxl/toks-aux.lmt
+++ b/tex/context/base/mkxl/toks-aux.lmt
@@ -185,7 +185,8 @@ tex.hyphenationcodes = getthem(tex.gethyphenationvalues, "hyphenationcode"
tex.mathcontrolcodes = getthem(tex.getmathcontrolvalues, "mathcontrolcode")
---.mathflattencodes = getthem(tex.getmathflattenvalues, "mathflattencode")
tex.noadoptioncodes = getthem(tex.getnoadoptionvalues, "") -- only at lua end
-tex.normalizecodes = getthem(tex.getnormalizevalues, "normalizecode")
+tex.normalizelinecodes = getthem(tex.getnormalizelinevalues, "normalizecode") -- we keep the short name
+tex.normalizeparcodes = getthem(tex.getnormalizeparvalues, "normalizeparcode")
tex.automigrationcodes = getthem(tex.getautomigrationvalues, "automigrationcode") -- only at lua end
tex.parcontextcodes = getthem(tex.getparcontextvalues, "parcontextcode")
tex.textcontrolcodes = getthem(tex.gettextcontrolvalues, "") -- only at lua end
diff --git a/tex/context/base/mkxl/typo-ada.lmt b/tex/context/base/mkxl/typo-ada.lmt
index 813c3ada2..17e18f01e 100644
--- a/tex/context/base/mkxl/typo-ada.lmt
+++ b/tex/context/base/mkxl/typo-ada.lmt
@@ -7,25 +7,33 @@ if not modules then modules = { } end modules ['typo-adj'] = {
license = "see context related readme files"
}
-local setdimen = tex.setdimen
-local setcount = tex.setcount
-local setmacro = tokens.setters.macro
-local expandmacro = token.expandmacro
+local setdimen = tex.setdimen
+local setcount = tex.setcount
+local setmacro = tokens.setters.macro
+local expandmacro = token.expandmacro
-local nuts = nodes.nuts
-local getwhd = nuts.getwhd
-local getattr = nuts.getattr
-local getwidth = nuts.getwidth
-local setlist = nuts.setlist
-local setlink = nuts.setlink
-local setstate = nuts.setstate
+local nuts = nodes.nuts
+local getid = nuts.getid
+local getlist = nuts.getlist
+local getwhd = nuts.getwhd
+local getattr = nuts.getattr
+local getwidth = nuts.getwidth
+local setlist = nuts.setlist
+local setlink = nuts.setlink
+local setstate = nuts.setstate
+local setattr = nuts.setattr
-local takebox = nuts.takebox
+local hlist_code = nodes.nodecodes.hlist
+local vlist_code = nodes.nodecodes.vlist
-local new_kern = nuts.pool.kern
+local getbox = nuts.getbox
+local takebox = nuts.takebox
-local traverselist = node.direct.traverselist
-local traverseleader = node.direct.traverseleader
+local new_kern = nuts.pool.kern
+
+local flattenleaders = nuts.flattenleaders
+local traverselist = nuts.traverselist
+local traverseleader = nuts.traverseleader
local a_adaptive = attributes.private("adaptive")
@@ -42,7 +50,8 @@ local enableaction = nodes.tasks.enableaction
function adaptive.set(settings)
if not enabled then
- enableaction("vboxbuilders","nodes.adaptive.handle")
+ enableaction("vboxbuilders","nodes.adaptive.handlehorizontal")
+ enableaction("vboxhandlers","nodes.adaptive.handlevertical")
enabled = true
end
texsetattribute(a_adaptive,registervalue(a_adaptive,settings))
@@ -58,30 +67,63 @@ end
local methods = {
-- overlay
- [1] = function(settings,hlist,list)
+ [1] = function(settings,parent,list)
local setups = settings.setups
if setups and setups ~= "" then
- local w, h, d = getwhd(hlist)
+ local w, h, d = getwhd(parent)
setadaptive(w,h,d,settings.rulethickness,settings.color)
expandmacro("setup",true,setups)
local l = takebox("b_adaptive_box")
if l then
- setlist(hlist, setlink(l,new_kern(-getwidth(l)),list))
+ setlist(parent, setlink(l,new_kern(-getwidth(l)),list))
end
end
end
}
-function adaptive.handle(n)
+-- The hlist leaders get done before we enter vpacking, so that is where the
+-- first call kicks in. Then we do a vpack (so one can indeed also adapt the
+-- ht/dp). After packing we know the glue and do the vlist leaders.
+
+local function handlehorizontal(n)
+ if hasvalues(a_adaptive) then
+ for _, t, _, l in traverselist(n) do
+ if t == hlist_code then
+ for m, _, _, ll in traverseleader(l) do
+ local a = getattr(m,a_adaptive)
+ if a then
+ local settings = getvalue(a_adaptive,a)
+ if settings then
+ setstate(m,0)
+ local action = methods[settings.method or 1]
+ if action then
+ action(settings,m,ll)
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ return n
+end
+
+local function handlevertical(n)
if hasvalues(a_adaptive) then
- for _, _, _, l in traverselist(n) do
- for m, _, _, ll in traverseleader(l) do
- local settings = getvalue(a_adaptive,getattr(m,a_adaptive))
- if settings then
- setstate(m,0)
- local action = methods[settings.method or 1]
- if action then
- action(settings,m,ll)
+ -- not a list just a node
+ for nn, t, _, l in traverselist(n) do
+ if t == vlist_code then
+ for m, _, _, ll in traverseleader(l) do
+ local a = getattr(m,a_adaptive)
+ if a then
+ local settings = getvalue(a_adaptive,a)
+ if settings then
+ setstate(m,0)
+ local action = methods[settings.method or 1]
+ if action then
+ action(settings,m,ll)
+ end
+ end
end
end
end
@@ -90,6 +132,9 @@ function adaptive.handle(n)
return n
end
+adaptive.handlehorizontal = handlehorizontal
+adaptive.handlevertical = handlevertical
+
interfaces.implement {
name = "setadaptive",
actions = adaptive.set,
@@ -104,4 +149,19 @@ interfaces.implement {
}
}
-nodes.tasks.prependaction("vboxbuilders", "normalizers", "nodes.adaptive.handle", nil, "nut", "disabled")
+interfaces.implement {
+ name = "adaptivecheckbox",
+ arguments = "integer",
+ public = true,
+ protected = true,
+ actions = function(n)
+ local b = getbox(n)
+ if b and flattenleaders(b) > 0 then
+ if getid(b) == hlist_code then
+ handlehorizontal(b)
+ else
+ handlevertical(b)
+ end
+ end
+ end,
+}
diff --git a/tex/context/base/mkxl/typo-ada.mkxl b/tex/context/base/mkxl/typo-ada.mkxl
index 6b7ce3902..e8b37997b 100644
--- a/tex/context/base/mkxl/typo-ada.mkxl
+++ b/tex/context/base/mkxl/typo-ada.mkxl
@@ -25,16 +25,20 @@
\newdimen\d_adaptive_height
\newdimen\d_adaptive_depth
\newdimen\d_adaptive_line
+\newdimen\d_adaptive_hsize
\mutable\let\m_adaptive_color\empty
\newbox\b_adaptive_box
-\aliased\let\usedadaptivewidth \d_adaptive_width
-\aliased\let\usedadaptiveheight \d_adaptive_height
-\aliased\let\usedadaptivedepth \d_adaptive_depth
-\aliased\let\usedadaptivelinewidth\d_adaptive_linewidth
-\aliased\let\usedadaptivebox \b_adaptive_box
+\aliased\let\usedadaptivewidth \d_adaptive_width
+\aliased\let\usedadaptiveheight\d_adaptive_height
+\aliased\let\usedadaptivedepth \d_adaptive_depth
+\aliased\let\usedadaptiveline \d_adaptive_line
+\aliased\let\usedadaptivehsize \d_adaptive_hsize
+\aliased\let\usedadaptivebox \b_adaptive_box
+
+\protected\untraced\def\usedadaptivetotal{\dimexpr\usedadaptiveheight+\usedadaptivedepth\relax}
\definesystemattribute[adaptive][public]
@@ -57,21 +61,31 @@
%\c!strut=\v!no,
\c!margin=2\emwidth]
-\permanent\tolerant\protected\def\adaptivebox[#1]#*[#2]%
- {\dontleavehmode
+\permanent\protected\def\adaptivehbox{\typo_adaptive_box\zerocount}
+\permanent\protected\def\adaptivevbox{\typo_adaptive_box\plusone }
+
+\aliased\let\adaptivebox\adaptivehbox
+
+\tolerant\def\typo_adaptive_box#1#*[#2]#*[#3]%
+ {\ifcase#1\dontleavehmode\fi
\begingroup
- \ifhastok={#1}%
+ \ifhastok={#2}%
\let\currentadaptive\empty
- \setupcurrentadaptive[#1]%
- \else
- \edef\currentadaptive{#1}%
\setupcurrentadaptive[#2]%
+ \else
+ \edef\currentadaptive{#2}%
+ \setupcurrentadaptive[#3]%
\fi
\edef\p_setups{\adaptiveparameter\c!setups}%
\dowithnextboxcontent
{\useadaptivestyleandcolor\c!foregroundstyle\c!foregroundcolor
- \ifcstok{\adaptiveparameter\c!strut}\v!yes\strut\fi % for now
- }
+ \ifcstok{\adaptiveparameter\c!strut}\v!yes
+ \ifcase#1%
+ \strut
+ \else
+ % maybe \begstrut .. \endstrut
+ \fi
+ \fi}
{\ifempty\p_setups
% there is no need for postprocessing
\else
@@ -86,17 +100,26 @@
\edef\p_stretch{\adaptiveparameter\c!stretch}%
\edef\p_shrink {\adaptiveparameter\c!shrink}%
\uleaders
- \hbox
- \s!spread \scratchdimen
- \bgroup
- \hss\box\nextbox\hss
- \egroup
- \hskip
+ \ifcase#1%
+ \hbox
+ \s!spread \scratchdimen
+ \bgroup
+ \hss\box\nextbox\hss
+ \egroup
+ \hskip
+ \else
+ \vbox
+ \s!spread \scratchdimen
+ \bgroup
+ \vss\box\nextbox\vss
+ \egroup
+ \vskip
+ \fi
\zeropoint
\s!plus \ifempty\p_stretch\scratchdimen\else\p_stretch\fi
\s!minus \ifempty\p_shrink \scratchdimen\else\p_shrink \fi
\endgroup}%
- \hbox}
+ \ifcase#1\hbox\else\vbox\fi}
%D Here is a test case, expect more:
%D
@@ -170,6 +193,24 @@
%D }
%D \blank
%D }
+%D
+%D \page
+%D
+%D \startsetups adaptive:test
+%D \setbox\usedadaptivebox\vbox to \usedadaptivetotal \bgroup
+%D \externalfigure
+%D [cow.pdf]
+%D [width=\usedadaptivewidth,
+%D height=\usedadaptivetotal]%
+%D \egroup
+%D \stopsetups
+%D
+%D \ruledvbox to \textheight {
+%D \par \begstrut \samplefile{tufte} \endstrut \par
+%D \adaptivevbox[strut=yes,setups=adaptive:test]{\hsize\textwidth\hss}
+%D \par \begstrut \samplefile{tufte} \endstrut
+%D }
+%D
%D \stoptyping
\protect
diff --git a/tex/context/base/mkxl/typo-bld.lmt b/tex/context/base/mkxl/typo-bld.lmt
index ae644d297..1a581e118 100644
--- a/tex/context/base/mkxl/typo-bld.lmt
+++ b/tex/context/base/mkxl/typo-bld.lmt
@@ -199,13 +199,13 @@ end)
nodes.builders = nodes.builder or { }
local builders = nodes.builders
-local vboxactions = nodes.tasks.actions("vboxbuilders")
+local vpackactions = nodes.tasks.actions("vboxbuilders")
function builders.vpack_filter(head,groupcode,size,packtype,maxdepth,direction)
local done = false
if head then
starttiming(builders)
- head, done = vboxactions(head,groupcode)
+ head, done = vpackactions(head,groupcode)
stoptiming(builders)
end
return head, done
@@ -249,6 +249,19 @@ end
registercallback('vpack_filter', builders.vpack_filter, "vertical spacing etc")
registercallback('buildpage_filter', builders.buildpage_filter, "vertical spacing etc (mvl)")
+local vboxactions = nodes.tasks.actions("vboxhandlers")
+
+function builders.vbox_filter(head,groupcode)
+ if head then
+ starttiming(builders)
+ head = vboxactions(head,groupcode)
+ stoptiming(builders)
+ end
+ return head
+end
+
+registercallback('packed_vbox_filter', builders.vbox_filter, "packed vbox treatments")
+
statistics.register("v-node processing time", function()
return statistics.elapsedseconds(builders)
end)
diff --git a/tex/context/interface/mkii/keys-ro.xml b/tex/context/interface/mkii/keys-ro.xml
index a2aa8bdd3..32b76a9f5 100644
--- a/tex/context/interface/mkii/keys-ro.xml
+++ b/tex/context/interface/mkii/keys-ro.xml
@@ -284,7 +284,6 @@
<cd:variable name='inright' value='indreapta'/>
<cd:variable name='inrightedge' value='inparteadreapta'/>
<cd:variable name='inrightmargin' value='inmargineadreapta'/>
- <cd:variable name='integral' value='integral'/>
<cd:variable name='interaction' value='interactiune'/>
<cd:variable name='interactionmenu' value='meniuinteractiune'/>
<cd:variable name='interactive' value='interactive'/>
@@ -648,6 +647,7 @@
<cd:constants>
<cd:constant name='action' value='actiune'/>
+ <cd:constant name='adaptive' value='adaptive'/>
<cd:constant name='address' value='adresa'/>
<cd:constant name='after' value='dupa'/>
<cd:constant name='afterhead' value='dupatitlu'/>
@@ -722,6 +722,7 @@
<cd:constant name='bottom' value='jos'/>
<cd:constant name='bottomafter' value='bottomafter'/>
<cd:constant name='bottombefore' value='bottombefore'/>
+ <cd:constant name='bottomcolor' value='bottomcolor'/>
<cd:constant name='bottomcommand' value='bottomcommand'/>
<cd:constant name='bottomdistance' value='distantajos'/>
<cd:constant name='bottomframe' value='framejos'/>
@@ -925,6 +926,7 @@
<cd:constant name='inputfile' value='inputfile'/>
<cd:constant name='insidesection' value='insidesection'/>
<cd:constant name='instance' value='instance'/>
+ <cd:constant name='integral' value='integral'/>
<cd:constant name='intent' value='intent'/>
<cd:constant name='interaction' value='interactiune'/>
<cd:constant name='interlinespace' value='spatiereinterliniara'/>
@@ -967,6 +969,7 @@
<cd:constant name='leftquote' value='minicitatstanga'/>
<cd:constant name='leftsample' value='leftsample'/>
<cd:constant name='leftsentence' value='propozitiestanga'/>
+ <cd:constant name='leftsource' value='leftsource'/>
<cd:constant name='leftspeech' value='leftspeech'/>
<cd:constant name='leftstyle' value='stilstanga'/>
<cd:constant name='leftsubsentence' value='subpropozitiestanga'/>
@@ -1013,6 +1016,7 @@
<cd:constant name='middle' value='mijloc'/>
<cd:constant name='middlecolor' value='middlecolor'/>
<cd:constant name='middlecommand' value='middlecommand'/>
+ <cd:constant name='middlesource' value='middlesource'/>
<cd:constant name='middlespeech' value='middlespeech'/>
<cd:constant name='middlestyle' value='middlestyle'/>
<cd:constant name='middletext' value='textmijloc'/>
@@ -1185,6 +1189,7 @@
<cd:constant name='rightquote' value='minicitatdreapta'/>
<cd:constant name='rightsample' value='rightsample'/>
<cd:constant name='rightsentence' value='propozitiedreapta'/>
+ <cd:constant name='rightsource' value='rightsource'/>
<cd:constant name='rightspeech' value='rightspeech'/>
<cd:constant name='rightstyle' value='stildreapta'/>
<cd:constant name='rightsubsentence' value='subpropozitiedreapta'/>
@@ -1320,6 +1325,7 @@
<cd:constant name='toffset' value='toffset'/>
<cd:constant name='tolerance' value='toleranta'/>
<cd:constant name='top' value='sus'/>
+ <cd:constant name='topcolor' value='topcolor'/>
<cd:constant name='topcommand' value='topcommand'/>
<cd:constant name='topdistance' value='distantasus'/>
<cd:constant name='topframe' value='framesus'/>
diff --git a/tex/context/modules/mkiv/m-escrito.lua b/tex/context/modules/mkiv/m-escrito.lua
index 8a45f1a2c..b284aece4 100644
--- a/tex/context/modules/mkiv/m-escrito.lua
+++ b/tex/context/modules/mkiv/m-escrito.lua
@@ -5499,21 +5499,23 @@ local function boundingbox (page)
for i=1,#page do
local object = page[i]
local p = object.path
- linewidth = object.type == "stroke" and object.linewidth
- for i=1,#p do
- local segment = p[i]
- local type = segment[1]
- if type == "lineto" then
- if startx then
- update_bbox(startx,starty)
+ if p then
+ linewidth = object.type == "stroke" and object.linewidth
+ for i=1,#p do
+ local segment = p[i]
+ local type = segment[1]
+ if type == "lineto" then
+ if startx then
+ update_bbox(startx,starty)
+ end
+ update_bbox(segment[2],segment[3])
+ elseif type == "curveto" then
+ local c6 = segment[6]
+ local c7 = segment[7]
+ splitter(0, 0, 1, startx, starty, segment[2], segment[3], segment[4], segment[5], c6, c7, startx, starty, c6, c7)
+ elseif type == "moveto" then
+ startx, starty = segment[2], segment[3]
end
- update_bbox(segment[2],segment[3])
- elseif type == "curveto" then
- local c6 = segment[6]
- local c7 = segment[7]
- splitter(0, 0, 1, startx, starty, segment[2], segment[3], segment[4], segment[5], c6, c7, startx, starty, c6, c7)
- elseif type == "moveto" then
- startx, starty = segment[2], segment[3]
end
end
end
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 2feb254cc..4f01e92df 100644
--- a/tex/generic/context/luatex/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
-- merged file : c:/data/develop/context/sources/luatex-fonts-merged.lua
-- parent file : c:/data/develop/context/sources/luatex-fonts.lua
--- merge date : 2022-04-15 20:13
+-- merge date : 2022-04-19 19:50
do -- begin closure to overcome local limits and interference