summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkiv')
-rw-r--r--tex/context/base/mkiv/anch-pos.lua10
-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/font-cft.lua1
-rw-r--r--tex/context/base/mkiv/font-con.lua45
-rw-r--r--tex/context/base/mkiv/font-dsp.lua12
-rw-r--r--tex/context/base/mkiv/font-otl.lua1
-rw-r--r--tex/context/base/mkiv/font-otr.lua1
-rw-r--r--tex/context/base/mkiv/grph-inc.lua4
-rw-r--r--tex/context/base/mkiv/l-table.lua32
-rw-r--r--tex/context/base/mkiv/math-ini.mkiv10
-rw-r--r--tex/context/base/mkiv/math-noa.lua10
-rw-r--r--tex/context/base/mkiv/mult-sys.mkiv2
-rw-r--r--tex/context/base/mkiv/node-rul.lua8
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin26589 -> 26595 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin268348 -> 268289 bytes
-rw-r--r--tex/context/base/mkiv/tabl-tbl.mkiv6
-rw-r--r--tex/context/base/mkiv/trac-vis.lua37
-rw-r--r--tex/context/base/mkiv/util-str.lua2
-rw-r--r--tex/context/base/mkiv/util-tab.lua24
20 files changed, 113 insertions, 96 deletions
diff --git a/tex/context/base/mkiv/anch-pos.lua b/tex/context/base/mkiv/anch-pos.lua
index ade992792..a0d2eee2c 100644
--- a/tex/context/base/mkiv/anch-pos.lua
+++ b/tex/context/base/mkiv/anch-pos.lua
@@ -401,7 +401,7 @@ end
-- use that one instead of a table (so, a 3rd / 4th argument: key, e.g. "x")
local function set(name,index,value) -- ,key
- local data = enhance(value or index)
+ local data = enhance(tobesaved[value or index])
if value then
container = tobesaved[name]
if not container then
@@ -420,7 +420,7 @@ local function setspec(specification)
local name = specification.name
local index = specification.index
local value = specification.value
- local data = enhance(value or index)
+ local data = enhance(tobesaved[value or index])
if value then
container = tobesaved[name]
if not container then
@@ -672,6 +672,7 @@ scanners.dosetposition = function() -- name
n = nofparagraphs > 0 and nofparagraphs or nil,
r2l = texgetcount("inlinelefttoright") == 1 or nil,
}
+ tobesaved[name] = spec
ctx_latelua { action = enhance, specification = spec }
end
@@ -692,6 +693,7 @@ scanners.dosetpositionwhd = function() -- name w h d extra
n = nofparagraphs > 0 and nofparagraphs or nil,
r2l = texgetcount("inlinelefttoright") == 1 or nil,
}
+ tobesaved[name] = spec
ctx_latelua { action = enhance, specification = spec }
end
@@ -711,6 +713,7 @@ scanners.dosetpositionbox = function() -- name box
n = nofparagraphs > 0 and nofparagraphs or nil,
r2l = texgetcount("inlinelefttoright") == 1 or nil,
}
+ tobesaved[name] = spec
ctx_latelua { action = enhance, specification = spec }
end
@@ -732,6 +735,7 @@ scanners.dosetpositionplus = function() -- name w h d extra
e = scanstring(),
r2l = texgetcount("inlinelefttoright") == 1 or nil,
}
+ tobesaved[name] = spec
ctx_latelua { action = enhance, specification = spec }
end
@@ -750,6 +754,7 @@ scanners.dosetpositionstrut = function() -- name
n = nofparagraphs > 0 and nofparagraphs or nil,
r2l = texgetcount("inlinelefttoright") == 1 or nil,
}
+ tobesaved[name] = spec
ctx_latelua { action = enhance, specification = spec }
end
@@ -770,6 +775,7 @@ scanners.dosetpositionstrutkind = function() -- name
n = nofparagraphs > 0 and nofparagraphs or nil,
r2l = texgetcount("inlinelefttoright") == 1 or nil,
}
+ tobesaved[name] = spec
ctx_latelua { action = enhance, specification = spec }
end
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index f8abf6fad..0b9988f29 100644
--- a/tex/context/base/mkiv/cont-new.mkiv
+++ b/tex/context/base/mkiv/cont-new.mkiv
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2019.02.22 19:35}
+\newcontextversion{2019.02.24 17:23}
%D This file is loaded at runtime, thereby providing an excellent place for
%D hacks, patches, extensions and new features.
diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv
index cd0170587..2dc6bc6f9 100644
--- a/tex/context/base/mkiv/context.mkiv
+++ b/tex/context/base/mkiv/context.mkiv
@@ -42,7 +42,7 @@
%D has to match \type {YYYY.MM.DD HH:MM} format.
\edef\contextformat {\jobname}
-\edef\contextversion{2019.02.22 19:35}
+\edef\contextversion{2019.02.24 17:23}
\edef\contextkind {beta}
%D Kind of special:
diff --git a/tex/context/base/mkiv/font-cft.lua b/tex/context/base/mkiv/font-cft.lua
index 2e1610f17..ee9ffa6a7 100644
--- a/tex/context/base/mkiv/font-cft.lua
+++ b/tex/context/base/mkiv/font-cft.lua
@@ -242,7 +242,6 @@ do
hasitalics = t_boolean,
autoitalicamount = t_float,
nostackmath = t_boolean,
- noglyphnames = t_boolean,
mode = t_string,
hasmath = t_boolean,
mathitalics = t_boolean,
diff --git a/tex/context/base/mkiv/font-con.lua b/tex/context/base/mkiv/font-con.lua
index 354fd4ac3..f0f2fb5a2 100644
--- a/tex/context/base/mkiv/font-con.lua
+++ b/tex/context/base/mkiv/font-con.lua
@@ -547,7 +547,6 @@ function constructors.scale(tfmdata,specification)
local hasitalics = properties.hasitalics
local autoitalicamount = properties.autoitalicamount
local stackmath = not properties.nostackmath
- local nonames = properties.noglyphnames
local haskerns = properties.haskerns or properties.mode == "base" -- we can have afm in node mode
local hasligatures = properties.hasligatures or properties.mode == "base" -- we can have afm in node mode
local realdimensions = properties.realdimensions
@@ -677,9 +676,10 @@ function constructors.scale(tfmdata,specification)
description = descriptions[unicode] or character
index = description.index or unicode
end
- local width = description.width
- local height = description.height
- local depth = description.depth
+ local width = description.width
+ local height = description.height
+ local depth = description.depth
+ local isunicode = description.unicode
if realdimensions then
-- this is mostly for checking issues
if not height or height == 0 then
@@ -706,16 +706,16 @@ function constructors.scale(tfmdata,specification)
-- if depth then depth = vdelta*depth else depth = scaleddepth end
if depth and depth ~= 0 then
depth = delta*depth
- if nonames then
+ if isunicode then
chr = {
- index = index,
- height = height,
- depth = depth,
- width = width,
+ index = index,
+ height = height,
+ depth = depth,
+ width = width,
+ unicode = unicode,
}
else
chr = {
- name = description.name,
index = index,
height = height,
depth = depth,
@@ -723,36 +723,23 @@ function constructors.scale(tfmdata,specification)
}
end
else
- -- this saves a little bit of memory time and memory, esp for big cjk fonts
- if nonames then
+ if isunicode then
chr = {
- index = index,
- height = height,
- width = width,
+ index = index,
+ height = height,
+ width = width,
+ unicode = unicode,
}
else
chr = {
- name = description.name,
index = index,
height = height,
width = width,
}
end
end
- local isunicode = description.unicode
if addtounicode then
- if isunicode then
- chr.unicode = isunicode
- chr.tounicode = tounicode(isunicode)
- -- in luatex > 0.85 we can do this:
- -- chr.tounicode = isunicode
- else
- chr.tounicode = unknowncode
- end
- else
- if isunicode then
- chr.unicode = isunicode
- end
+ chr.tounicode = isunicode and tounicode(isunicode) or unknowncode
end
if hasquality then
-- we could move these calculations elsewhere (saves calculations)
diff --git a/tex/context/base/mkiv/font-dsp.lua b/tex/context/base/mkiv/font-dsp.lua
index 046ba2850..f8bf6f2c8 100644
--- a/tex/context/base/mkiv/font-dsp.lua
+++ b/tex/context/base/mkiv/font-dsp.lua
@@ -3502,15 +3502,15 @@ function readers.avar(f,fontdata,specification)
local lastfrom = false
local lastto = false
for i=1,nofvalues do
- local f = read2dot14(f)
- local t = read2dot14(f)
- if lastfrom and f <= lastfrom then
+ local from = read2dot14(f)
+ local to = read2dot14(f)
+ if lastfrom and from <= lastfrom then
-- ignore
- elseif lastto and t >= lastto then
+ elseif lastto and to >= lastto then
-- ignore
else
- values[#values+1] = { f, t }
- lastfrom, lastto = f, t
+ values[#values+1] = { from, to }
+ lastfrom, lastto = from, to
end
end
nofvalues = #values
diff --git a/tex/context/base/mkiv/font-otl.lua b/tex/context/base/mkiv/font-otl.lua
index df83dc968..6e0939e76 100644
--- a/tex/context/base/mkiv/font-otl.lua
+++ b/tex/context/base/mkiv/font-otl.lua
@@ -495,7 +495,6 @@ local function copytotfm(data,cache_id)
properties.space = spacer
properties.encodingbytes = 2
properties.format = data.format or formats.otf
- properties.noglyphnames = true
properties.filename = filename
properties.fontname = fontname
properties.fullname = fullname
diff --git a/tex/context/base/mkiv/font-otr.lua b/tex/context/base/mkiv/font-otr.lua
index c7ff6b726..e851c3157 100644
--- a/tex/context/base/mkiv/font-otr.lua
+++ b/tex/context/base/mkiv/font-otr.lua
@@ -74,7 +74,6 @@ local lpegmatch = lpeg.match
local rshift = bit32.rshift
local setmetatableindex = table.setmetatableindex
-local formatters = string.formatters
local sortedkeys = table.sortedkeys
local sortedhash = table.sortedhash
local stripstring = string.nospaces
diff --git a/tex/context/base/mkiv/grph-inc.lua b/tex/context/base/mkiv/grph-inc.lua
index 1e5c30d44..e0ed8ab75 100644
--- a/tex/context/base/mkiv/grph-inc.lua
+++ b/tex/context/base/mkiv/grph-inc.lua
@@ -170,14 +170,14 @@ local imgembed = __img__.immediatewrite
if imgnew then
-- catch (actually we should be less picky in img)
- local __img__new__ = img_new
+ local __img__new__ = imgnew
imgnew = function(t)
t.kind = nil
return __img__new__(t)
end
end
-updaters.register("backend.update",function()
+updaters.register("backend.update.img",function()
local img = images.__img__
imgnew = img.new
imgscan = img.scan
diff --git a/tex/context/base/mkiv/l-table.lua b/tex/context/base/mkiv/l-table.lua
index 57130a50d..192347b06 100644
--- a/tex/context/base/mkiv/l-table.lua
+++ b/tex/context/base/mkiv/l-table.lua
@@ -153,24 +153,24 @@ local function sortedkeys(tab)
for key in next, tab do
s = s + 1
srt[s] = key
- if category == 3 then
- -- no further check
- elseif category == 1 then
- if type(key) ~= "string" then
- category = 3
- end
- elseif category == 2 then
- if type(key) ~= "number" then
- category = 3
- end
- else
+ if category ~= 3 then
local tkey = type(key)
- if tkey == "string" then
- category = 1
- elseif tkey == "number" then
- category = 2
+ if category == 1 then
+ if tkey ~= "string" then
+ category = 3
+ end
+ elseif category == 2 then
+ if tkey ~= "number" then
+ category = 3
+ end
else
- category = 3
+ if tkey == "string" then
+ category = 1
+ elseif tkey == "number" then
+ category = 2
+ else
+ category = 3
+ end
end
end
end
diff --git a/tex/context/base/mkiv/math-ini.mkiv b/tex/context/base/mkiv/math-ini.mkiv
index 50da1a400..bf956c41c 100644
--- a/tex/context/base/mkiv/math-ini.mkiv
+++ b/tex/context/base/mkiv/math-ini.mkiv
@@ -436,6 +436,16 @@
% if there were many features we could have a feature pass over math nodes but it makes no
% sense now so we have commands to deal with it
+% \enabletrackers[math.alternates]
+% \setupbodyfont[lucidaot]
+%
+% \startTEXpage
+% \setupmathematics[stylealternative={reset}]$x+\mathcal A$\par
+% \setupmathematics[stylealternative={reset,calligraphic}]$x+\mathcal A$\par
+% \setupmathematics[stylealternative={reset,italic}]$x+\mathcal A$\par
+% \setupmathematics[stylealternative={reset,calligraphic,italic}]$x+\mathcal A$
+% \stopTEXpage
+
\unexpanded\def\mathaltcalligraphic{\math_set_font_alternate{calligraphic}\cal} % set via goody file
\unexpanded\def\mathaltitalic {\math_set_font_alternate{italic}} % set via goody file
\unexpanded\def\mathslashedzero {\begingroup\math_set_font_alternate{zero}∅\endgroup} % set via goody file or automatic
diff --git a/tex/context/base/mkiv/math-noa.lua b/tex/context/base/mkiv/math-noa.lua
index ea7583587..376767227 100644
--- a/tex/context/base/mkiv/math-noa.lua
+++ b/tex/context/base/mkiv/math-noa.lua
@@ -1336,7 +1336,7 @@ do
local resets = mathalternates.resets
attribute = presets[tag]
if not attribute then
- attribute = 0
+ attribute = 0
local alternates = mathalternates.alternates
for s in gmatch(tag,"[^, ]+") do
if s == v_reset then
@@ -1410,13 +1410,15 @@ do
alt = otf.getalternate(fontdata[fontid],char,what.feature,what.value) or false
if alt == char then
alt = false
- elseif trace_alternates then
- report_alternates("alternate %a, value %a, replacing glyph %U by glyph %U",
- tostring(what.feature),tostring(what.value),getchar(pointer),alt)
end
hashes[i][char] = alt
end
if alt then
+ if trace_alternates then
+ local what = attributes[r]
+ report_alternates("alternate %a, value %a, replacing glyph %U by glyph %U",
+ tostring(what.feature),tostring(what.value),getchar(pointer),alt)
+ end
setchar(pointer,alt)
break
end
diff --git a/tex/context/base/mkiv/mult-sys.mkiv b/tex/context/base/mkiv/mult-sys.mkiv
index fdb2ea732..ae0214bd6 100644
--- a/tex/context/base/mkiv/mult-sys.mkiv
+++ b/tex/context/base/mkiv/mult-sys.mkiv
@@ -454,6 +454,8 @@
\definesystemconstant {left}
\definesystemconstant {middle}
\definesystemconstant {right}
+\definesystemconstant {xoffset}
+\definesystemconstant {yoffset}
%D As the name of their define command states, the next set of constants is used in
%D the message macro's.
diff --git a/tex/context/base/mkiv/node-rul.lua b/tex/context/base/mkiv/node-rul.lua
index ea0e5c7a0..1f79a5633 100644
--- a/tex/context/base/mkiv/node-rul.lua
+++ b/tex/context/base/mkiv/node-rul.lua
@@ -48,6 +48,7 @@ local setattrlist = nuts.setattrlist
local setshift = nuts.setshift
local getwidth = nuts.getwidth
local setwidth = nuts.setwidth
+local setoffsets = nuts.setoffsets
local setfield = nuts.setfield
local isglyph = nuts.isglyph
@@ -754,19 +755,22 @@ interfaces.implement {
{ "width", "dimension" },
{ "height", "dimension" },
{ "depth", "dimension" },
+ { "xoffset", "dimension" },
+ { "yoffset", "dimension" },
{ "left", "dimension" },
{ "right", "dimension" },
},
},
actions = function(t)
- local l = t.left
- local r = t.right
local n = new_rule(
t.width,
t.height,
t.depth
)
setattrlist(n,true)
+ setoffsets(n,t.xoffset,t.yoffset)
+ local l = t.left
+ local r = t.right
if l then
setfield(n,"left",l)
end
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index 49b023fb8..044097573 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 8cbd7014c..b14d35490 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/mkiv/tabl-tbl.mkiv b/tex/context/base/mkiv/tabl-tbl.mkiv
index 75839caed..f3c2e2e10 100644
--- a/tex/context/base/mkiv/tabl-tbl.mkiv
+++ b/tex/context/base/mkiv/tabl-tbl.mkiv
@@ -1670,9 +1670,9 @@
\def\tabl_tabulate_hrule_inject_normal
{\autorule
- \s!height .5\d_tabl_tabulate_hrulethickness_local
- \s!depth .5\d_tabl_tabulate_hrulethickness_local
- \s!left \d_tabl_tabulate_indent
+ \s!height.5\d_tabl_tabulate_hrulethickness_local
+ \s!depth .5\d_tabl_tabulate_hrulethickness_local
+ \s!left \d_tabl_tabulate_indent
\relax}
\def\tabl_tabulate_hrule_inject_colored
diff --git a/tex/context/base/mkiv/trac-vis.lua b/tex/context/base/mkiv/trac-vis.lua
index b61dadb51..4dc3bd03b 100644
--- a/tex/context/base/mkiv/trac-vis.lua
+++ b/tex/context/base/mkiv/trac-vis.lua
@@ -1210,6 +1210,7 @@ do
prev_trace_fontkern = trace_fontkern
prev_trace_italic = trace_italic
prev_trace_expansion = trace_expansion
+ attr = a
if a == unsetvalue then
trace_hbox = false
trace_vbox = false
@@ -1231,6 +1232,7 @@ do
trace_line = false
trace_space = false
trace_depth = false
+ goto list
else -- dead slow:
-- cache[a]()
trace_hbox = band(a, 1) ~= 0
@@ -1254,7 +1256,8 @@ do
trace_space = band(a,262144) ~= 0
trace_depth = band(a,524288) ~= 0
end
- attr = a
+ elseif a == unsetvalue then
+ goto list
end
if trace_strut then
setattr(current,a_layer,l_strut)
@@ -1313,7 +1316,24 @@ do
if trace_penalty then
head, current = ruledpenalty(head,current,vertical)
end
- elseif id == hlist_code then
+ elseif id == hlist_code or id == vlist_code then
+ goto list
+ elseif id == whatsit_code then
+ if trace_whatsit then
+ head, current = whatsit(head,current)
+ end
+ elseif id == user_code then
+ if trace_user then
+ head, current = user(head,current)
+ end
+ elseif id == math_code then
+ if trace_math then
+ head, current = math(head,current)
+ end
+ end
+ goto next
+ ::list::
+ if id == hlist_code then
local content = getlist(current)
if content then
setlist(current,visualize(content,false,nil,current))
@@ -1336,19 +1356,8 @@ do
elseif trace_vbox then
head, current = ruledbox(head,current,true,l_vbox,"__V",trace_simple,previous,trace_origin,parent)
end
- elseif id == whatsit_code then
- if trace_whatsit then
- head, current = whatsit(head,current)
- end
- elseif id == user_code then
- if trace_user then
- head, current = user(head,current)
- end
- elseif id == math_code then
- if trace_math then
- head, current = math(head,current)
- end
end
+ ::next::
previous = current
current = getnext(current)
end
diff --git a/tex/context/base/mkiv/util-str.lua b/tex/context/base/mkiv/util-str.lua
index 713c294eb..5f175e227 100644
--- a/tex/context/base/mkiv/util-str.lua
+++ b/tex/context/base/mkiv/util-str.lua
@@ -745,7 +745,7 @@ end
local format_k = function(b,a) -- slow
n = n + 1
- return format("formattedfloat(a%s,%i,%i)",n,b or 0, a or 0)
+ return format("formattedfloat(a%s,%s,%s)",n,b or 0,a or 0)
end
local format_g = function(f)
diff --git a/tex/context/base/mkiv/util-tab.lua b/tex/context/base/mkiv/util-tab.lua
index b51c6589a..be5f1318c 100644
--- a/tex/context/base/mkiv/util-tab.lua
+++ b/tex/context/base/mkiv/util-tab.lua
@@ -335,7 +335,6 @@ function table.fastserialize(t,prefix)
local r = { type(prefix) == "string" and prefix or "return" }
local m = 1
-
local function fastserialize(t,outer) -- no mixes
local n = #t
m = m + 1
@@ -655,19 +654,20 @@ local function serialize(root,name,specification)
-- we could check for k (index) being number (cardinal)
if root and next(root) ~= nil then
local first = nil
- local last = 0
- last = #root
- for k=1,last do
- if rawget(root,k) == nil then
- -- if root[k] == nil then
- last = k - 1
- break
- end
- end
+ local last = #root
if last > 0 then
- first = 1
+ for k=1,last do
+ if rawget(root,k) == nil then
+ -- if root[k] == nil then
+ last = k - 1
+ break
+ end
+ end
+ if last > 0 then
+ first = 1
+ end
end
- local sk = sortedkeys(root) -- inline fast version?\
+ local sk = sortedkeys(root)
for i=1,#sk do
local k = sk[i]
local v = root[k]