summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2019-03-23 23:12:42 +0100
committerContext Git Mirror Bot <phg@phi-gamma.net>2019-03-23 23:12:42 +0100
commit15c9a0a54f08ffc9fb72d6d878db4602ac6e1ca2 (patch)
tree19f4f5a061de3fe14f8e990437c69f740026e9a1 /tex
parentb958bba841f9907582f3c5fa4b6162353636fc8f (diff)
downloadcontext-15c9a0a54f08ffc9fb72d6d878db4602ac6e1ca2.tar.gz
2019-03-21 21:47:00current
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/mkiv/char-ini.mkiv32
-rw-r--r--tex/context/base/mkiv/cldf-ini.lua4
-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/data-exp.lua6
-rw-r--r--tex/context/base/mkiv/data-tmp.lua6
-rw-r--r--tex/context/base/mkiv/data-zip.lua99
-rw-r--r--tex/context/base/mkiv/font-lib.mkvi1
-rw-r--r--tex/context/base/mkiv/font-one.lua2
-rw-r--r--tex/context/base/mkiv/font-osd.lua6
-rw-r--r--tex/context/base/mkiv/font-syn.lua21
-rw-r--r--tex/context/base/mkiv/grph-inc.lua14
-rw-r--r--tex/context/base/mkiv/l-dir.lua31
-rw-r--r--tex/context/base/mkiv/l-file.lua77
-rw-r--r--tex/context/base/mkiv/l-lua.lua3
-rw-r--r--tex/context/base/mkiv/l-os.lua16
-rw-r--r--tex/context/base/mkiv/lang-dis.lua1
-rw-r--r--tex/context/base/mkiv/lpdf-col.lua3
-rw-r--r--tex/context/base/mkiv/lpdf-pde.lua14
-rw-r--r--tex/context/base/mkiv/luat-fmt.lua7
-rw-r--r--tex/context/base/mkiv/luat-lib.mkiv4
-rw-r--r--tex/context/base/mkiv/luat-run.lua5
-rw-r--r--tex/context/base/mkiv/mlib-run.lua7
-rw-r--r--tex/context/base/mkiv/mtx-context-listing.tex8
-rw-r--r--tex/context/base/mkiv/node-met.lua163
-rw-r--r--tex/context/base/mkiv/node-pro.lua23
-rw-r--r--tex/context/base/mkiv/node-tsk.lua7
-rw-r--r--tex/context/base/mkiv/publ-imp-apa.mkvi24
-rw-r--r--tex/context/base/mkiv/publ-imp-aps.mkvi14
-rw-r--r--tex/context/base/mkiv/publ-imp-commands.mkvi2
-rw-r--r--tex/context/base/mkiv/publ-imp-default.mkvi22
-rw-r--r--tex/context/base/mkiv/spac-hor.mkiv2
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin26602 -> 26606 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin268486 -> 265935 bytes
-rw-r--r--tex/context/base/mkiv/symb-ini.mkiv14
-rw-r--r--tex/context/base/mkiv/trac-log.lua2
-rw-r--r--tex/context/base/mkiv/typo-mar.lua2
-rw-r--r--tex/context/base/mkiv/util-fil.lua157
-rw-r--r--tex/context/base/mkiv/util-sac.lua16
-rw-r--r--tex/context/base/mkiv/util-soc-imp-mime.lua4
-rw-r--r--tex/context/base/mkiv/util-soc-imp-socket.lua2
-rw-r--r--tex/context/base/mkiv/util-str.lua1
-rw-r--r--tex/context/base/mkiv/util-tab.lua3
-rw-r--r--tex/context/interface/mkiv/i-context.pdfbin865375 -> 865151 bytes
-rw-r--r--tex/context/interface/mkiv/i-readme.pdfbin61161 -> 61161 bytes
-rw-r--r--tex/context/modules/mkiv/m-chart.lua4
-rw-r--r--tex/context/sample/third/aristotle-grc.tex13
-rw-r--r--tex/context/sample/third/capek-cz.tex13
-rw-r--r--tex/context/sample/third/capek-vlnka-cz.tex13
-rw-r--r--tex/context/sample/third/dequincey.tex5
-rw-r--r--tex/context/sample/third/dyrynk-cz.tex22
-rw-r--r--tex/context/sample/third/dyrynk-vlnka-cz.tex23
-rw-r--r--tex/context/sample/third/kollar-cz.tex31
-rw-r--r--tex/context/sample/third/kollar-vlnka-cz.tex30
-rw-r--r--tex/context/sample/third/komensky-cz.tex33
-rw-r--r--tex/context/sample/third/komensky-vlnka-cz.tex33
-rw-r--r--tex/context/sample/third/krdel-sk.tex7
-rw-r--r--tex/context/sample/third/kun-cz.tex7
-rw-r--r--tex/generic/context/luatex/luatex-basics-nod.lua140
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua224
62 files changed, 972 insertions, 459 deletions
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii
index faa50ce78..a1981921b 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{2019.03.05 15:40}
+\newcontextversion{2019.03.21 21:39}
%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 c0e856845..a6f8647ee 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{2019.03.05 15:40}
+\edef\contextversion{2019.03.21 21:39}
%D For those who want to use this:
diff --git a/tex/context/base/mkiv/char-ini.mkiv b/tex/context/base/mkiv/char-ini.mkiv
index 0519aaf91..5979b8685 100644
--- a/tex/context/base/mkiv/char-ini.mkiv
+++ b/tex/context/base/mkiv/char-ini.mkiv
@@ -57,14 +57,34 @@
\unexpanded\def\checkedtextchar#1% #2%
{\clf_doifelsecharinfont\numexpr#1\relax{\char#1}} % {#2}
+% \unexpanded\def\textormathchar#1%
+% {\relax\ifmmode
+% \char#1\relax
+% \else\iffontchar\font#1\relax
+% \char#1\relax
+% \else
+% \normalstartimath\char#1\normalstopimath
+% \fi\fi}
+
+\newconditional\prefermathovertextchar
+
\unexpanded\def\textormathchar#1%
- {\relax\ifmmode
- \char#1\relax
- \else\iffontchar\font#1\relax
- \char#1\relax
+ {\begingroup
+ \scratchcounter#1\relax
+ \ifmmode
+ \char\scratchcounter
\else
- \normalstartimath\char#1\normalstopimath
- \fi\fi}
+ \ifconditional\prefermathovertextchar
+ % dirty trick .. maybe let this adapt to bf too ?
+ \setfontid\fontid\textfont\c_font_fam_mr
+ \fi
+ \iffontchar\font\scratchcounter
+ \char\scratchcounter
+ \else
+ \normalstartimath\char\scratchcounter\normalstopimath
+ \fi
+ \fi
+ \endgroup}
\unexpanded\def\textormathchars#1%
{{\font_text_or_mathchars#1\relax}}
diff --git a/tex/context/base/mkiv/cldf-ini.lua b/tex/context/base/mkiv/cldf-ini.lua
index ccbbb2454..15ebc9d95 100644
--- a/tex/context/base/mkiv/cldf-ini.lua
+++ b/tex/context/base/mkiv/cldf-ini.lua
@@ -793,7 +793,7 @@ local function writer(parent,command,...) -- already optimized before call
tj = storefunction(tj)
if tokenflushmode then
if newtoken then
- flush(currentcatcodes,"[",newtoken(tj,lua_expandable_call_code),"]")
+ flush(currentcatcodes,"[",newtoken(tj,lua_expandable_call_token_code),"]")
else
flush(currentcatcodes,"[",t_cldl_luafunction,tj,"]")
end
@@ -811,7 +811,7 @@ local function writer(parent,command,...) -- already optimized before call
tj = storefunction(tj)
if tokenflushmode then
if newtoken then
- flush(currentcatcodes,"[",newtoken(tj,lua_expandable_call_code),j == tn and "]" or ",")
+ flush(currentcatcodes,"[",newtoken(tj,lua_expandable_call_token_code),j == tn and "]" or ",")
else
flush(currentcatcodes,"[",t_cldl_luafunction,tj,j == tn and "]" or ",")
end
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index 913fa747f..f75814652 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.03.05 15:40}
+\newcontextversion{2019.03.21 21:39}
%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 81558c98a..4059a2975 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.03.05 15:40}
+\edef\contextversion{2019.03.21 21:39}
\edef\contextkind {beta}
%D Kind of special:
diff --git a/tex/context/base/mkiv/data-exp.lua b/tex/context/base/mkiv/data-exp.lua
index 76fd3c7b0..ce7f95222 100644
--- a/tex/context/base/mkiv/data-exp.lua
+++ b/tex/context/base/mkiv/data-exp.lua
@@ -344,9 +344,11 @@ local function scan(files,remap,spec,path,n,m,r,onlyone,tolerant)
local pattern = tolerant and lessweird or weird
local filelist = { }
local noffiles = 0
- for name in directory(full) do
+ for name, mode in directory(full) do
if not lpegmatch(pattern,name) then
- local mode = attributes(full..name,"mode")
+ if not mode then
+ mode = attributes(full..name,"mode")
+ end
if mode == "file" then
n = n + 1
noffiles = noffiles + 1
diff --git a/tex/context/base/mkiv/data-tmp.lua b/tex/context/base/mkiv/data-tmp.lua
index 948827161..d25a6b2f9 100644
--- a/tex/context/base/mkiv/data-tmp.lua
+++ b/tex/context/base/mkiv/data-tmp.lua
@@ -68,6 +68,8 @@ caches.ask = false
caches.relocate = false
caches.defaults = { "TMPDIR", "TEMPDIR", "TMP", "TEMP", "HOME", "HOMEPATH" }
+directives.register("system.caches.fast",function(v) caches.fast = true end)
+
local writable, readables, usedreadables = nil, { }, { }
-- we could use a metatable for writable and readable but not yet
@@ -364,7 +366,9 @@ local saveoptions = { compact = true }
function caches.savedata(filepath,filename,data,raw)
local tmaname, tmcname = caches.setluanames(filepath,filename)
data.cache_uuid = os.uuid()
- if caches.direct then
+ if caches.fast then
+ file.savedata(tmaname,table.fastserialize(data,true))
+ elseif caches.direct then
file.savedata(tmaname,table.serialize(data,true,saveoptions))
else
table.tofile(tmaname,data,true,saveoptions)
diff --git a/tex/context/base/mkiv/data-zip.lua b/tex/context/base/mkiv/data-zip.lua
index 6f20b4a9d..388ae0c10 100644
--- a/tex/context/base/mkiv/data-zip.lua
+++ b/tex/context/base/mkiv/data-zip.lua
@@ -37,6 +37,81 @@ zip.archives = archives
local registeredfiles = zip.registeredfiles or { }
zip.registeredfiles = registeredfiles
+local zipfiles = utilities.zipfiles
+
+local openzip, closezip, validfile, wholefile, filehandle, traversezip
+
+if zipfiles then
+
+ local ipairs = ipairs
+
+ openzip = zipfiles.open
+ closezip = zipfiles.close
+ validfile = zipfiles.found
+ wholefile = zipfiles.unzip
+
+ traversezip = function(zfile)
+ return ipairs(zipfiles.list(zfile))
+ end
+
+ local streams = utilities.streams
+ local openstream = streams.open
+ local readstring = streams.readstring
+ local streamsize = streams.size
+
+ local metatable = {
+ close = streams.close,
+ read = function(stream,n)
+ readstring(stream,n == "*a" and streamsize(stream) or n)
+ end
+ }
+
+ filehandle = function(zfile,queryname)
+ local data = wholefile(zfile,queryname)
+ if data then
+ local stream = openstream(data)
+ if stream then
+ return setmetatableindex(stream,metatable)
+ end
+ end
+ end
+
+else
+
+ openzip = zip.open
+ closezip = zip.close
+
+ validfile = function(zfile,queryname)
+ local dfile = zfile:open(queryname)
+ if dfile then
+ dfile:close()
+ return true
+ end
+ return false
+ end
+
+ traversezip = function(zfile)
+ return z:files()
+ end
+
+ wholefile = function(zfile,queryname)
+ local dfile = zfile:open(queryname)
+ if dfile then
+ local s = dfile:read("*all")
+ dfile:close()
+ return s
+ end
+ end
+
+ filehandle = function(zfile,queryname)
+ local dfile = zfile:open(queryname)
+ if dfile then
+ return dfile
+ end
+ end
+
+end
+
local function validzip(str) -- todo: use url splitter
if not find(str,"^zip://") then
return "zip:///" .. str
@@ -52,7 +127,7 @@ function zip.openarchive(name)
local arch = archives[name]
if not arch then
local full = resolvers.findfile(name) or ""
- arch = full ~= "" and zip.open(full) or false
+ arch = full ~= "" and openzip(full) or false
archives[name] = arch
end
return arch
@@ -61,7 +136,7 @@ end
function zip.closearchive(name)
if not name or (name == "" and archives[name]) then
- zip.close(archives[name])
+ closezip(archives[name])
archives[name] = nil
end
end
@@ -106,9 +181,7 @@ function resolvers.finders.zip(specification)
if trace_locating then
report_zip("finder: archive %a found",archive)
end
- local dfile = zfile:open(queryname)
- if dfile then
- dfile:close()
+ if validfile(zfile,queryname) then
if trace_locating then
report_zip("finder: file %a found",queryname)
end
@@ -139,12 +212,12 @@ function resolvers.openers.zip(specification)
if trace_locating then
report_zip("opener; archive %a opened",archive)
end
- local dfile = zfile:open(queryname)
- if dfile then
+ local handle = filehandle(zfile,queryname)
+ if handle then
if trace_locating then
report_zip("opener: file %a found",queryname)
end
- return resolvers.openers.helpers.textopener('zip',original,dfile)
+ return resolvers.openers.helpers.textopener('zip',original,handle)
elseif trace_locating then
report_zip("opener: file %a not found",queryname)
end
@@ -171,15 +244,13 @@ function resolvers.loaders.zip(specification)
if trace_locating then
report_zip("loader: archive %a opened",archive)
end
- local dfile = zfile:open(queryname)
- if dfile then
+ local data = wholefile(zfile,queryname)
+ if data then
logs.show_load(original)
if trace_locating then
report_zip("loader; file %a loaded",original)
end
- local s = dfile:read("*all")
- dfile:close()
- return true, s, #s
+ return true, data, #data
elseif trace_locating then
report_zip("loader: file %a not found",queryname)
end
@@ -231,7 +302,7 @@ function resolvers.registerzipfile(z,tree)
if trace_locating then
report_zip("registering: using filter %a",filter)
end
- for i in z:files() do
+ for i in traversezip(z) do
local filename = i.filename
local path, name = match(filename,filter)
if not path then
diff --git a/tex/context/base/mkiv/font-lib.mkvi b/tex/context/base/mkiv/font-lib.mkvi
index 3cff81751..081ae0f38 100644
--- a/tex/context/base/mkiv/font-lib.mkvi
+++ b/tex/context/base/mkiv/font-lib.mkvi
@@ -50,6 +50,7 @@
\registerctxluafile{font-otc}{}
\registerctxluafile{font-oth}{}
\registerctxluafile{font-osd}{}
+% \doifelsefileexists{font-osm.lua}{\registerctxluafile{font-osm}{}}{}
\registerctxluafile{font-ocl}{}
% we use otf code for type one
diff --git a/tex/context/base/mkiv/font-one.lua b/tex/context/base/mkiv/font-one.lua
index 18ba51185..9b296cac5 100644
--- a/tex/context/base/mkiv/font-one.lua
+++ b/tex/context/base/mkiv/font-one.lua
@@ -761,7 +761,7 @@ local function check_afm(specification,fullname)
if foundname == "" then
foundname = fonts.names.getfilename(fullname,"afm") or ""
end
- if foundname == "" and afm.autoprefixed then
+ if fullname and foundname == "" and afm.autoprefixed then
local encoding, shortname = match(fullname,"^(.-)%-(.*)$") -- context: encoding-name.*
if encoding and shortname and fonts.encodings.known[encoding] then
shortname = findbinfile(shortname,'afm') or "" -- just to be sure
diff --git a/tex/context/base/mkiv/font-osd.lua b/tex/context/base/mkiv/font-osd.lua
index 32d791b48..f51ae7bf7 100644
--- a/tex/context/base/mkiv/font-osd.lua
+++ b/tex/context/base/mkiv/font-osd.lua
@@ -615,6 +615,8 @@ local function initializedevanagi(tfmdata)
end
end
--
+ -- needs checking: this might be needed per instance ?
+ --
if script == "deva" then
sharedfeatures["dv04"] = true -- dv04_remove_joiners
elseif script == "dev2" then
@@ -689,7 +691,7 @@ local function initialize_one(font,attr) -- we need a proper hook into the datas
if not devanagaridata then
- devanagaridata = {
+ devanagaridata = {
reph = false,
vattu = false,
blwfcache = { },
@@ -1329,7 +1331,7 @@ end
function handlers.devanagari_remove_joiners(head,start,kind,lookupname,replacement)
local stop = getnext(start)
- local font = getfont(start)
+ local font = getfont(start) -- hm
local last = start
while stop do
local char = ischar(stop,font)
diff --git a/tex/context/base/mkiv/font-syn.lua b/tex/context/base/mkiv/font-syn.lua
index dfe32b57b..18c25fbfd 100644
--- a/tex/context/base/mkiv/font-syn.lua
+++ b/tex/context/base/mkiv/font-syn.lua
@@ -515,15 +515,20 @@ local function cleanname(name)
end
local function cleanfilename(fullname,defaultsuffix)
- local path, name, suffix = splitname(fullname)
- name = gsub(lower(name),"[^%a%d]","")
- if suffix and suffix ~= "" then
- return name .. ".".. suffix
- elseif defaultsuffix and defaultsuffix ~= "" then
- return name .. ".".. defaultsuffix
- else
- return name
+ if fullname then
+ local path, name, suffix = splitname(fullname)
+ if name then
+ name = gsub(lower(name),"[^%a%d]","")
+ if suffix and suffix ~= "" then
+ return name .. ".".. suffix
+ elseif defaultsuffix and defaultsuffix ~= "" then
+ return name .. ".".. defaultsuffix
+ else
+ return name
+ end
+ end
end
+ return "badfontname"
end
local sorter = function(a,b)
diff --git a/tex/context/base/mkiv/grph-inc.lua b/tex/context/base/mkiv/grph-inc.lua
index f66f8249a..0856e0de9 100644
--- a/tex/context/base/mkiv/grph-inc.lua
+++ b/tex/context/base/mkiv/grph-inc.lua
@@ -1611,15 +1611,15 @@ function includers.generic(data)
ds.pageindex = nofimages
local image = wrapimage(figure)
local pager = new_latelua { action = updatepage, n = nofimages }
- image.next = pager
- pager.prev = image
- local box = hpack(image)
- -- indexed[figure.index] = figure
- box.width = figure.width
- box.height = figure.height
- box.depth = 0
+ image.next = pager
+ pager.prev = image
+ local box = hpack(image)
+ box.width = figure.width
+ box.height = figure.height
+ box.depth = 0
texsetbox(nr,box)
ds.objectnumber = figure.objnum
+ -- indexed[figure.index] = figure
ctx_relocateexternalfigure()
end
return data
diff --git a/tex/context/base/mkiv/l-dir.lua b/tex/context/base/mkiv/l-dir.lua
index b0b2c5283..325039cb1 100644
--- a/tex/context/base/mkiv/l-dir.lua
+++ b/tex/context/base/mkiv/l-dir.lua
@@ -91,13 +91,15 @@ local function glob_pattern_function(path,patt,recurse,action)
end
local dirs
local nofdirs = 0
- for name in walkdir(usedpath) do
+ for name, mode, size, time in walkdir(usedpath) do
if name ~= "." and name ~= ".." then
local full = path .. name
- local mode = attributes(full,'mode')
+ if mode == nil then
+ mode = attributes(full,'mode')
+ end
if mode == 'file' then
if not patt or find(full,patt) then
- action(full)
+ action(full,size,time)
end
elseif recurse and mode == "directory" then
if dirs then
@@ -134,10 +136,12 @@ local function glob_pattern_table(path,patt,recurse,result)
local dirs
local nofdirs = 0
local noffiles = #result
- for name, a in walkdir(usedpath) do
+ for name, mode in walkdir(usedpath) do
if name ~= "." and name ~= ".." then
local full = path .. name
- local mode = attributes(full,'mode')
+ if mode == nil then
+ mode = attributes(full,'mode')
+ end
if mode == 'file' then
if not patt or find(full,patt) then
noffiles = noffiles + 1
@@ -193,7 +197,7 @@ local function collectpattern(path,patt,recurse,result)
if not find(path,"/$") then
path = path .. '/'
end
- for name in scanner, first do
+ for name in scanner, first do -- cna be optimized
if name == "." then
-- skip
elseif name == ".." then
@@ -321,11 +325,13 @@ local function globfiles(path,recurse,func,files) -- func == pattern or function
end
files = files or { }
local noffiles = #files
- for name in walkdir(path) do
+ for name, mode in walkdir(path) do
if find(name,"^%.") then
--- skip
else
- local mode = attributes(name,'mode')
+ if mode == nil then
+ mode = attributes(name,'mode')
+ end
if mode == "directory" then
if recurse then
globfiles(path .. "/" .. name,recurse,func,files)
@@ -350,11 +356,13 @@ local function globdirs(path,recurse,func,files) -- func == pattern or function
end
files = files or { }
local noffiles = #files
- for name in walkdir(path) do
+ for name, mode in walkdir(path) do
if find(name,"^%.") then
--- skip
else
- local mode = attributes(name,'mode')
+ if mode == nil then
+ mode = attributes(name,'mode')
+ end
if mode == "directory" then
if not func or func(name) then
noffiles = noffiles + 1
@@ -597,8 +605,7 @@ local stack = { }
function dir.push(newdir)
local curdir = currentdir()
insert(stack,curdir)
- if newdir and newdir ~= "" then
- chdir(newdir)
+ if newdir and newdir ~= "" and chdir(newdir) then
return newdir
else
return curdir
diff --git a/tex/context/base/mkiv/l-file.lua b/tex/context/base/mkiv/l-file.lua
index 46b6847d3..1b039a438 100644
--- a/tex/context/base/mkiv/l-file.lua
+++ b/tex/context/base/mkiv/l-file.lua
@@ -73,13 +73,9 @@ local P, R, S, C, Cs, Cp, Cc, Ct = lpeg.P, lpeg.R, lpeg.S, lpeg.C, lpeg.Cs, lpeg
-- better this way:
------ tricky = S("/\\") * P(-1)
local attributes = lfs.attributes
function lfs.isdir(name)
- -- if not lpegmatch(tricky,name) then
- -- name = name .. "/."
- -- end
return attributes(name,"mode") == "directory"
end
@@ -336,43 +332,52 @@ end
-- But after some testing Taco and I came up with the more robust
-- variant:
-function file.is_writable(name)
- if not name then
- -- error
- elseif lfs.isdir(name) then
- name = name .. "/m_t_x_t_e_s_t.tmp"
- local f = io.open(name,"wb")
- if f then
- f:close()
- os.remove(name)
- return true
- end
- elseif lfs.isfile(name) then
- local f = io.open(name,"ab")
- if f then
- f:close()
- return true
- end
- else
- local f = io.open(name,"ab")
- if f then
- f:close()
- os.remove(name)
- return true
+if lfs.isreadablefile and lfs.iswritablefile then
+
+ file.is_readable = lfs.isreadablefile
+ file.is_writable = lfs.iswritablefile
+
+else
+
+ function file.is_writable(name)
+ if not name then
+ -- error
+ elseif lfs.isdir(name) then
+ name = name .. "/m_t_x_t_e_s_t.tmp"
+ local f = io.open(name,"wb")
+ if f then
+ f:close()
+ os.remove(name)
+ return true
+ end
+ elseif lfs.isfile(name) then
+ local f = io.open(name,"ab")
+ if f then
+ f:close()
+ return true
+ end
+ else
+ local f = io.open(name,"ab")
+ if f then
+ f:close()
+ os.remove(name)
+ return true
+ end
end
+ return false
end
- return false
-end
-local readable = P("r") * Cc(true)
+ local readable = P("r") * Cc(true)
-function file.is_readable(name)
- if name then
- local a = attributes(name)
- return a and lpegmatch(readable,a.permissions) or false
- else
- return false
+ function file.is_readable(name)
+ if name then
+ local a = attributes(name)
+ return a and lpegmatch(readable,a.permissions) or false
+ else
+ return false
+ end
end
+
end
file.isreadable = file.is_readable -- depricated
diff --git a/tex/context/base/mkiv/l-lua.lua b/tex/context/base/mkiv/l-lua.lua
index d8989364e..5570e83dc 100644
--- a/tex/context/base/mkiv/l-lua.lua
+++ b/tex/context/base/mkiv/l-lua.lua
@@ -250,5 +250,6 @@ end
-- if not loaded["socket.url"] then loaded["socket.url"] = socket.url end
if LUAVERSION > 5.3 then
- collectgarbage("generational")
+ -- collectgarbage("collect")
+ -- collectgarbage("generational") -- crashes on unix
end
diff --git a/tex/context/base/mkiv/l-os.lua b/tex/context/base/mkiv/l-os.lua
index cf469f79d..15408565c 100644
--- a/tex/context/base/mkiv/l-os.lua
+++ b/tex/context/base/mkiv/l-os.lua
@@ -230,22 +230,6 @@ function os.launch(str)
execute(format(launchers[os.name] or launchers.unix,str))
end
-if not os.times then -- ?
- -- utime = user time
- -- stime = system time
- -- cutime = children user time
- -- cstime = children system time
- function os.times()
- return {
- utime = os.gettimeofday(), -- user
- stime = 0, -- system
- cutime = 0, -- children user
- cstime = 0, -- children system
- }
- end
-end
-
-
local gettimeofday = os.gettimeofday or os.clock
os.gettimeofday = gettimeofday
diff --git a/tex/context/base/mkiv/lang-dis.lua b/tex/context/base/mkiv/lang-dis.lua
index 5603d1193..90e84f65d 100644
--- a/tex/context/base/mkiv/lang-dis.lua
+++ b/tex/context/base/mkiv/lang-dis.lua
@@ -180,7 +180,6 @@ end
-- experiment: for now not in not in export mode!
local flatten = languages.flatten
-local getlist = nodes.getlist
nodes.handlers.flattenline = flatten
diff --git a/tex/context/base/mkiv/lpdf-col.lua b/tex/context/base/mkiv/lpdf-col.lua
index b697dc481..9ba64abba 100644
--- a/tex/context/base/mkiv/lpdf-col.lua
+++ b/tex/context/base/mkiv/lpdf-col.lua
@@ -429,7 +429,8 @@ function codeinjections.setfigurecolorspace(data,figure)
local ref = indexcolorref(color)
if ref then
figure.colorspace = ref
- data.used.color = color
+ data.used.color = color
+ data.used.colorref = ref
end
end
end
diff --git a/tex/context/base/mkiv/lpdf-pde.lua b/tex/context/base/mkiv/lpdf-pde.lua
index 9d14f8f5e..c1680137d 100644
--- a/tex/context/base/mkiv/lpdf-pde.lua
+++ b/tex/context/base/mkiv/lpdf-pde.lua
@@ -1003,7 +1003,15 @@ if img then do
return openpdf(str,userpassword,ownerpassword,true)
end
- local function querypdf(pdfdoc,pagenumber)
+ local sizes = {
+ crop = "CropBox",
+ media = "MediaBox",
+ bleed = "BleedBox",
+ art = "ArtBox",
+ trim = "TrimBox",
+ }
+
+ local function querypdf(pdfdoc,pagenumber,size)
if pdfdoc then
if not pagenumber then
pagenumber = 1
@@ -1011,9 +1019,9 @@ if img then do
local root = pdfdoc.Catalog
local page = pdfdoc.pages[pagenumber]
if page then
- -- todo
+ local sizetag = sizes[size or "crop"] or sizes.cro
local mediabox = page.MediaBox or { 0, 0, 0, 0 }
- local cropbox = page.CropBox or mediabox
+ local cropbox = page[sizetag] or mediabox
return {
filename = pdfdoc.filename,
pagenumber = pagenumber,
diff --git a/tex/context/base/mkiv/luat-fmt.lua b/tex/context/base/mkiv/luat-fmt.lua
index 1c9222d95..586c5948e 100644
--- a/tex/context/base/mkiv/luat-fmt.lua
+++ b/tex/context/base/mkiv/luat-fmt.lua
@@ -79,6 +79,13 @@ local runners = {
checkers = checkers,
reporter = report_format,
},
+ luametatex = sandbox.registerrunner {
+ name = "make luametatex format",
+ program = "luametatex",
+ template = template,
+ checkers = checkers,
+ reporter = report_format,
+ },
luajittex = sandbox.registerrunner {
name = "make luajittex format",
program = "luajittex",
diff --git a/tex/context/base/mkiv/luat-lib.mkiv b/tex/context/base/mkiv/luat-lib.mkiv
index d5f6099ca..666032369 100644
--- a/tex/context/base/mkiv/luat-lib.mkiv
+++ b/tex/context/base/mkiv/luat-lib.mkiv
@@ -54,6 +54,10 @@
%registerctxluafile{util-soc-imp-ftp} {}
%registerctxluafile{util-soc-imp-smtp} {}
+\ifcase\contextlmtxmode\else
+ \registerctxluafile{util-zip}{}
+\fi
+
\registerctxluafile{data-ini}{}
\registerctxluafile{data-exp}{}
\registerctxluafile{data-env}{}
diff --git a/tex/context/base/mkiv/luat-run.lua b/tex/context/base/mkiv/luat-run.lua
index 98f981777..00cc65075 100644
--- a/tex/context/base/mkiv/luat-run.lua
+++ b/tex/context/base/mkiv/luat-run.lua
@@ -64,8 +64,9 @@ local function stop_run()
end
end
if quit then
- if status.setexitcode then
- status.setexitcode(1)
+ local setexitcode = lua.setexitcode or status.setexitcode
+ if setexitcode then
+ setexitcode(1)
if type(quit) == "table" then
logs.newline()
report_tex("quitting due to: %, t",quit)
diff --git a/tex/context/base/mkiv/mlib-run.lua b/tex/context/base/mkiv/mlib-run.lua
index 670c0e16b..09872ef0f 100644
--- a/tex/context/base/mkiv/mlib-run.lua
+++ b/tex/context/base/mkiv/mlib-run.lua
@@ -348,6 +348,13 @@ function metapost.pushformat(specification,f,m) -- was: instance, name, method
return mpx
end
+
+-- luatex.wrapup(function()
+-- for k, mpx in next, mpxformats do
+-- mpx:finish()
+-- end
+-- end)
+
function metapost.popformat()
nofformats = nofformats - 1
end
diff --git a/tex/context/base/mkiv/mtx-context-listing.tex b/tex/context/base/mkiv/mtx-context-listing.tex
index 1053e80b9..285113850 100644
--- a/tex/context/base/mkiv/mtx-context-listing.tex
+++ b/tex/context/base/mkiv/mtx-context-listing.tex
@@ -116,10 +116,10 @@
-- forced
end
context.page()
- context.setupfootertexts( -- return true: we need to keep this entry
- { function() context.detokenize(pattern and filename or file.basename(filename)) return true end },
- { function() context.pagenumber() return true end }
- )
+-- context.setupfootertexts( -- return true: we need to keep this entry
+-- { function() context.detokenize(pattern and filename or file.basename(filename)) return true end },
+-- { function() context.pagenumber() return true end }
+-- )
if scite then
context.scitefile { filename } -- here { }
elseif pretty then
diff --git a/tex/context/base/mkiv/node-met.lua b/tex/context/base/mkiv/node-met.lua
index f5db4babd..574c71f60 100644
--- a/tex/context/base/mkiv/node-met.lua
+++ b/tex/context/base/mkiv/node-met.lua
@@ -136,103 +136,82 @@ nodes.is_zero_glue = node.is_zero_glue
nodes.tonode = function(n) return n end
nodes.tonut = function(n) return n end
-local n_getid = node.getid
-local n_getlist = node.getlist
-local n_getnext = node.getnext
-local n_getprev = node.getprev
-local n_getchar = node.getchar
-local n_getfont = node.getfont
-local n_getsubtype = node.getsubtype
-local n_getfield = node.getfield
-local n_getattr = node.get_attribute
-local n_getdisc = node.getdisc
-local n_getleader = node.getleader
-
-local n_setfield = node.setfield
-local n_setattr = n_setfield
-
-local n_setnext = node.setnext or -- always
- function(c,n)
- n_setfield(c,"next",n)
- end
-local n_setprev = node.setprev or -- always
- function(c,p)
- n_setfield(c,"prev",p)
- end
-local n_setlist = node.setlist or -- always
- function(c,l)
- n_setfield(c,"list",l)
- end
-local n_setlink = node.setlink or -- always
- function(...)
- -- not that fast but not used often anyway
- local h = nil
- for i=1,select("#",...) do
- local n = select(i,...)
- if not n then
- -- go on
- elseif h then
- n_setfield(h,"next",n)
- n_setfield(n,"prev",h)
- else
- h = n
- end
+-- These are never used in \CONTEXT, only as a gimmick in node operators
+-- so we keep them around.
+
+local n_getfield = node.getfield
+local n_getattr = node.get_attribute
+
+local n_setfield = node.setfield
+local n_setattr = n_setfield
+
+nodes.getfield = n_getfield
+nodes.setfield = n_setfield
+nodes.getattr = n_getattr
+nodes.setattr = n_setattr
+nodes.takeattr = nodes.unset_attribute
+
+local function n_getid (n) return n_getfield(n,"id") end
+local function n_getsubtype(n) return n_getfield(n,"subtype") end
+
+nodes.getid = n_getid
+nodes.getsubtype = n_getsubtype
+
+local function n_getchar(n) return n_getfield(n,"char") end
+local function n_setchar(n,c) return n_setfield(n,"char",c) end
+local function n_getfont(n) return n_getfield(n,"font") end
+local function n_setfont(n,f) return n_setfield(n,"font",f) end
+
+nodes.getchar = n_getchar
+nodes.setchar = n_setchar
+nodes.getfont = n_getfont
+nodes.setfont = n_setfont
+
+local function n_getlist (n) return n_getfield(n,"list") end
+local function n_setlist (n,l) return n_setfield(n,"list",l) end
+local function n_getleader(n) return n_getfield(n,"leader") end
+local function n_setleader(n,l) return n_setfield(n,"leader",l) end
+
+nodes.getlist = n_getlist
+nodes.setlist = n_setlist
+nodes.getleader = n_getleader
+nodes.setleader = n_setleader
+
+local function n_getnext(n) return n_getfield(n,"next") end
+local function n_setnext(n,nn) return n_setfield(n,"next",nn) end
+local function n_getprev(n) return n_getfield(n,"prev") end
+local function n_setprev(n,pp) return n_setfield(n,"prev",pp) end
+local function n_getboth(n) return n_getfield(n,"prev"), n_getfield(n,"next") end
+local function n_setboth(n,pp,nn) return n_setfield(n,"prev",pp), n_setfield(n,"next",nn) end
+
+nodes.getnext = n_getnext
+nodes.setnext = n_setnext
+nodes.getprev = n_getprev
+nodes.setprev = n_setprev
+nodes.getboth = n_getboth
+nodes.setboth = n_setboth
+
+local function n_setlink(...)
+ -- not that fast but not used often anyway
+ local h = nil
+ for i=1,select("#",...) do
+ local n = select(i,...)
+ if not n then
+ -- go on
+ elseif h then
+ n_setfield(h,"next",n)
+ n_setfield(n,"prev",h)
+ else
+ h = n
end
- return h
- end
-local n_setboth = node.setboth or -- always
- function(c,p,n)
- n_setfield(c,"prev",p)
- n_setfield(c,"next",n)
- end
-
-nodes.setnext = n_setnext
-nodes.setprev = n_setprev
-nodes.setlink = n_setlink
-nodes.setboth = n_setboth
-nodes.setlist = n_setlist
-
-nodes.getfield = n_getfield
-nodes.setfield = n_setfield
-nodes.getattr = n_getattr
-nodes.setattr = n_setattr
-nodes.takeattr = nodes.unset_attribute
-
-nodes.getnext = n_getnext
-nodes.getprev = n_getprev
-nodes.getid = n_getid
-nodes.getchar = n_getchar
-nodes.getfont = n_getfont
-nodes.getsubtype = n_getsubtype
-nodes.getlist = n_getlist
-nodes.getleader = n_getleader
-nodes.getdisc = n_getdisc
-
-if not node.getwhd then
- function node.getwhd(n)
- return n_getfield(n,"width"), n_getfield(n,"height"), n_getfield(n,"depth")
end
+ return h
end
-if not node.setwhd then
- function node.setwhd(n,w,h,d)
- n_setfield(n,"width",w or 0)
- n_setfield(n,"height",h or 0)
- n_setfield(n,"depth",d or 0)
- end
-end
-
-nodes.getwhd = node.getwhd
-nodes.setwhd = node.setwhd
-
-nodes.is_char = node.is_char
-nodes.ischar = node.is_char
-
-nodes.is_glyph = node.is_glyph
-nodes.isglyph = node.is_glyph
+nodes.setlink = n_setlink
-nodes.getbox = node.getbox or tex.getbox
-nodes.setbox = node.setbox or tex.setbox
+nodes.getbox = node.getbox or tex.getbox
+nodes.setbox = node.setbox or tex.setbox
local n_flush_node = nodes.flush
local n_copy_node = nodes.copy
diff --git a/tex/context/base/mkiv/node-pro.lua b/tex/context/base/mkiv/node-pro.lua
index b6b130588..606d5b8d7 100644
--- a/tex/context/base/mkiv/node-pro.lua
+++ b/tex/context/base/mkiv/node-pro.lua
@@ -14,6 +14,7 @@ local report_nodes = logs.reporter("nodes","processors")
local nodes = nodes
local tasks = nodes.tasks
local nuts = nodes.nuts
+local tonut = nodes.tonut
nodes.processors = nodes.processors or { }
local processors = nodes.processors
@@ -25,7 +26,6 @@ local actions = tasks.actions("processors")
do
- local tonut = nuts.tonut
local isglyph = nuts.isglyph
local getnext = nuts.getnext
@@ -178,9 +178,9 @@ do
local texnest = tex.nest
- local getlist = nodes.getlist
- local setlist = nodes.setlist
- local getsubtype = nodes.getsubtype
+ local getlist = nuts.getlist
+ local setlist = nuts.setlist
+ local getsubtype = nuts.getsubtype
local linelist_code = nodes.listcodes.line
@@ -191,12 +191,15 @@ do
local whatever = texnest[texnest.ptr]
if whatever then
local line = whatever.tail
- if line and getsubtype(line) == linelist_code then
- local head = getlist(line)
- if head then
- local result = actions(head,groupcode,line)
- if result and result ~= head then
- setlist(line,result)
+ if line then
+ line = tonut(line)
+ if getsubtype(line) == linelist_code then
+ local head = getlist(line)
+ if head then
+ local result = actions(head,groupcode,line)
+ if result and result ~= head then
+ setlist(line,result)
+ end
end
end
end
diff --git a/tex/context/base/mkiv/node-tsk.lua b/tex/context/base/mkiv/node-tsk.lua
index 0378c14c6..ca7c7fee4 100644
--- a/tex/context/base/mkiv/node-tsk.lua
+++ b/tex/context/base/mkiv/node-tsk.lua
@@ -627,12 +627,11 @@ local tonode = nodes.nuts.tonode
%localize%
-return function(head,groupcode,line)
- local nuthead = tonut(head)
- local nutline = tonut(line)
+-- we operate exclusively on nuts
+return function(nuthead,groupcode,nutline)
%actions%
- return tonode(nuthead)
+ return nuthead
end
]],
diff --git a/tex/context/base/mkiv/publ-imp-apa.mkvi b/tex/context/base/mkiv/publ-imp-apa.mkvi
index 160cc4522..36e4882d2 100644
--- a/tex/context/base/mkiv/publ-imp-apa.mkvi
+++ b/tex/context/base/mkiv/publ-imp-apa.mkvi
@@ -696,6 +696,30 @@
apa:Advanced={Publicación en línea avanzada},
apa:Retrieved={Obtenido de}] % {Disponible desde}]
+
+\setupbtxlabeltext
+ [sv]
+ [apa:number={nr.},
+ apa:edition={Utgåva},
+ apa:Editor=Redaktör,
+ apa:Editors=Redaktörer,
+ apa:Volume=Band,
+ apa:Volumes=Band,
+ apa:nd={u.å.}, % utan årtal
+ apa:supplement=Bilaga, % Supplement
+ apa:MotionPicture=Spelfilm, % ?
+ apa:Writer={Manusförfattare}, % Assuming for a movie
+ apa:Writers={Manusförfattare}, %
+ apa:Producer=Producent, % Assuming for a movie
+ apa:Producers=Producenter, %
+ apa:Director={Regissör}, % Assuming for a movie
+ apa:Directors={Regissörer}, %
+ apa:Recordedby={Inspelad av}, % Assuming for a movie
+ apa:Author={Författare},
+ apa:Translator={Översättare},
+ apa:Advanced={Avancerad onlinepublikation}, % ?
+ apa:Retrieved={Hämtad från}]
+
% cite setups
% The following differs from the default returning n.d. if year is empty
diff --git a/tex/context/base/mkiv/publ-imp-aps.mkvi b/tex/context/base/mkiv/publ-imp-aps.mkvi
index 4180b6491..4e12fbfc7 100644
--- a/tex/context/base/mkiv/publ-imp-aps.mkvi
+++ b/tex/context/base/mkiv/publ-imp-aps.mkvi
@@ -514,6 +514,20 @@
aps:tobe={que se publicará},
aps:unpublished={inédito}]
+\setupbtxlabeltext
+ [sv]
+ [aps:number={nr.},
+ aps:edition={Utgåva},
+ aps:Editor=Redaktör,
+ aps:Editors=Redaktörer,
+ aps:Volume=Band,
+ aps:Volumes=Band,
+ aps:supplement=Bilaga,
+ aps:inpress={under tryckning},
+ aps:tobe={att publiceras},
+ aps:unpublished={opublicerat}]
+
+
% cite setups
\startsetups btx:aps:nd
diff --git a/tex/context/base/mkiv/publ-imp-commands.mkvi b/tex/context/base/mkiv/publ-imp-commands.mkvi
index 14e2dbae1..281b8324a 100644
--- a/tex/context/base/mkiv/publ-imp-commands.mkvi
+++ b/tex/context/base/mkiv/publ-imp-commands.mkvi
@@ -10,6 +10,6 @@
\definebtxcommand\acro #1{\dontleavehmode{\smallcaps#1}}
\let\<<
-\let\<>
+\let\>>
\protect \endinput
diff --git a/tex/context/base/mkiv/publ-imp-default.mkvi b/tex/context/base/mkiv/publ-imp-default.mkvi
index 22638c900..fef993fe0 100644
--- a/tex/context/base/mkiv/publ-imp-default.mkvi
+++ b/tex/context/base/mkiv/publ-imp-default.mkvi
@@ -342,24 +342,36 @@
[it]
[\s!default:and=e,
\s!default:number={nº},
- \s!default:edition={ed.}, % edizione
+ \s!default:edition={ed.}, % edizione
\s!default:Editor={A cura di},
\s!default:Editors={A cura di},
- \s!default:Volume={Vol.}, % Volume
- \s!default:Volumes={Vol.}, % Volumi
+ \s!default:Volume={Vol.}, % Volume
+ \s!default:Volumes={Vol.}, % Volumi
\s!default:others={et al.}]
\setupbtxlabeltext
[es]
[\s!default:and=y,
\s!default:number={nº},
- \s!default:edition={ed.}, % edición
- \s!default:Editor=Editor, % Ed./Eds.
+ \s!default:edition={ed.}, % edición
+ \s!default:Editor=Editor, % Ed./Eds.
\s!default:Editors=Editores,
\s!default:Volume={Vol.}, % Volumen
\s!default:Volumes={Vols.}, % Volúmenes
\s!default:others={et al.}]
+\setupbtxlabeltext
+ [sv]
+ [\s!default:and=och,
+ \s!default:number={nr.},
+ \s!default:edition={Utgåva},
+ \s!default:Editor=Redaktör,
+ \s!default:Editors=Redaktörer,
+ \s!default:Volume=Band,
+ \s!default:Volumes=Band,
+ \s!default:others={et al.}]
+
+
% First some helpers:
\starttexdefinition btx:default:composed-title
diff --git a/tex/context/base/mkiv/spac-hor.mkiv b/tex/context/base/mkiv/spac-hor.mkiv
index 32b7f06fb..24c7c7893 100644
--- a/tex/context/base/mkiv/spac-hor.mkiv
+++ b/tex/context/base/mkiv/spac-hor.mkiv
@@ -717,7 +717,7 @@
\global\s_spac_narrower_left \zeropoint
\global\s_spac_narrower_right \zeropoint
\global\s_spac_narrower_middle\zeropoint
- \edef\askednarrower{#1}
+ \edef\askednarrower{#1}%
\ifx\askednarrower\v!reverse
\ifconditional\s_spac_narrower_last_swap
\leftskip \s_spac_narrower_right_last
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index d0d2324d8..211e6773f 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 a0d9f04f4..a9c4cb673 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/symb-ini.mkiv b/tex/context/base/mkiv/symb-ini.mkiv
index abf857675..428fcd381 100644
--- a/tex/context/base/mkiv/symb-ini.mkiv
+++ b/tex/context/base/mkiv/symb-ini.mkiv
@@ -44,9 +44,23 @@
%D \stoptyping
\installcorenamespace{symbol}
+\installcorenamespace{symbols}
\installcorenamespace{symbolset}
\installcorenamespace{symboldefault}
+%D For now we only have one option.
+
+\installparameterhandler\??symbols {symbols}
+\installsetuphandler \??symbols {symbols}
+
+\appendtoks
+ \doifelse{\symbolsparameter\c!stylealternative}\v!math
+ \settrue\setfalse\prefermathovertextchar
+\to \everysetupsymbols
+
+\setupsymbols
+ [\c!stylealternative=\v!text]
+
\let\currentsymbol \empty
\let\currentsymbolset\empty
diff --git a/tex/context/base/mkiv/trac-log.lua b/tex/context/base/mkiv/trac-log.lua
index 206af5668..e76c9f684 100644
--- a/tex/context/base/mkiv/trac-log.lua
+++ b/tex/context/base/mkiv/trac-log.lua
@@ -114,7 +114,7 @@ local direct, subdirect, writer, pushtarget, poptarget, setlogfile, settimedlog,
-- we don't want this overhead for single messages (not that there are that
-- many; we could have a special weak table)
-if runningtex then
+if runningtex and texio then
if texio.setescape then
texio.setescape(0) -- or (false)
diff --git a/tex/context/base/mkiv/typo-mar.lua b/tex/context/base/mkiv/typo-mar.lua
index f8665e0b0..ce8375eea 100644
--- a/tex/context/base/mkiv/typo-mar.lua
+++ b/tex/context/base/mkiv/typo-mar.lua
@@ -204,7 +204,6 @@ end
function margins.save(t)
setmetatable(t,defaults)
local content = takebox(t.number)
- setprop(content,"specialcontent","margindata")
local location = t.location
local category = t.category
local inline = t.inline
@@ -220,6 +219,7 @@ function margins.save(t)
report_margindata("ignoring empty margin data %a",location or "unknown")
return
end
+ setprop(content,"specialcontent","margindata")
local store
if inline then
store = inlinestore
diff --git a/tex/context/base/mkiv/util-fil.lua b/tex/context/base/mkiv/util-fil.lua
index 9f96a01b9..79af27743 100644
--- a/tex/context/base/mkiv/util-fil.lua
+++ b/tex/context/base/mkiv/util-fil.lua
@@ -14,10 +14,14 @@ local char = string.char
-- flac files). In Lua 5.3 we can probably do this better. Some code will move
-- here.
+-- We could comment those that are in fio and sio.
+
utilities = utilities or { }
local files = { }
utilities.files = files
+-- we could have a gc method that closes but files auto close anyway
+
local zerobased = { }
function files.open(filename,zb)
@@ -249,7 +253,7 @@ end
if bit32 then
- local rshift = bit32.rshift
+ local rshift = bit32.rshift
function files.writecardinal2(f,n)
local a = char(n % 256)
@@ -258,6 +262,35 @@ if bit32 then
f:write(b,a)
end
+ function files.writecardinal4(f,n)
+ local a = char(n % 256)
+ n = rshift(n,8)
+ local b = char(n % 256)
+ n = rshift(n,8)
+ local c = char(n % 256)
+ n = rshift(n,8)
+ local d = char(n % 256)
+ f:write(d,c,b,a)
+ end
+
+ function files.writecardinal2le(f,n)
+ local a = char(n % 256)
+ n = rshift(n,8)
+ local b = char(n % 256)
+ f:write(a,b)
+ end
+
+ function files.writecardinal4le(f,n)
+ local a = char(n % 256)
+ n = rshift(n,8)
+ local b = char(n % 256)
+ n = rshift(n,8)
+ local c = char(n % 256)
+ n = rshift(n,8)
+ local d = char(n % 256)
+ f:write(a,b,c,d)
+ end
+
else
local floor = math.floor
@@ -269,17 +302,35 @@ else
f:write(b,a)
end
-end
+ function files.writecardinal4(f,n)
+ local a = char(n % 256)
+ n = floor(n/256)
+ local b = char(n % 256)
+ n = floor(n/256)
+ local c = char(n % 256)
+ n = floor(n/256)
+ local d = char(n % 256)
+ f:write(d,c,b,a)
+ end
+
+ function files.writecardinal2le(f,n)
+ local a = char(n % 256)
+ n = floor(n/256)
+ local b = char(n % 256)
+ f:write(a,b)
+ end
+
+ function files.writecardinal4le(f,n)
+ local a = char(n % 256)
+ n = floor(n/256)
+ local b = char(n % 256)
+ n = floor(n/256)
+ local c = char(n % 256)
+ n = floor(n/256)
+ local d = char(n % 256)
+ f:write(a,b,c,d)
+ end
-function files.writecardinal4(f,n)
- local a = char(n % 256)
- n = rshift(n,8)
- local b = char(n % 256)
- n = rshift(n,8)
- local c = char(n % 256)
- n = rshift(n,8)
- local d = char(n % 256)
- f:write(d,c,b,a)
end
function files.writestring(f,s)
@@ -292,30 +343,42 @@ end
if fio and fio.readcardinal1 then
- files.readcardinal1 = fio.readcardinal1
- files.readcardinal2 = fio.readcardinal2
- files.readcardinal3 = fio.readcardinal3
- files.readcardinal4 = fio.readcardinal4
- files.readinteger1 = fio.readinteger1
- files.readinteger2 = fio.readinteger2
- files.readinteger3 = fio.readinteger3
- files.readinteger4 = fio.readinteger4
- files.readfixed2 = fio.readfixed2
- files.readfixed4 = fio.readfixed4
- files.read2dot14 = fio.read2dot14
- files.setposition = fio.setposition
- files.getposition = fio.getposition
-
- files.readbyte = files.readcardinal1
- files.readsignedbyte = files.readinteger1
- files.readcardinal = files.readcardinal1
- files.readinteger = files.readinteger1
-
- local skipposition = fio.skipposition
- files.skipposition = skipposition
-
- files.readbytes = fio.readbytes
- files.readbytetable = fio.readbytetable
+ files.readcardinal1 = fio.readcardinal1
+ files.readcardinal2 = fio.readcardinal2
+ files.readcardinal3 = fio.readcardinal3
+ files.readcardinal4 = fio.readcardinal4
+
+ files.readcardinal1le = fio.readcardinal1le or files.readcardinal1le
+ files.readcardinal2le = fio.readcardinal2le or files.readcardinal2le
+ files.readcardinal3le = fio.readcardinal3le or files.readcardinal3le
+ files.readcardinal4le = fio.readcardinal4le or files.readcardinal4le
+
+ files.readinteger1 = fio.readinteger1
+ files.readinteger2 = fio.readinteger2
+ files.readinteger3 = fio.readinteger3
+ files.readinteger4 = fio.readinteger4
+
+ files.readinteger1le = fio.readinteger1le or files.readinteger1le
+ files.readinteger2le = fio.readinteger2le or files.readinteger2le
+ files.readinteger3le = fio.readinteger3le or files.readinteger3le
+ files.readinteger4le = fio.readinteger4le or files.readinteger4le
+
+ files.readfixed2 = fio.readfixed2
+ files.readfixed4 = fio.readfixed4
+ files.read2dot14 = fio.read2dot14
+ files.setposition = fio.setposition
+ files.getposition = fio.getposition
+
+ files.readbyte = files.readcardinal1
+ files.readsignedbyte = files.readinteger1
+ files.readcardinal = files.readcardinal1
+ files.readinteger = files.readinteger1
+
+ local skipposition = fio.skipposition
+ files.skipposition = skipposition
+
+ files.readbytes = fio.readbytes
+ files.readbytetable = fio.readbytetable
function files.skipshort(f,n)
skipposition(f,2*(n or 1))
@@ -327,6 +390,30 @@ if fio and fio.readcardinal1 then
end
+if fio and fio.writecardinal1 then
+
+ files.writecardinal1 = fio.writecardinal1
+ files.writecardinal2 = fio.writecardinal2
+ files.writecardinal3 = fio.writecardinal3
+ files.writecardinal4 = fio.writecardinal4
+
+ files.writecardinal1le = fio.writecardinal1le
+ files.writecardinal2le = fio.writecardinal2le
+ files.writecardinal3le = fio.writecardinal3le
+ files.writecardinal4le = fio.writecardinal4le
+
+ files.writeinteger1 = fio.writeinteger1 or fio.writecardinal1
+ files.writeinteger2 = fio.writeinteger2 or fio.writecardinal2
+ files.writeinteger3 = fio.writeinteger3 or fio.writecardinal3
+ files.writeinteger4 = fio.writeinteger4 or fio.writecardinal4
+
+ files.writeinteger1le = files.writeinteger1le or fio.writecardinal1le
+ files.writeinteger2le = files.writeinteger2le or fio.writecardinal2le
+ files.writeinteger3le = files.writeinteger3le or fio.writecardinal3le
+ files.writeinteger4le = files.writeinteger4le or fio.writecardinal4le
+
+end
+
if fio and fio.readcardinaltable then
files.readcardinaltable = fio.readcardinaltable
diff --git a/tex/context/base/mkiv/util-sac.lua b/tex/context/base/mkiv/util-sac.lua
index dc8ba72f1..976989a77 100644
--- a/tex/context/base/mkiv/util-sac.lua
+++ b/tex/context/base/mkiv/util-sac.lua
@@ -29,6 +29,12 @@ function streams.openstring(f,zerobased)
end
end
+function streams.getstring(f)
+ if f then
+ return f[1]
+ end
+end
+
function streams.close()
-- dummy
end
@@ -137,7 +143,7 @@ function streams.readcardinal2(f)
return 0x100 * a + b
end
-function streams.readcardinal2LE(f)
+function streams.readcardinal2le(f)
local i = f[2]
local j = i + 1
f[2] = j + 1
@@ -217,6 +223,14 @@ function streams.readcardinal4(f)
return 0x1000000 * a + 0x10000 * b + 0x100 * c + d
end
+function streams.readcardinal4le(f)
+ local i = f[2]
+ local j = i + 3
+ f[2] = j + 1
+ local d, c, b, a = byte(f[1],i,j)
+ return 0x1000000 * a + 0x10000 * b + 0x100 * c + d
+end
+
function streams.readinteger4(f)
local i = f[2]
local j = i + 3
diff --git a/tex/context/base/mkiv/util-soc-imp-mime.lua b/tex/context/base/mkiv/util-soc-imp-mime.lua
index 4b5d2baff..7a5cef27b 100644
--- a/tex/context/base/mkiv/util-soc-imp-mime.lua
+++ b/tex/context/base/mkiv/util-soc-imp-mime.lua
@@ -3,8 +3,8 @@
local type, tostring = type, tostring
-local mime = require("mime.core")
-local ltn12 = ltn12 or require("ltn12")
+local mime = mime or package.loaded.mime or require("mime.core")
+local ltn12 = ltn12 or package.loaded.ltn12 or require("ltn12")
local filtercycle = ltn12.filter.cycle
diff --git a/tex/context/base/mkiv/util-soc-imp-socket.lua b/tex/context/base/mkiv/util-soc-imp-socket.lua
index 3da155749..d1486f8f8 100644
--- a/tex/context/base/mkiv/util-soc-imp-socket.lua
+++ b/tex/context/base/mkiv/util-soc-imp-socket.lua
@@ -5,7 +5,7 @@ local type, tostring, setmetatable = type, tostring, setmetatable
local min = math.min
local format = string.format
-local socket = require("socket.core")
+local socket = socket or package.loaded.socket or require("socket.core")
local connect = socket.connect
local tcp4 = socket.tcp4
diff --git a/tex/context/base/mkiv/util-str.lua b/tex/context/base/mkiv/util-str.lua
index 5f175e227..a04b20835 100644
--- a/tex/context/base/mkiv/util-str.lua
+++ b/tex/context/base/mkiv/util-str.lua
@@ -14,7 +14,6 @@ local format, gsub, rep, sub, find = string.format, string.gsub, string.rep, str
local load, dump = load, string.dump
local tonumber, type, tostring, next, setmetatable = tonumber, type, tostring, next, setmetatable
local unpack, concat = table.unpack, table.concat
-local unpack, concat = table.unpack, table.concat
local P, V, C, S, R, Ct, Cs, Cp, Carg, Cc = lpeg.P, lpeg.V, lpeg.C, lpeg.S, lpeg.R, lpeg.Ct, lpeg.Cs, lpeg.Cp, lpeg.Carg, lpeg.Cc
local patterns, lpegmatch = lpeg.patterns, lpeg.match
local utfchar, utfbyte, utflen = utf.char, utf.byte, utf.len
diff --git a/tex/context/base/mkiv/util-tab.lua b/tex/context/base/mkiv/util-tab.lua
index be5f1318c..2f425cca3 100644
--- a/tex/context/base/mkiv/util-tab.lua
+++ b/tex/context/base/mkiv/util-tab.lua
@@ -311,7 +311,8 @@ function tables.encapsulate(core,capsule,protect)
end
end
--- best keep [%q] keys (as we have some in older applications i.e. saving user data
+-- best keep [%q] keys (as we have some in older applications i.e. saving user data (otherwise
+-- we also need to check for reserved words)
local f_hashed_string = formatters["[%q]=%q,"]
local f_hashed_number = formatters["[%q]=%s,"]
diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf
index 147d7755b..c4450ad71 100644
--- a/tex/context/interface/mkiv/i-context.pdf
+++ b/tex/context/interface/mkiv/i-context.pdf
Binary files differ
diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf
index b48a519ae..8bc3240c4 100644
--- a/tex/context/interface/mkiv/i-readme.pdf
+++ b/tex/context/interface/mkiv/i-readme.pdf
Binary files differ
diff --git a/tex/context/modules/mkiv/m-chart.lua b/tex/context/modules/mkiv/m-chart.lua
index cde563fb3..7973640a7 100644
--- a/tex/context/modules/mkiv/m-chart.lua
+++ b/tex/context/modules/mkiv/m-chart.lua
@@ -864,8 +864,8 @@ local function getchart(settings,forced_x,forced_y,forced_nx,forced_ny)
for i=1,#data do
local cell = data[i]
if not autofocus or autofocus[cell.name] then -- offsets probably interfere with autofocus
- local x = cell.x
- local y = cell.y
+ local x = cell.realx -- was bug: .x
+ local y = cell.realy -- was bug: .y
if minx == 0 or x < minx then minx = x end
if miny == 0 or y < miny then miny = y end
if minx == 0 or x > maxx then maxx = x end
diff --git a/tex/context/sample/third/aristotle-grc.tex b/tex/context/sample/third/aristotle-grc.tex
new file mode 100644
index 000000000..85d774f23
--- /dev/null
+++ b/tex/context/sample/third/aristotle-grc.tex
@@ -0,0 +1,13 @@
+\startlanguage[grc]
+Λόγος δέ ἐστι φωνὴ σημαντική, ἧς τῶν μερῶν τι σημαντικόν ἐστι
+κεχωρισμένον, ὡς φάσις ἀλλ᾽ οὐχ ὡς κατάφασις. λέγω δέ, οἷον ἄνθρωπος
+σημαίνει τι, ἀλλ᾽ οὐχ ὅτι ἔστιν ἢ οὐκ ἔστιν (ἀλλ᾽ ἔσται κατάφασις ἢ
+ἀπόφασις ἐάν τι προστεθῇ)· ἀλλ᾽ οὐχ ἡ τοῦ ἀνθρώπου συλλαβὴ μία· οὐδὲ
+γὰρ ἐν τῷ μῦς τὸ υς σημαντικόν, ἀλλὰ φωνή ἐστι νῦν μόνον. ἐν δὲ τοῖς
+διπλοῖς σημαίνει μέν, ἀλλ᾽ οὐ καθ᾽ αὑτό, ὥσπερ εἴρηται. ἔστι δὲ λόγος
+ἅπας μὲν σημαντικός, οὐχ ὡς ὄργανον δέ, ἀλλ᾽ ὥσπερ εἴρηται κατὰ
+συνθήκην· ἀποφαντικὸς δὲ οὐ πᾶς, ἀλλ᾽ ἐν ᾧ τὸ ἀληθεύειν ἢ ψεύδεσθαι
+ὑπάρχει· οὐκ ἐν ἅπασι δὲ ὑπάρχει, οἷον ἡ εὐχὴ λόγος μέν, ἀλλ᾽ οὔτ᾽
+ἀληθὴς οὔτε ψευδής. οἱ μὲν οὖν ἄλλοι ἀφείσθωσαν, —ῥητορικῆς γὰρ ἢ
+ποιητικῆς οἰκειοτέρα ἡ σκέψις,— ὁ δὲ ἀποφαντικὸς τῆς νῦν θεωρίας.
+\stoplanguage
diff --git a/tex/context/sample/third/capek-cz.tex b/tex/context/sample/third/capek-cz.tex
new file mode 100644
index 000000000..8083d7152
--- /dev/null
+++ b/tex/context/sample/third/capek-cz.tex
@@ -0,0 +1,13 @@
+Tak vám jednou byl jeden chudý pán neboli člověk, on se vlastně jmenoval
+František Král, ale tak mu říkali jenom tehdy, když ho sebral strážník a
+dovedl ho na komisařství pro potulku, kde ho zapsali do takové tlusté knihy
+a nechali ho přespat na pryčně a ráno ho zase poslali dál; na policii mu
+tedy říkali František Král, ale ostatní lidé ho jmenovali všelijak jinak:
+ten vandrák, ten šupák, ten tulák, ten pobuda, ten lajdák, ten otrapa, ten
+hadrník, ten trhan, ten obejda, ten lenoch, ten chudák, ten jindyvyjduum,
+ten člověk, ten kdovíkdo, ten poběhlík, ten krajánek, ten štvanec, ten
+vošlapa, ten revertent, ten vagabund, ten darmošlap, ten budižkničemu, ten
+hlad, ten hunt, ten holota a ještě mnoho jiných jmen mu dávali; kdyby každé
+to názvisko platilo aspoň korunu, mohl by si za ně koupit žluté boty a možná
+že i klobouk, ale takhle si za to nekoupil nic a měl jenom to, co mu lidé
+dali.
diff --git a/tex/context/sample/third/capek-vlnka-cz.tex b/tex/context/sample/third/capek-vlnka-cz.tex
new file mode 100644
index 000000000..9fede2334
--- /dev/null
+++ b/tex/context/sample/third/capek-vlnka-cz.tex
@@ -0,0 +1,13 @@
+Tak vám jednou byl jeden chudý pán neboli člověk, on se vlastně jmenoval
+František Král, ale tak mu říkali jenom tehdy, když ho sebral strážník
+a~dovedl ho na komisařství pro potulku, kde ho zapsali do takové tlusté knihy
+a~nechali ho přespat na pryčně a~ráno ho zase poslali dál; na policii mu
+tedy říkali František Král, ale ostatní lidé ho jmenovali všelijak jinak:
+ten vandrák, ten šupák, ten tulák, ten pobuda, ten lajdák, ten otrapa, ten
+hadrník, ten trhan, ten obejda, ten lenoch, ten chudák, ten jindyvyjduum,
+ten člověk, ten kdovíkdo, ten poběhlík, ten krajánek, ten štvanec, ten
+vošlapa, ten revertent, ten vagabund, ten darmošlap, ten budižkničemu, ten
+hlad, ten hunt, ten holota a~ještě mnoho jiných jmen mu dávali; kdyby každé
+to názvisko platilo aspoň korunu, mohl by si za ně koupit žluté boty a~možná
+že i~klobouk, ale takhle si za to nekoupil nic a~měl jenom to, co mu lidé
+dali.
diff --git a/tex/context/sample/third/dequincey.tex b/tex/context/sample/third/dequincey.tex
new file mode 100644
index 000000000..a1070b562
--- /dev/null
+++ b/tex/context/sample/third/dequincey.tex
@@ -0,0 +1,5 @@
+For if once a man indulges himself in murder, very soon he comes to
+think little of robbing; and from robbing he comes next to drinking and
+Sabbath--breaking, and from that to incivility and procrastination.
+Once begin upon this downward path, you never know where you are to
+stop.
diff --git a/tex/context/sample/third/dyrynk-cz.tex b/tex/context/sample/third/dyrynk-cz.tex
new file mode 100644
index 000000000..e12a228b9
--- /dev/null
+++ b/tex/context/sample/third/dyrynk-cz.tex
@@ -0,0 +1,22 @@
+Čeho jsem si zvlášť všímal při prohlížení knih, je typografické jejich
+zhotovení, technické provedení knihtiskařem, které po mém soudu je základem
+dobré knižní úpravy. A tu nelze upřít, že řemeslná stránka je dosud stránkou
+slabou většiny našich knih. Často až překvapí rozpor mezi péčí, kterou
+věnoval umělec výzdobě knihy, a ledabylostí, s jakou ji tiskárna zhotovila.
+Bývá to podivná harmonie: výzdoba umělecká a sazba i tisk jako denních
+novin. Nejsou to malé závody, jichž výrobkům lze vytknouti tuto řemeslnou
+chybu, i přední veliké tiskárny zhotovují takto >>krásné<< knihy. Stačí
+prohlédnouti si podrobněji reprodukce v tomto díle, abychom se přesvědčili,
+že to tvrzení není přehnané.
+
+Přece však lze pozorovati potěšitelný obrat k lepšímu: některé české
+knihtiskárny se chlubí už správně vysazenými a dobře vytištěnými knihami.
+Sice dosud jest málo impressí, které takto jeví úctu a vážnost k svému
+černému umění, obracejíce knihtisk k jeho staré lásce, knize, a věnujíce
+její vkusné úpravě čas, píči a píli; na prstech jedné ruky by je spočetl.
+Nepochybuji však, že jich přibude, vždyť ničím nemůže se knihtiskárna
+lépe doporučiti než svojí firmou na dokonale, krásně upravené knize, která
+je rozkoší oku a potěšením duši, a ještě po letech a desetiletích, kdy
+dávno upadnou v zapomnění drobné akcidence, zůstane v knihovnách jako svědek
+odborné vyspělosti knihtiskárny, schopnosti jejích pracovníků
+a prozíravosti i vkusu principála nebo řiditele závodu.
diff --git a/tex/context/sample/third/dyrynk-vlnka-cz.tex b/tex/context/sample/third/dyrynk-vlnka-cz.tex
new file mode 100644
index 000000000..1d4df1e49
--- /dev/null
+++ b/tex/context/sample/third/dyrynk-vlnka-cz.tex
@@ -0,0 +1,23 @@
+
+Čeho jsem si zvlášť všímal při prohlížení knih, je typografické jejich
+zhotovení, technické provedení knihtiskařem, které po mém soudu je základem
+dobré knižní úpravy. A~tu nelze upřít, že řemeslná stránka je dosud stránkou
+slabou většiny našich knih. Často až překvapí rozpor mezi péčí, kterou
+věnoval umělec výzdobě knihy, a~ledabylostí, s~jakou ji tiskárna zhotovila.
+Bývá to podivná harmonie: výzdoba umělecká a~sazba i~tisk jako denních
+novin. Nejsou to malé závody, jichž výrobkům lze vytknouti tuto řemeslnou
+chybu, i~přední veliké tiskárny zhotovují takto >>krásné<< knihy. Stačí
+prohlédnouti si podrobněji reprodukce v~tomto díle, abychom se přesvědčili,
+že to tvrzení není přehnané.
+
+Přece však lze pozorovati potěšitelný obrat k~lepšímu: některé české
+knihtiskárny se chlubí už správně vysazenými a~dobře vytištěnými knihami.
+Sice dosud jest málo impressí, které takto jeví úctu a~vážnost k~svému
+černému umění, obracejíce knihtisk k~jeho staré lásce, knize, a~věnujíce
+její vkusné úpravě čas, píči a~píli; na prstech jedné ruky by je spočetl.
+Nepochybuji však, že jich přibude, vždyť ničím nemůže se knihtiskárna
+lépe doporučiti než svojí firmou na dokonale, krásně upravené knize, která
+je rozkoší oku a~potěšením duši, a~ještě po letech a~desetiletích, kdy
+dávno upadnou v~zapomnění drobné akcidence, zůstane v~knihovnách jako svědek
+odborné vyspělosti knihtiskárny, schopnosti jejích pracovníků
+a~prozíravosti i~vkusu principála nebo řiditele závodu.
diff --git a/tex/context/sample/third/kollar-cz.tex b/tex/context/sample/third/kollar-cz.tex
new file mode 100644
index 000000000..5a4f63695
--- /dev/null
+++ b/tex/context/sample/third/kollar-cz.tex
@@ -0,0 +1,31 @@
+
+Aj zde leží zem ta před okem mým slzy ronícím,
+někdy kolébka, nyní národu mého rakev.
+Stoj noho! posvátná místa jsou, kamkoli kráčíš,
+k obloze, Tatry synu, vznes se vyvýše pohled,
+neb raději k velikému prichyl tomu tam se dubisku,
+jenž vzdoruje zhoubným až dosaváde časům.
+Však času ten horší je člověk, jenž berlu železnou
+v těchto krajích na tvou, Slavie, šíji chopil.
+Horší, nežli divé války, hromu, ohně divější,
+zaslepenec na své když zlobu plémě kydá.
+Ó věkové dávní, jako noc vůkol mne ležící,
+ó krajino, všeliké slávy i hanby obraz!
+Od Labe zrádného k rovinám až Visly nevěrné,
+od Dunaje k hltným Baltu celého pěnám:
+Krásnohlasy zmužilých Slavjanů kde se někdy ozýval,
+aj oněmělť už, byv k ourazu zášti, jazyk.
+A kdo se loupeže té, volající vzhůru, dopustil?
+Kdo zhanobil v jednom národu lidstvo celé?
+Zardi se závistná Teutonie, sousedo Slávy,
+tvé vin těchto počet spáchaly někdy ruky!
+Neb krve nikde tolik nevylil černidla že žádný
+nepřítel, co vylil k záhubě Slávy Němec.
+Sám svobody kdo hoden, svobodu zná vážiti každou,
+ten kdo do pout jímá otroky, sám je otrok.
+Nechť ruky, nechť by jazyk v okovy své vázal otrocké,
+jedno to, neb nezná šetřiti práva jiných.
+Ten, kdo trůny bořil, lidskou krev darmo vyléval,
+po světě nešťastnou války pochodni nosil:
+ten porobu slušnou, buď Goth, buď Skytha zasloužil,
+ne kdo divé chválil příkladem ordě pokoj.
diff --git a/tex/context/sample/third/kollar-vlnka-cz.tex b/tex/context/sample/third/kollar-vlnka-cz.tex
new file mode 100644
index 000000000..01e815e74
--- /dev/null
+++ b/tex/context/sample/third/kollar-vlnka-cz.tex
@@ -0,0 +1,30 @@
+Aj zde leží zem ta před okem mým slzy ronícím,
+někdy kolébka, nyní národu mého rakev.
+Stoj noho! posvátná místa jsou, kamkoli kráčíš,
+k~obloze, Tatry synu, vznes se vyvýše pohled,
+neb raději k~velikému prichyl tomu tam se dubisku,
+jenž vzdoruje zhoubným až dosaváde časům.
+Však času ten horší je člověk, jenž berlu železnou
+v~těchto krajích na tvou, Slavie, šíji chopil.
+Horší, nežli divé války, hromu, ohně divější,
+zaslepenec na své když zlobu plémě kydá.
+Ó věkové dávní, jako noc vůkol mne ležící,
+ó krajino, všeliké slávy i~hanby obraz!
+Od Labe zrádného k~rovinám až Visly nevěrné,
+od Dunaje k~hltným Baltu celého pěnám:
+Krásnohlasy zmužilých Slavjanů kde se někdy ozýval,
+aj oněmělť už, byv k~ourazu zášti, jazyk.
+A~kdo se loupeže té, volající vzhůru, dopustil?
+Kdo zhanobil v~jednom národu lidstvo celé?
+Zardi se závistná Teutonie, sousedo Slávy,
+tvé vin těchto počet spáchaly někdy ruky!
+Neb krve nikde tolik nevylil černidla že žádný
+nepřítel, co vylil k~záhubě Slávy Němec.
+Sám svobody kdo hoden, svobodu zná vážiti každou,
+ten kdo do pout jímá otroky, sám je otrok.
+Nechť ruky, nechť by jazyk v~okovy své vázal otrocké,
+jedno to, neb nezná šetřiti práva jiných.
+Ten, kdo trůny bořil, lidskou krev darmo vyléval,
+po světě nešťastnou války pochodni nosil:
+ten porobu slušnou, buď Goth, buď Skytha zasloužil,
+ne kdo divé chválil příkladem ordě pokoj.
diff --git a/tex/context/sample/third/komensky-cz.tex b/tex/context/sample/third/komensky-cz.tex
new file mode 100644
index 000000000..f25bb47d9
--- /dev/null
+++ b/tex/context/sample/third/komensky-cz.tex
@@ -0,0 +1,33 @@
+Nejkrásnějším dílem Božím je svět, všeliké neviditelné Božské věcí viditelné
+ukazující. Nejkrásnější je ale naše duše, jíž je dáno, myšlením zobrazovat
+ve svém nitru svět i věci veškery. Nejkrásnější je řeč, jejíž pomocí
+vmalováváme všeliké obrazy své duše v duši druhého. Nejkrásnější je písmo,
+jímž zachycujeme a natrvalo upevňujeme řeč, samu o sobě prchavou a
+pomíjející, a jímž jako bychom ji zadržovali, aby trvala. Nejkrásnější jsou
+knihy, písmem ladně sestavené, jimiž zpodobenou moudrost posíláme lidem,
+místně či časově vzdáleným, ba dokonce i pozdnímu potomstvu. Nejkrásnějším
+darem Božím je vynález tiskových liter, jimž se knihy nesmírně rychle
+rozmnožují.
+
+Sazeč, maje před sebou kasu, naplněnou kovovými literkami, uloženými v
+přihrádkách, dívá se do rukopisu, postaveného na vidlici tak, aby pohodlně
+viděl, v levé ruce sázítko, pravou rukou vybírá (z přihrádek) literky a
+skládá je do sázítka v slova: když naplní sloupec, přenáší je na desku.
+Jakmile pak je naplněn počet sloupců pro jednu stranu archu, rozdělí je
+příložkami, ováže je a stáhne železnými rámy, aby se nerozpadly; a tím se
+podle svého mínění sví povinnosti zhostil.
+
+A tak tito všichni pracujíce vzájemně vykonávající jakoby hračkou
+podivuhodné dílo, lidem kdysi nepochopitelné, jen když mají všichni to, čeho
+je přitom potření, jednak odborné znalosti zbystřené praxí, jednak vytrvalou
+pozornost a píli. Znalosti: poněvadž třebaže je tiskařství řemeslem, je
+nejsubtilnějším uměním, skládajícím se z přečetných maličkostí, na něž nutno
+dávat dobrý pozor. Pozornost a píli: poněvadž zde, kde se stýká tolik
+maličkostí, velmi snadno se něco přihodí, co by dílo rušilo, kdyby se
+nebdělo.
+
+Tolik ve všeobecnosti o tom, jak se tisknou knihy vůbec. Jestliže by se
+naskytla otázka, jak vznikají knihy dobré, bude třeba říci, že je žádoucí za
+prvé rozumně sepsaný rukopis, hodný světla a nikoli tmy; na druhém místě
+elegantní typy; na třetím čistý papír; na čtvrtém pak pozorná práce, aby vše
+až do poslední čárky bylo zřetelné, rozlišené a správné.
diff --git a/tex/context/sample/third/komensky-vlnka-cz.tex b/tex/context/sample/third/komensky-vlnka-cz.tex
new file mode 100644
index 000000000..17a2ab3f7
--- /dev/null
+++ b/tex/context/sample/third/komensky-vlnka-cz.tex
@@ -0,0 +1,33 @@
+Nejkrásnějším dílem Božím je svět, všeliké neviditelné Božské věcí viditelné
+ukazující. Nejkrásnější je ale naše duše, jíž je dáno, myšlením zobrazovat
+ve svém nitru svět i~věci veškery. Nejkrásnější je řeč, jejíž pomocí
+vmalováváme všeliké obrazy své duše v~duši druhého. Nejkrásnější je písmo,
+jímž zachycujeme a~natrvalo upevňujeme řeč, samu o~sobě prchavou
+a~pomíjející, a~jímž jako bychom ji zadržovali, aby trvala. Nejkrásnější jsou
+knihy, písmem ladně sestavené, jimiž zpodobenou moudrost posíláme lidem,
+místně či časově vzdáleným, ba dokonce i~pozdnímu potomstvu. Nejkrásnějším
+darem Božím je vynález tiskových liter, jimž se knihy nesmírně rychle
+rozmnožují.
+
+Sazeč, maje před sebou kasu, naplněnou kovovými literkami, uloženými
+v~přihrádkách, dívá se do rukopisu, postaveného na vidlici tak, aby pohodlně
+viděl, v~levé ruce sázítko, pravou rukou vybírá (z~přihrádek) literky
+a~skládá je do sázítka v~slova: když naplní sloupec, přenáší je na desku.
+Jakmile pak je naplněn počet sloupců pro jednu stranu archu, rozdělí je
+příložkami, ováže je a~stáhne železnými rámy, aby se nerozpadly; a~tím se
+podle svého mínění sví povinnosti zhostil.
+
+A~tak tito všichni pracujíce vzájemně vykonávající jakoby hračkou
+podivuhodné dílo, lidem kdysi nepochopitelné, jen když mají všichni to, čeho
+je přitom potřebí, jednak odborné znalosti zbystřené praxí, jednak vytrvalou
+pozornost a~píli. Znalosti: poněvadž třebaže je tiskařství řemeslem, je
+nejsubtilnějším uměním, skládajícím se z~přečetných maličkostí, na něž nutno
+dávat dobrý pozor. Pozornost a~píli: poněvadž zde, kde se stýká tolik
+maličkostí, velmi snadno se něco přihodí, co by dílo rušilo, kdyby se
+nebdělo.
+
+Tolik ve všeobecnosti o~tom, jak se tisknou knihy vůbec. Jestliže by se
+naskytla otázka, jak vznikají knihy dobré, bude třeba říci, že je žádoucí za
+prvé rozumně sepsaný rukopis, hodný světla a~nikoli tmy; na druhém místě
+elegantní typy; na třetím čistý papír; na čtvrtém pak pozorná práce, aby vše
+až do poslední čárky bylo zřetelné, rozlišené a~správné.
diff --git a/tex/context/sample/third/krdel-sk.tex b/tex/context/sample/third/krdel-sk.tex
new file mode 100644
index 000000000..2f2395427
--- /dev/null
+++ b/tex/context/sample/third/krdel-sk.tex
@@ -0,0 +1,7 @@
+
+KŔDEĽ ŠŤASTNÝCH ĎATĽOV UČÍ PRI ÚSTÍ VÁHU MĹKVÉHO KOŇA OBHRÝZAŤ KÔRU A ŽRAŤ ČERSTVÉ MÄSO.
+
+Kŕdeľ šťastných ďatľov učí pri ústí Váhu mĺkveho koňa obhrýzať kôru a žrať čerstvé mäso.
+
+0123456789 :;!?()[]\{\} -/--/--- ÖÜŮŘ öüůř
+
diff --git a/tex/context/sample/third/kun-cz.tex b/tex/context/sample/third/kun-cz.tex
new file mode 100644
index 000000000..ee1471c1b
--- /dev/null
+++ b/tex/context/sample/third/kun-cz.tex
@@ -0,0 +1,7 @@
+
+ŽLUŤOUČKÝ KŮŇ ÚPĚL ĎÁBELSKÉ ÓDY,
+
+žluťoučký kůň úpěl ďábelské ódy.
+
+0123456789 :;!?()[]\{\} -/--/--- ŕĺľäöü ŔĹĽÄÖÜ
+
diff --git a/tex/generic/context/luatex/luatex-basics-nod.lua b/tex/generic/context/luatex/luatex-basics-nod.lua
index e22f170ef..879da4bc7 100644
--- a/tex/generic/context/luatex/luatex-basics-nod.lua
+++ b/tex/generic/context/luatex/luatex-basics-nod.lua
@@ -70,81 +70,77 @@ nodes.nodecodes = nodecodes
nodes.glyphcodes = glyphcodes
nodes.disccodes = disccodes
-local flush_node = node.flush_node
-local remove_node = node.remove
-local traverse_id = node.traverse_id
-
nodes.handlers.protectglyphs = node.protect_glyphs -- beware: nodes!
nodes.handlers.unprotectglyphs = node.unprotect_glyphs -- beware: nodes!
-function nodes.remove(head, current, free_too)
- local t = current
- head, current = remove_node(head,current)
- if t then
- if free_too then
- flush_node(t)
- t = nil
- else
- t.next, t.prev = nil, nil
- end
- end
- return head, current, t
-end
-
-function nodes.delete(head,current)
- return nodes.remove(head,current,true)
-end
-
-local getfield = node.getfield
-local setfield = node.setfield
-
-nodes.getfield = getfield
-nodes.setfield = setfield
-
-nodes.getattr = getfield
-nodes.setattr = setfield
-
--- being lazy ... just copy a bunch ... not all needed in generic but we assume
--- nodes to be kind of private anyway
-
-nodes.tostring = node.tostring or tostring
-nodes.copy = node.copy
-nodes.copy_node = node.copy
-nodes.copy_list = node.copy_list
-nodes.delete = node.delete
-nodes.dimensions = node.dimensions
-nodes.end_of_math = node.end_of_math
-nodes.flush_list = node.flush_list
-nodes.flush_node = node.flush_node
-nodes.flush = node.flush_node
-nodes.free = node.free
-nodes.insert_after = node.insert_after
-nodes.insert_before = node.insert_before
-nodes.hpack = node.hpack
-nodes.new = node.new
-nodes.tail = node.tail
-nodes.traverse = node.traverse
-nodes.traverse_id = node.traverse_id
-nodes.slide = node.slide
-nodes.vpack = node.vpack
-
-nodes.first_glyph = node.first_glyph
-nodes.has_glyph = node.has_glyph or node.first_glyph
-
-nodes.current_attr = node.current_attr
-nodes.has_field = node.has_field
-nodes.last_node = node.last_node
-nodes.usedlist = node.usedlist
-nodes.protrusion_skippable = node.protrusion_skippable
-nodes.write = node.write
-
-nodes.has_attribute = node.has_attribute
-nodes.set_attribute = node.set_attribute
-nodes.unset_attribute = node.unset_attribute
-
-nodes.protect_glyphs = node.protect_glyphs
-nodes.unprotect_glyphs = node.unprotect_glyphs
-nodes.mlist_to_hlist = node.mlist_to_hlist
+-- These are now gone in generic as they are context specific.
+
+-- local flush_node = node.flush_node
+-- local remove_node = node.remove
+-- local traverse_id = node.traverse_id
+--
+-- function nodes.remove(head, current, free_too)
+-- local t = current
+-- head, current = remove_node(head,current)
+-- if t then
+-- if free_too then
+-- flush_node(t)
+-- t = nil
+-- else
+-- t.next, t.prev = nil, nil
+-- end
+-- end
+-- return head, current, t
+-- end
+--
+-- function nodes.delete(head,current)
+-- return nodes.remove(head,current,true)
+-- end
+
+----- getfield = node.getfield
+----- setfield = node.setfield
+
+-----.getfield = getfield
+-----.setfield = setfield
+-----.getattr = getfield
+-----.setattr = setfield
+
+-----.tostring = node.tostring or tostring
+-----.copy = node.copy
+-----.copy_node = node.copy
+-----.copy_list = node.copy_list
+-----.delete = node.delete
+-----.dimensions = node.dimensions
+-----.end_of_math = node.end_of_math
+-----.flush_list = node.flush_list
+-----.flush_node = node.flush_node
+-----.flush = node.flush_node
+-----.free = node.free
+-----.insert_after = node.insert_after
+-----.insert_before = node.insert_before
+-----.hpack = node.hpack
+-----.new = node.new
+-----.tail = node.tail
+-----.traverse = node.traverse
+-----.traverse_id = node.traverse_id
+-----.slide = node.slide
+-----.vpack = node.vpack
+
+-----.first_glyph = node.first_glyph
+-----.has_glyph = node.has_glyph or node.first_glyph
+-----.current_attr = node.current_attr
+-----.has_field = node.has_field
+-----.usedlist = node.usedlist
+-----.protrusion_skippable = node.protrusion_skippable
+-----.write = node.write
+
+-----.has_attribute = node.has_attribute
+-----.set_attribute = node.set_attribute
+-----.unset_attribute = node.unset_attribute
+
+-----.protect_glyphs = node.protect_glyphs
+-----.unprotect_glyphs = node.unprotect_glyphs
+-----.mlist_to_hlist = node.mlist_to_hlist
-- in generic code, at least for some time, we stay nodes, while in context
-- we can go nuts (e.g. experimental); this split permits us us keep code
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 6fab6ea69..766b869fe 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 : 03/05/19 15:40:37
+-- merge date : 03/21/19 21:39:34
do -- begin closure to overcome local limits and interference
@@ -120,7 +120,6 @@ elseif not ffi.number then
ffi.number=tonumber
end
if LUAVERSION>5.3 then
- collectgarbage("generational")
end
end -- closure
@@ -2677,40 +2676,45 @@ local reslasher=lpeg.replacer(P("\\"),"/")
function file.reslash(str)
return str and lpegmatch(reslasher,str)
end
-function file.is_writable(name)
- if not name then
- elseif lfs.isdir(name) then
- name=name.."/m_t_x_t_e_s_t.tmp"
- local f=io.open(name,"wb")
- if f then
- f:close()
- os.remove(name)
- return true
- end
- elseif lfs.isfile(name) then
- local f=io.open(name,"ab")
- if f then
- f:close()
- return true
- end
- else
- local f=io.open(name,"ab")
- if f then
- f:close()
- os.remove(name)
- return true
+if lfs.isreadablefile and lfs.iswritablefile then
+ file.is_readable=lfs.isreadablefile
+ file.is_writable=lfs.iswritablefile
+else
+ function file.is_writable(name)
+ if not name then
+ elseif lfs.isdir(name) then
+ name=name.."/m_t_x_t_e_s_t.tmp"
+ local f=io.open(name,"wb")
+ if f then
+ f:close()
+ os.remove(name)
+ return true
+ end
+ elseif lfs.isfile(name) then
+ local f=io.open(name,"ab")
+ if f then
+ f:close()
+ return true
+ end
+ else
+ local f=io.open(name,"ab")
+ if f then
+ f:close()
+ os.remove(name)
+ return true
+ end
end
- end
- return false
-end
-local readable=P("r")*Cc(true)
-function file.is_readable(name)
- if name then
- local a=attributes(name)
- return a and lpegmatch(readable,a.permissions) or false
- else
return false
end
+ local readable=P("r")*Cc(true)
+ function file.is_readable(name)
+ if name then
+ local a=attributes(name)
+ return a and lpegmatch(readable,a.permissions) or false
+ else
+ return false
+ end
+ end
end
file.isreadable=file.is_readable
file.iswritable=file.is_writable
@@ -3070,7 +3074,6 @@ local format,gsub,rep,sub,find=string.format,string.gsub,string.rep,string.sub,s
local load,dump=load,string.dump
local tonumber,type,tostring,next,setmetatable=tonumber,type,tostring,next,setmetatable
local unpack,concat=table.unpack,table.concat
-local unpack,concat=table.unpack,table.concat
local P,V,C,S,R,Ct,Cs,Cp,Carg,Cc=lpeg.P,lpeg.V,lpeg.C,lpeg.S,lpeg.R,lpeg.Ct,lpeg.Cs,lpeg.Cp,lpeg.Carg,lpeg.Cc
local patterns,lpegmatch=lpeg.patterns,lpeg.match
local utfchar,utfbyte,utflen=utf.char,utf.byte,utf.len
@@ -4099,6 +4102,32 @@ if bit32 then
local b=char(n%256)
f:write(b,a)
end
+ function files.writecardinal4(f,n)
+ local a=char(n%256)
+ n=rshift(n,8)
+ local b=char(n%256)
+ n=rshift(n,8)
+ local c=char(n%256)
+ n=rshift(n,8)
+ local d=char(n%256)
+ f:write(d,c,b,a)
+ end
+ function files.writecardinal2le(f,n)
+ local a=char(n%256)
+ n=rshift(n,8)
+ local b=char(n%256)
+ f:write(a,b)
+ end
+ function files.writecardinal4le(f,n)
+ local a=char(n%256)
+ n=rshift(n,8)
+ local b=char(n%256)
+ n=rshift(n,8)
+ local c=char(n%256)
+ n=rshift(n,8)
+ local d=char(n%256)
+ f:write(a,b,c,d)
+ end
else
local floor=math.floor
function files.writecardinal2(f,n)
@@ -4107,16 +4136,32 @@ else
local b=char(n%256)
f:write(b,a)
end
-end
-function files.writecardinal4(f,n)
- local a=char(n%256)
- n=rshift(n,8)
- local b=char(n%256)
- n=rshift(n,8)
- local c=char(n%256)
- n=rshift(n,8)
- local d=char(n%256)
- f:write(d,c,b,a)
+ function files.writecardinal4(f,n)
+ local a=char(n%256)
+ n=floor(n/256)
+ local b=char(n%256)
+ n=floor(n/256)
+ local c=char(n%256)
+ n=floor(n/256)
+ local d=char(n%256)
+ f:write(d,c,b,a)
+ end
+ function files.writecardinal2le(f,n)
+ local a=char(n%256)
+ n=floor(n/256)
+ local b=char(n%256)
+ f:write(a,b)
+ end
+ function files.writecardinal4le(f,n)
+ local a=char(n%256)
+ n=floor(n/256)
+ local b=char(n%256)
+ n=floor(n/256)
+ local c=char(n%256)
+ n=floor(n/256)
+ local d=char(n%256)
+ f:write(a,b,c,d)
+ end
end
function files.writestring(f,s)
f:write(char(byte(s,1,#s)))
@@ -4129,10 +4174,18 @@ if fio and fio.readcardinal1 then
files.readcardinal2=fio.readcardinal2
files.readcardinal3=fio.readcardinal3
files.readcardinal4=fio.readcardinal4
+ files.readcardinal1le=fio.readcardinal1le or files.readcardinal1le
+ files.readcardinal2le=fio.readcardinal2le or files.readcardinal2le
+ files.readcardinal3le=fio.readcardinal3le or files.readcardinal3le
+ files.readcardinal4le=fio.readcardinal4le or files.readcardinal4le
files.readinteger1=fio.readinteger1
files.readinteger2=fio.readinteger2
files.readinteger3=fio.readinteger3
files.readinteger4=fio.readinteger4
+ files.readinteger1le=fio.readinteger1le or files.readinteger1le
+ files.readinteger2le=fio.readinteger2le or files.readinteger2le
+ files.readinteger3le=fio.readinteger3le or files.readinteger3le
+ files.readinteger4le=fio.readinteger4le or files.readinteger4le
files.readfixed2=fio.readfixed2
files.readfixed4=fio.readfixed4
files.read2dot14=fio.read2dot14
@@ -4153,6 +4206,24 @@ if fio and fio.readcardinal1 then
skipposition(f,4*(n or 1))
end
end
+if fio and fio.writecardinal1 then
+ files.writecardinal1=fio.writecardinal1
+ files.writecardinal2=fio.writecardinal2
+ files.writecardinal3=fio.writecardinal3
+ files.writecardinal4=fio.writecardinal4
+ files.writecardinal1le=fio.writecardinal1le
+ files.writecardinal2le=fio.writecardinal2le
+ files.writecardinal3le=fio.writecardinal3le
+ files.writecardinal4le=fio.writecardinal4le
+ files.writeinteger1=fio.writeinteger1 or fio.writecardinal1
+ files.writeinteger2=fio.writeinteger2 or fio.writecardinal2
+ files.writeinteger3=fio.writeinteger3 or fio.writecardinal3
+ files.writeinteger4=fio.writeinteger4 or fio.writecardinal4
+ files.writeinteger1le=files.writeinteger1le or fio.writecardinal1le
+ files.writeinteger2le=files.writeinteger2le or fio.writecardinal2le
+ files.writeinteger3le=files.writeinteger3le or fio.writecardinal3le
+ files.writeinteger4le=files.writeinteger4le or fio.writecardinal4le
+end
if fio and fio.readcardinaltable then
files.readcardinaltable=fio.readcardinaltable
files.readintegertable=fio.readintegertable
@@ -4737,67 +4808,8 @@ end
nodes.nodecodes=nodecodes
nodes.glyphcodes=glyphcodes
nodes.disccodes=disccodes
-local flush_node=node.flush_node
-local remove_node=node.remove
-local traverse_id=node.traverse_id
nodes.handlers.protectglyphs=node.protect_glyphs
-nodes.handlers.unprotectglyphs=node.unprotect_glyphs
-function nodes.remove(head,current,free_too)
- local t=current
- head,current=remove_node(head,current)
- if t then
- if free_too then
- flush_node(t)
- t=nil
- else
- t.next,t.prev=nil,nil
- end
- end
- return head,current,t
-end
-function nodes.delete(head,current)
- return nodes.remove(head,current,true)
-end
-local getfield=node.getfield
-local setfield=node.setfield
-nodes.getfield=getfield
-nodes.setfield=setfield
-nodes.getattr=getfield
-nodes.setattr=setfield
-nodes.tostring=node.tostring or tostring
-nodes.copy=node.copy
-nodes.copy_node=node.copy
-nodes.copy_list=node.copy_list
-nodes.delete=node.delete
-nodes.dimensions=node.dimensions
-nodes.end_of_math=node.end_of_math
-nodes.flush_list=node.flush_list
-nodes.flush_node=node.flush_node
-nodes.flush=node.flush_node
-nodes.free=node.free
-nodes.insert_after=node.insert_after
-nodes.insert_before=node.insert_before
-nodes.hpack=node.hpack
-nodes.new=node.new
-nodes.tail=node.tail
-nodes.traverse=node.traverse
-nodes.traverse_id=node.traverse_id
-nodes.slide=node.slide
-nodes.vpack=node.vpack
-nodes.first_glyph=node.first_glyph
-nodes.has_glyph=node.has_glyph or node.first_glyph
-nodes.current_attr=node.current_attr
-nodes.has_field=node.has_field
-nodes.last_node=node.last_node
-nodes.usedlist=node.usedlist
-nodes.protrusion_skippable=node.protrusion_skippable
-nodes.write=node.write
-nodes.has_attribute=node.has_attribute
-nodes.set_attribute=node.set_attribute
-nodes.unset_attribute=node.unset_attribute
-nodes.protect_glyphs=node.protect_glyphs
-nodes.unprotect_glyphs=node.unprotect_glyphs
-nodes.mlist_to_hlist=node.mlist_to_hlist
+nodes.handlers.unprotectglyphs=node.unprotect_glyphs
local direct=node.direct
local nuts={}
nodes.nuts=nuts
@@ -30089,7 +30101,7 @@ function handlers.devanagari_reorder_pre_base_reordering_consonants(head,start)
end
function handlers.devanagari_remove_joiners(head,start,kind,lookupname,replacement)
local stop=getnext(start)
- local font=getfont(start)
+ local font=getfont(start)
local last=start
while stop do
local char=ischar(stop,font)
@@ -33242,7 +33254,7 @@ local function check_afm(specification,fullname)
if foundname=="" then
foundname=fonts.names.getfilename(fullname,"afm") or ""
end
- if foundname=="" and afm.autoprefixed then
+ if fullname and foundname=="" and afm.autoprefixed then
local encoding,shortname=match(fullname,"^(.-)%-(.*)$")
if encoding and shortname and fonts.encodings.known[encoding] then
shortname=findbinfile(shortname,'afm') or ""