diff options
-rw-r--r-- | scripts/context/lua/luatools.lua | 73 | ||||
-rw-r--r-- | scripts/context/lua/mtx-watch.lua | 113 | ||||
-rw-r--r-- | scripts/context/lua/mtxrun.lua | 58 | ||||
-rw-r--r-- | scripts/context/stubs/mswin/luatools.lua | 73 | ||||
-rw-r--r-- | scripts/context/stubs/mswin/mtxrun.lua | 58 | ||||
-rwxr-xr-x | scripts/context/stubs/unix/luatools | 73 | ||||
-rwxr-xr-x | scripts/context/stubs/unix/mtxrun | 58 | ||||
-rw-r--r-- | tex/context/base/attr-ini.mkiv | 1 | ||||
-rw-r--r-- | tex/context/base/cont-new.tex | 2 | ||||
-rw-r--r-- | tex/context/base/context.mkiv | 3 | ||||
-rw-r--r-- | tex/context/base/context.tex | 2 | ||||
-rw-r--r-- | tex/context/base/data-res.lua | 13 | ||||
-rw-r--r-- | tex/context/base/font-mis.lua | 2 | ||||
-rw-r--r-- | tex/context/base/font-otf.lua | 31 | ||||
-rw-r--r-- | tex/context/base/lxml-tex.lua | 14 | ||||
-rw-r--r-- | tex/context/base/math-dim.lua | 6 | ||||
-rw-r--r-- | tex/context/base/s-fnt-25.tex | 2 | ||||
-rw-r--r-- | tex/context/base/syst-ini.tex | 7 | ||||
-rw-r--r-- | tex/generic/context/luatex-fonts-merged.lua | 33 | ||||
-rw-r--r-- | web2c/context.cnf | 5 |
20 files changed, 430 insertions, 197 deletions
diff --git a/scripts/context/lua/luatools.lua b/scripts/context/lua/luatools.lua index 06e2a1bfc..ae5122509 100644 --- a/scripts/context/lua/luatools.lua +++ b/scripts/context/lua/luatools.lua @@ -322,6 +322,8 @@ if not modules then modules = { } end modules ['l-lpeg'] = { license = "see context related readme files" } +lpeg = require("lpeg") + local P, R, S, Ct, C, Cs, Cc = lpeg.P, lpeg.R, lpeg.S, lpeg.Ct, lpeg.C, lpeg.Cs, lpeg.Cc --~ l-lpeg.lua : @@ -1383,7 +1385,7 @@ function io.savedata(filename,data,joiner) elseif type(data) == "function" then data(f) else - f:write(data) + f:write(data or "") end f:close() return true @@ -1702,7 +1704,13 @@ local find, format = string.find, string.format local random, ceil = math.random, math.ceil function os.resultof(command) - return io.popen(command,"r"):read("*all") + local handle = io.popen(command,"r") + if not handle then + -- print("unknown command '".. command .. "' in os.resultof") + return "" + else + return handle:read("*all") or "" + end end if not os.exec then os.exec = os.execute end @@ -1762,14 +1770,6 @@ end --~ print(os.date("%H:%M:%S",os.gettimeofday())) --~ print(os.date("%H:%M:%S",os.time())) -os.arch = os.arch or function() - local a = os.resultof("uname -m") or "linux" - os.arch = function() - return a - end - return a -end - -- no need for function anymore as we have more clever code and helpers now os.platform = os.name @@ -1785,7 +1785,13 @@ if name == "windows" or name == "mswin" or name == "win32" or name == "msdos" th end os.libsuffix = 'dll' else - local architecture = os.arch() + local architecture = os.getenv("HOSTTYPE") or "" + if architecture == "" then + architecture = os.resultof("uname -m") or "" + end + if architecture == "" then + local architecture = os.resultof("echo $HOSTTYPE") + end if name == "linux" then if find(architecture,"x86_64") then os.platform = "linux-64" @@ -1795,7 +1801,6 @@ else os.platform = "linux" end elseif name == "macosx" then - local architecture = os.resultof("echo $HOSTTYPE") if find(architecture,"i386") then os.platform = "osx-intel" elseif find(architecture,"x86_64") then @@ -2720,13 +2725,34 @@ if not modules then modules = { } end modules ['l-unicode'] = { license = "see context related readme files" } +if not unicode then + + unicode = { utf8 = { } } + + local floor, char = math.floor, string.char + + function unicode.utf8.utfchar(n) + if n < 0x80 then + return char(n) + elseif n < 0x800 then + return char(0xC0 + floor(n/0x40)) .. char(0x80 + (n % 0x40)) + elseif n < 0x10000 then + return char(0xE0 + floor(n/0x1000)) .. char(0x80 + (floor(n/0x40) % 0x40)) .. char(0x80 + (n % 0x40)) + elseif n < 0x40000 then + return char(0xF0 + floor(n/0x40000)) .. char(0x80 + floor(n/0x1000)) .. char(0x80 + (floor(n/0x40) % 0x40)) .. char(0x80 + (n % 0x40)) + else -- wrong: + -- return char(0xF1 + floor(n/0x1000000)) .. char(0x80 + floor(n/0x40000)) .. char(0x80 + floor(n/0x1000)) .. char(0x80 + (floor(n/0x40) % 0x40)) .. char(0x80 + (n % 0x40)) + return "?" + end + end + +end + utf = utf or unicode.utf8 local concat, utfchar, utfgsub = table.concat, utf.char, utf.gsub local char, byte, find, bytepairs = string.char, string.byte, string.find, string.bytepairs -unicode = unicode or { } - -- 0 EF BB BF UTF-8 -- 1 FF FE UTF-16-little-endian -- 2 FE FF UTF-16-big-endian @@ -4238,12 +4264,12 @@ function logs.tex.stop_page_number() if real > 0 then if user > 0 then if sub > 0 then - logs.report("pages", "flushing page, realpage %s, userpage %s, subpage %s",real,user,sub) + logs.report("pages", "flushing realpage %s, userpage %s, subpage %s",real,user,sub) else - logs.report("pages", "flushing page, realpage %s, userpage %s",real,user) + logs.report("pages", "flushing realpage %s, userpage %s",real,user) end else - logs.report("pages", "flushing page, realpage %s",real) + logs.report("pages", "flushing realpage %s",real) end else logs.report("pages", "flushing page") @@ -4818,7 +4844,7 @@ end local function splitpathexpr(str, t, validate) -- no need for further optimization as it is only called a -- few times, we can use lpeg for the sub - if trace_expansion then + if trace_expansions then logs.report("fileio","expanding variable '%s'",str) end t = t or { } @@ -5305,10 +5331,13 @@ local function split_kpse_path(str) -- beware, this can be either a path or a {s local found = cache[str] if not found then str = gsub(str,"\\","/") - if find(str,";") then - found = checkedsplit(str,";") - else - found = checkedsplit(str,io.pathseparator) + local split = (find(str,";") and checkedsplit(str,";")) or checkedsplit(str,io.pathseparator) + found = { } + for i=1,#split do + local s = split[i] + if not find(s,"^{*unset}*") then + found[#found+1] = s + end end if trace_expansions then logs.report("fileio","splitting path specification '%s'",str) diff --git a/scripts/context/lua/mtx-watch.lua b/scripts/context/lua/mtx-watch.lua index 15e0f81e9..d897d6beb 100644 --- a/scripts/context/lua/mtx-watch.lua +++ b/scripts/context/lua/mtx-watch.lua @@ -9,7 +9,7 @@ if not modules then modules = { } end modules ['mtx-watch'] = { scripts = scripts or { } scripts.watch = scripts.watch or { } -local format, concat, time, difftime = string.format, table.concat, os.difftime +local format, concat, difftime, time = string.format, table.concat, os.difftime, os.time local pairs, ipairs, next, type = pairs, ipairs, next, type function scripts.watch.save_exa_modes(joblog,ctmname) @@ -74,7 +74,10 @@ end local clock = os.gettimeofday or os.time -- we cannot trust os.clock on linux function scripts.watch.watch() - local delay = environment.argument("delay") or 5 + local delay = tonumber(environment.argument("delay") or 5) or 5 + if delay == 0 then + delay = .25 + end local logpath = environment.argument("logpath") or "" local pipe = environment.argument("pipe") or false local watcher = "mtxwatch.run" @@ -156,6 +159,18 @@ function scripts.watch.watch() end end local n, start = 0, time() +--~ local function wait() +--~ io.flush() +--~ if not done then +--~ n = n + 1 +--~ if n >= 10 then +--~ logs.report("watch", format("run time: %i seconds, memory usage: %0.3g MB", difftime(time(),start), (status.luastate_bytes/1024)/1000)) +--~ n = 0 +--~ end +--~ os.sleep(delay) +--~ end +--~ end + local wtime = 0 local function wait() io.flush() if not done then @@ -164,40 +179,58 @@ function scripts.watch.watch() logs.report("watch", format("run time: %i seconds, memory usage: %0.3g MB", difftime(time(),start), (status.luastate_bytes/1024)/1000)) n = 0 end - os.sleep(delay) + local ttime = 0 + while ttime <= delay do + local wt = lfs.attributes(watcher,"mtime") + if wt and wt ~= wtime then + -- fast signal that there is a request + wtime = wt + break + end + ttime = ttime + 0.2 + os.sleep(0.2) + end end end -local function wait() - io.flush() - local wtime, ttime = 0, 0 - if not done then - n = n + 1 - if n >= 10 then - logs.report("watch", format("run time: %i seconds, memory usage: %0.3g MB", difftime(time(),start), (status.luastate_bytes/1024)/1000)) - n = 0 - end - while true do - local wt = lfs.attributes(watcher,"mtime") - if wt ~= wtime then - -- fast signal that there is a request - wtime = wt - break - else - ttime = ttime + 0.2 - if ttime >= delay then - break + local cleanupdelay, cleanup = environment.argument("cleanup"), false + if cleanupdelay then + local lasttime = time() + cleanup = function() + local currenttime = time() + local delta = difftime(currenttime,lasttime) + if delta > cleanupdelay then + lasttime = currenttime + for _, path in ipairs(environment.files) do + if string.find(path,"%.") then + -- safeguard, we want a fully qualified path + else + local files = dir.glob(file.join(path,"*")) + for _, name in ipairs(files) do + local filetime = lfs.attributes(name,"modification") + local delta = difftime(currenttime,filetime) + if delta > cleanupdelay then + -- logs.report("watch",format("cleaning up '%s'",name)) + os.remove(name) + end + end + end + end end end - os.sleep(0.2) + else + cleanup = function() + -- nothing + end end - end -end while true do if false then +--~ if true then process() + cleanup() wait() else pcall(process) + pcall(cleanup) pcall(wait) end end @@ -280,14 +313,40 @@ function scripts.watch.show_logs(path) -- removes duplicates end end +function scripts.watch.cleanup_stale_files() -- removes duplicates + local path = environment.files[1] + local delay = tonumber(environment.argument("cleanup")) + local force = environment.argument("force") + if not path or path == "." then + logs.report("watch","provide qualified path") + elseif not delay then + logs.report("watch","missing --cleanup=delay") + else + logs.report("watch","dryrun, use --force for real cleanup") + local files = dir.glob(file.join(path,"*")) + local rtime = time() + for _, name in ipairs(files) do + local mtime = lfs.attributes(name,"modification") + local delta = difftime(rtime,mtime) + if delta > delay then + logs.report("watch",format("cleaning up '%s'",name)) + if force then + os.remove(name) + end + end + end + end +end + logs.extendbanner("ConTeXt Request Watchdog 1.00",true) messages.help = [[ --logpath optional path for log files ---watch watch given path +--watch watch given path [--delay] --pipe use pipe instead of execute --delay delay between sweeps --collect condense log files +--cleanup=delay remove files in given path [--force] --showlog show log data ]] @@ -295,6 +354,8 @@ if environment.argument("watch") then scripts.watch.watch() elseif environment.argument("collect") then scripts.watch.save_logs(scripts.watch.collect_logs()) +elseif environment.argument("cleanup") then + scripts.watch.save_logs(scripts.watch.cleanup_stale_files()) elseif environment.argument("showlog") then scripts.watch.show_logs() else diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index c5b0acd04..03b454993 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -331,6 +331,8 @@ if not modules then modules = { } end modules ['l-lpeg'] = { license = "see context related readme files" } +lpeg = require("lpeg") + local P, R, S, Ct, C, Cs, Cc = lpeg.P, lpeg.R, lpeg.S, lpeg.Ct, lpeg.C, lpeg.Cs, lpeg.Cc --~ l-lpeg.lua : @@ -1392,7 +1394,7 @@ function io.savedata(filename,data,joiner) elseif type(data) == "function" then data(f) else - f:write(data) + f:write(data or "") end f:close() return true @@ -1711,7 +1713,13 @@ local find, format = string.find, string.format local random, ceil = math.random, math.ceil function os.resultof(command) - return io.popen(command,"r"):read("*all") + local handle = io.popen(command,"r") + if not handle then + -- print("unknown command '".. command .. "' in os.resultof") + return "" + else + return handle:read("*all") or "" + end end if not os.exec then os.exec = os.execute end @@ -1771,14 +1779,6 @@ end --~ print(os.date("%H:%M:%S",os.gettimeofday())) --~ print(os.date("%H:%M:%S",os.time())) -os.arch = os.arch or function() - local a = os.resultof("uname -m") or "linux" - os.arch = function() - return a - end - return a -end - -- no need for function anymore as we have more clever code and helpers now os.platform = os.name @@ -1794,7 +1794,13 @@ if name == "windows" or name == "mswin" or name == "win32" or name == "msdos" th end os.libsuffix = 'dll' else - local architecture = os.arch() + local architecture = os.getenv("HOSTTYPE") or "" + if architecture == "" then + architecture = os.resultof("uname -m") or "" + end + if architecture == "" then + local architecture = os.resultof("echo $HOSTTYPE") + end if name == "linux" then if find(architecture,"x86_64") then os.platform = "linux-64" @@ -1804,7 +1810,6 @@ else os.platform = "linux" end elseif name == "macosx" then - local architecture = os.resultof("echo $HOSTTYPE") if find(architecture,"i386") then os.platform = "osx-intel" elseif find(architecture,"x86_64") then @@ -3811,13 +3816,15 @@ local text_parsed = Cs(((1-open-ampersand)^1 + entity)^1) local somespace = space^1 local optionalspace = space^0 -local value = (squote * C((1 - squote)^0) * squote) + (dquote * C((1 - dquote)^0) * dquote) -- ampersand and < also invalid in value +----- value = (squote * C((1 - squote)^0) * squote) + (dquote * C((1 - dquote)^0) * dquote) -- ampersand and < also invalid in value +local value = (squote * Cs((entity + (1 - squote))^0) * squote) + (dquote * Cs((entity + (1 - dquote))^0) * dquote) -- ampersand and < also invalid in value local endofattributes = slash * close + close -- recovery of flacky html local whatever = space * name * optionalspace * equal local wrongvalue = C(P(1-whatever-close)^1 + P(1-close)^1) / attribute_value_error ------ local wrongvalue = C(P(1-whatever-endofattributes)^1 + P(1-endofattributes)^1) / attribute_value_error -local wrongvalue = C(P(1-space-endofattributes)^1) / attribute_value_error +----- wrongvalue = C(P(1-whatever-endofattributes)^1 + P(1-endofattributes)^1) / attribute_value_error +----- wrongvalue = C(P(1-space-endofattributes)^1) / attribute_value_error +local wrongvalue = Cs(P(entity + (1-space-endofattributes))^1) / attribute_value_error local attributevalue = value + wrongvalue @@ -5530,7 +5537,7 @@ local type, next, tonumber, tostring, setmetatable, loadstring = type, next, ton local format, gsub = string.format, string.gsub --[[ldx-- -<p>The following helper functions best belong to the <t>lmxl-ini</t> +<p>The following helper functions best belong to the <t>lxml-ini</t> module. Some are here because we need then in the <t>mk</t> document and other manuals, others came up when playing with this module. Since this module is also used in <l n='mtxrun'/> we've @@ -6982,12 +6989,12 @@ function logs.tex.stop_page_number() if real > 0 then if user > 0 then if sub > 0 then - logs.report("pages", "flushing page, realpage %s, userpage %s, subpage %s",real,user,sub) + logs.report("pages", "flushing realpage %s, userpage %s, subpage %s",real,user,sub) else - logs.report("pages", "flushing page, realpage %s, userpage %s",real,user) + logs.report("pages", "flushing realpage %s, userpage %s",real,user) end else - logs.report("pages", "flushing page, realpage %s",real) + logs.report("pages", "flushing realpage %s",real) end else logs.report("pages", "flushing page") @@ -7562,7 +7569,7 @@ end local function splitpathexpr(str, t, validate) -- no need for further optimization as it is only called a -- few times, we can use lpeg for the sub - if trace_expansion then + if trace_expansions then logs.report("fileio","expanding variable '%s'",str) end t = t or { } @@ -8049,10 +8056,13 @@ local function split_kpse_path(str) -- beware, this can be either a path or a {s local found = cache[str] if not found then str = gsub(str,"\\","/") - if find(str,";") then - found = checkedsplit(str,";") - else - found = checkedsplit(str,io.pathseparator) + local split = (find(str,";") and checkedsplit(str,";")) or checkedsplit(str,io.pathseparator) + found = { } + for i=1,#split do + local s = split[i] + if not find(s,"^{*unset}*") then + found[#found+1] = s + end end if trace_expansions then logs.report("fileio","splitting path specification '%s'",str) diff --git a/scripts/context/stubs/mswin/luatools.lua b/scripts/context/stubs/mswin/luatools.lua index 06e2a1bfc..ae5122509 100644 --- a/scripts/context/stubs/mswin/luatools.lua +++ b/scripts/context/stubs/mswin/luatools.lua @@ -322,6 +322,8 @@ if not modules then modules = { } end modules ['l-lpeg'] = { license = "see context related readme files" } +lpeg = require("lpeg") + local P, R, S, Ct, C, Cs, Cc = lpeg.P, lpeg.R, lpeg.S, lpeg.Ct, lpeg.C, lpeg.Cs, lpeg.Cc --~ l-lpeg.lua : @@ -1383,7 +1385,7 @@ function io.savedata(filename,data,joiner) elseif type(data) == "function" then data(f) else - f:write(data) + f:write(data or "") end f:close() return true @@ -1702,7 +1704,13 @@ local find, format = string.find, string.format local random, ceil = math.random, math.ceil function os.resultof(command) - return io.popen(command,"r"):read("*all") + local handle = io.popen(command,"r") + if not handle then + -- print("unknown command '".. command .. "' in os.resultof") + return "" + else + return handle:read("*all") or "" + end end if not os.exec then os.exec = os.execute end @@ -1762,14 +1770,6 @@ end --~ print(os.date("%H:%M:%S",os.gettimeofday())) --~ print(os.date("%H:%M:%S",os.time())) -os.arch = os.arch or function() - local a = os.resultof("uname -m") or "linux" - os.arch = function() - return a - end - return a -end - -- no need for function anymore as we have more clever code and helpers now os.platform = os.name @@ -1785,7 +1785,13 @@ if name == "windows" or name == "mswin" or name == "win32" or name == "msdos" th end os.libsuffix = 'dll' else - local architecture = os.arch() + local architecture = os.getenv("HOSTTYPE") or "" + if architecture == "" then + architecture = os.resultof("uname -m") or "" + end + if architecture == "" then + local architecture = os.resultof("echo $HOSTTYPE") + end if name == "linux" then if find(architecture,"x86_64") then os.platform = "linux-64" @@ -1795,7 +1801,6 @@ else os.platform = "linux" end elseif name == "macosx" then - local architecture = os.resultof("echo $HOSTTYPE") if find(architecture,"i386") then os.platform = "osx-intel" elseif find(architecture,"x86_64") then @@ -2720,13 +2725,34 @@ if not modules then modules = { } end modules ['l-unicode'] = { license = "see context related readme files" } +if not unicode then + + unicode = { utf8 = { } } + + local floor, char = math.floor, string.char + + function unicode.utf8.utfchar(n) + if n < 0x80 then + return char(n) + elseif n < 0x800 then + return char(0xC0 + floor(n/0x40)) .. char(0x80 + (n % 0x40)) + elseif n < 0x10000 then + return char(0xE0 + floor(n/0x1000)) .. char(0x80 + (floor(n/0x40) % 0x40)) .. char(0x80 + (n % 0x40)) + elseif n < 0x40000 then + return char(0xF0 + floor(n/0x40000)) .. char(0x80 + floor(n/0x1000)) .. char(0x80 + (floor(n/0x40) % 0x40)) .. char(0x80 + (n % 0x40)) + else -- wrong: + -- return char(0xF1 + floor(n/0x1000000)) .. char(0x80 + floor(n/0x40000)) .. char(0x80 + floor(n/0x1000)) .. char(0x80 + (floor(n/0x40) % 0x40)) .. char(0x80 + (n % 0x40)) + return "?" + end + end + +end + utf = utf or unicode.utf8 local concat, utfchar, utfgsub = table.concat, utf.char, utf.gsub local char, byte, find, bytepairs = string.char, string.byte, string.find, string.bytepairs -unicode = unicode or { } - -- 0 EF BB BF UTF-8 -- 1 FF FE UTF-16-little-endian -- 2 FE FF UTF-16-big-endian @@ -4238,12 +4264,12 @@ function logs.tex.stop_page_number() if real > 0 then if user > 0 then if sub > 0 then - logs.report("pages", "flushing page, realpage %s, userpage %s, subpage %s",real,user,sub) + logs.report("pages", "flushing realpage %s, userpage %s, subpage %s",real,user,sub) else - logs.report("pages", "flushing page, realpage %s, userpage %s",real,user) + logs.report("pages", "flushing realpage %s, userpage %s",real,user) end else - logs.report("pages", "flushing page, realpage %s",real) + logs.report("pages", "flushing realpage %s",real) end else logs.report("pages", "flushing page") @@ -4818,7 +4844,7 @@ end local function splitpathexpr(str, t, validate) -- no need for further optimization as it is only called a -- few times, we can use lpeg for the sub - if trace_expansion then + if trace_expansions then logs.report("fileio","expanding variable '%s'",str) end t = t or { } @@ -5305,10 +5331,13 @@ local function split_kpse_path(str) -- beware, this can be either a path or a {s local found = cache[str] if not found then str = gsub(str,"\\","/") - if find(str,";") then - found = checkedsplit(str,";") - else - found = checkedsplit(str,io.pathseparator) + local split = (find(str,";") and checkedsplit(str,";")) or checkedsplit(str,io.pathseparator) + found = { } + for i=1,#split do + local s = split[i] + if not find(s,"^{*unset}*") then + found[#found+1] = s + end end if trace_expansions then logs.report("fileio","splitting path specification '%s'",str) diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index c5b0acd04..03b454993 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -331,6 +331,8 @@ if not modules then modules = { } end modules ['l-lpeg'] = { license = "see context related readme files" } +lpeg = require("lpeg") + local P, R, S, Ct, C, Cs, Cc = lpeg.P, lpeg.R, lpeg.S, lpeg.Ct, lpeg.C, lpeg.Cs, lpeg.Cc --~ l-lpeg.lua : @@ -1392,7 +1394,7 @@ function io.savedata(filename,data,joiner) elseif type(data) == "function" then data(f) else - f:write(data) + f:write(data or "") end f:close() return true @@ -1711,7 +1713,13 @@ local find, format = string.find, string.format local random, ceil = math.random, math.ceil function os.resultof(command) - return io.popen(command,"r"):read("*all") + local handle = io.popen(command,"r") + if not handle then + -- print("unknown command '".. command .. "' in os.resultof") + return "" + else + return handle:read("*all") or "" + end end if not os.exec then os.exec = os.execute end @@ -1771,14 +1779,6 @@ end --~ print(os.date("%H:%M:%S",os.gettimeofday())) --~ print(os.date("%H:%M:%S",os.time())) -os.arch = os.arch or function() - local a = os.resultof("uname -m") or "linux" - os.arch = function() - return a - end - return a -end - -- no need for function anymore as we have more clever code and helpers now os.platform = os.name @@ -1794,7 +1794,13 @@ if name == "windows" or name == "mswin" or name == "win32" or name == "msdos" th end os.libsuffix = 'dll' else - local architecture = os.arch() + local architecture = os.getenv("HOSTTYPE") or "" + if architecture == "" then + architecture = os.resultof("uname -m") or "" + end + if architecture == "" then + local architecture = os.resultof("echo $HOSTTYPE") + end if name == "linux" then if find(architecture,"x86_64") then os.platform = "linux-64" @@ -1804,7 +1810,6 @@ else os.platform = "linux" end elseif name == "macosx" then - local architecture = os.resultof("echo $HOSTTYPE") if find(architecture,"i386") then os.platform = "osx-intel" elseif find(architecture,"x86_64") then @@ -3811,13 +3816,15 @@ local text_parsed = Cs(((1-open-ampersand)^1 + entity)^1) local somespace = space^1 local optionalspace = space^0 -local value = (squote * C((1 - squote)^0) * squote) + (dquote * C((1 - dquote)^0) * dquote) -- ampersand and < also invalid in value +----- value = (squote * C((1 - squote)^0) * squote) + (dquote * C((1 - dquote)^0) * dquote) -- ampersand and < also invalid in value +local value = (squote * Cs((entity + (1 - squote))^0) * squote) + (dquote * Cs((entity + (1 - dquote))^0) * dquote) -- ampersand and < also invalid in value local endofattributes = slash * close + close -- recovery of flacky html local whatever = space * name * optionalspace * equal local wrongvalue = C(P(1-whatever-close)^1 + P(1-close)^1) / attribute_value_error ------ local wrongvalue = C(P(1-whatever-endofattributes)^1 + P(1-endofattributes)^1) / attribute_value_error -local wrongvalue = C(P(1-space-endofattributes)^1) / attribute_value_error +----- wrongvalue = C(P(1-whatever-endofattributes)^1 + P(1-endofattributes)^1) / attribute_value_error +----- wrongvalue = C(P(1-space-endofattributes)^1) / attribute_value_error +local wrongvalue = Cs(P(entity + (1-space-endofattributes))^1) / attribute_value_error local attributevalue = value + wrongvalue @@ -5530,7 +5537,7 @@ local type, next, tonumber, tostring, setmetatable, loadstring = type, next, ton local format, gsub = string.format, string.gsub --[[ldx-- -<p>The following helper functions best belong to the <t>lmxl-ini</t> +<p>The following helper functions best belong to the <t>lxml-ini</t> module. Some are here because we need then in the <t>mk</t> document and other manuals, others came up when playing with this module. Since this module is also used in <l n='mtxrun'/> we've @@ -6982,12 +6989,12 @@ function logs.tex.stop_page_number() if real > 0 then if user > 0 then if sub > 0 then - logs.report("pages", "flushing page, realpage %s, userpage %s, subpage %s",real,user,sub) + logs.report("pages", "flushing realpage %s, userpage %s, subpage %s",real,user,sub) else - logs.report("pages", "flushing page, realpage %s, userpage %s",real,user) + logs.report("pages", "flushing realpage %s, userpage %s",real,user) end else - logs.report("pages", "flushing page, realpage %s",real) + logs.report("pages", "flushing realpage %s",real) end else logs.report("pages", "flushing page") @@ -7562,7 +7569,7 @@ end local function splitpathexpr(str, t, validate) -- no need for further optimization as it is only called a -- few times, we can use lpeg for the sub - if trace_expansion then + if trace_expansions then logs.report("fileio","expanding variable '%s'",str) end t = t or { } @@ -8049,10 +8056,13 @@ local function split_kpse_path(str) -- beware, this can be either a path or a {s local found = cache[str] if not found then str = gsub(str,"\\","/") - if find(str,";") then - found = checkedsplit(str,";") - else - found = checkedsplit(str,io.pathseparator) + local split = (find(str,";") and checkedsplit(str,";")) or checkedsplit(str,io.pathseparator) + found = { } + for i=1,#split do + local s = split[i] + if not find(s,"^{*unset}*") then + found[#found+1] = s + end end if trace_expansions then logs.report("fileio","splitting path specification '%s'",str) diff --git a/scripts/context/stubs/unix/luatools b/scripts/context/stubs/unix/luatools index 06e2a1bfc..ae5122509 100755 --- a/scripts/context/stubs/unix/luatools +++ b/scripts/context/stubs/unix/luatools @@ -322,6 +322,8 @@ if not modules then modules = { } end modules ['l-lpeg'] = { license = "see context related readme files" } +lpeg = require("lpeg") + local P, R, S, Ct, C, Cs, Cc = lpeg.P, lpeg.R, lpeg.S, lpeg.Ct, lpeg.C, lpeg.Cs, lpeg.Cc --~ l-lpeg.lua : @@ -1383,7 +1385,7 @@ function io.savedata(filename,data,joiner) elseif type(data) == "function" then data(f) else - f:write(data) + f:write(data or "") end f:close() return true @@ -1702,7 +1704,13 @@ local find, format = string.find, string.format local random, ceil = math.random, math.ceil function os.resultof(command) - return io.popen(command,"r"):read("*all") + local handle = io.popen(command,"r") + if not handle then + -- print("unknown command '".. command .. "' in os.resultof") + return "" + else + return handle:read("*all") or "" + end end if not os.exec then os.exec = os.execute end @@ -1762,14 +1770,6 @@ end --~ print(os.date("%H:%M:%S",os.gettimeofday())) --~ print(os.date("%H:%M:%S",os.time())) -os.arch = os.arch or function() - local a = os.resultof("uname -m") or "linux" - os.arch = function() - return a - end - return a -end - -- no need for function anymore as we have more clever code and helpers now os.platform = os.name @@ -1785,7 +1785,13 @@ if name == "windows" or name == "mswin" or name == "win32" or name == "msdos" th end os.libsuffix = 'dll' else - local architecture = os.arch() + local architecture = os.getenv("HOSTTYPE") or "" + if architecture == "" then + architecture = os.resultof("uname -m") or "" + end + if architecture == "" then + local architecture = os.resultof("echo $HOSTTYPE") + end if name == "linux" then if find(architecture,"x86_64") then os.platform = "linux-64" @@ -1795,7 +1801,6 @@ else os.platform = "linux" end elseif name == "macosx" then - local architecture = os.resultof("echo $HOSTTYPE") if find(architecture,"i386") then os.platform = "osx-intel" elseif find(architecture,"x86_64") then @@ -2720,13 +2725,34 @@ if not modules then modules = { } end modules ['l-unicode'] = { license = "see context related readme files" } +if not unicode then + + unicode = { utf8 = { } } + + local floor, char = math.floor, string.char + + function unicode.utf8.utfchar(n) + if n < 0x80 then + return char(n) + elseif n < 0x800 then + return char(0xC0 + floor(n/0x40)) .. char(0x80 + (n % 0x40)) + elseif n < 0x10000 then + return char(0xE0 + floor(n/0x1000)) .. char(0x80 + (floor(n/0x40) % 0x40)) .. char(0x80 + (n % 0x40)) + elseif n < 0x40000 then + return char(0xF0 + floor(n/0x40000)) .. char(0x80 + floor(n/0x1000)) .. char(0x80 + (floor(n/0x40) % 0x40)) .. char(0x80 + (n % 0x40)) + else -- wrong: + -- return char(0xF1 + floor(n/0x1000000)) .. char(0x80 + floor(n/0x40000)) .. char(0x80 + floor(n/0x1000)) .. char(0x80 + (floor(n/0x40) % 0x40)) .. char(0x80 + (n % 0x40)) + return "?" + end + end + +end + utf = utf or unicode.utf8 local concat, utfchar, utfgsub = table.concat, utf.char, utf.gsub local char, byte, find, bytepairs = string.char, string.byte, string.find, string.bytepairs -unicode = unicode or { } - -- 0 EF BB BF UTF-8 -- 1 FF FE UTF-16-little-endian -- 2 FE FF UTF-16-big-endian @@ -4238,12 +4264,12 @@ function logs.tex.stop_page_number() if real > 0 then if user > 0 then if sub > 0 then - logs.report("pages", "flushing page, realpage %s, userpage %s, subpage %s",real,user,sub) + logs.report("pages", "flushing realpage %s, userpage %s, subpage %s",real,user,sub) else - logs.report("pages", "flushing page, realpage %s, userpage %s",real,user) + logs.report("pages", "flushing realpage %s, userpage %s",real,user) end else - logs.report("pages", "flushing page, realpage %s",real) + logs.report("pages", "flushing realpage %s",real) end else logs.report("pages", "flushing page") @@ -4818,7 +4844,7 @@ end local function splitpathexpr(str, t, validate) -- no need for further optimization as it is only called a -- few times, we can use lpeg for the sub - if trace_expansion then + if trace_expansions then logs.report("fileio","expanding variable '%s'",str) end t = t or { } @@ -5305,10 +5331,13 @@ local function split_kpse_path(str) -- beware, this can be either a path or a {s local found = cache[str] if not found then str = gsub(str,"\\","/") - if find(str,";") then - found = checkedsplit(str,";") - else - found = checkedsplit(str,io.pathseparator) + local split = (find(str,";") and checkedsplit(str,";")) or checkedsplit(str,io.pathseparator) + found = { } + for i=1,#split do + local s = split[i] + if not find(s,"^{*unset}*") then + found[#found+1] = s + end end if trace_expansions then logs.report("fileio","splitting path specification '%s'",str) diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index c5b0acd04..03b454993 100755 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -331,6 +331,8 @@ if not modules then modules = { } end modules ['l-lpeg'] = { license = "see context related readme files" } +lpeg = require("lpeg") + local P, R, S, Ct, C, Cs, Cc = lpeg.P, lpeg.R, lpeg.S, lpeg.Ct, lpeg.C, lpeg.Cs, lpeg.Cc --~ l-lpeg.lua : @@ -1392,7 +1394,7 @@ function io.savedata(filename,data,joiner) elseif type(data) == "function" then data(f) else - f:write(data) + f:write(data or "") end f:close() return true @@ -1711,7 +1713,13 @@ local find, format = string.find, string.format local random, ceil = math.random, math.ceil function os.resultof(command) - return io.popen(command,"r"):read("*all") + local handle = io.popen(command,"r") + if not handle then + -- print("unknown command '".. command .. "' in os.resultof") + return "" + else + return handle:read("*all") or "" + end end if not os.exec then os.exec = os.execute end @@ -1771,14 +1779,6 @@ end --~ print(os.date("%H:%M:%S",os.gettimeofday())) --~ print(os.date("%H:%M:%S",os.time())) -os.arch = os.arch or function() - local a = os.resultof("uname -m") or "linux" - os.arch = function() - return a - end - return a -end - -- no need for function anymore as we have more clever code and helpers now os.platform = os.name @@ -1794,7 +1794,13 @@ if name == "windows" or name == "mswin" or name == "win32" or name == "msdos" th end os.libsuffix = 'dll' else - local architecture = os.arch() + local architecture = os.getenv("HOSTTYPE") or "" + if architecture == "" then + architecture = os.resultof("uname -m") or "" + end + if architecture == "" then + local architecture = os.resultof("echo $HOSTTYPE") + end if name == "linux" then if find(architecture,"x86_64") then os.platform = "linux-64" @@ -1804,7 +1810,6 @@ else os.platform = "linux" end elseif name == "macosx" then - local architecture = os.resultof("echo $HOSTTYPE") if find(architecture,"i386") then os.platform = "osx-intel" elseif find(architecture,"x86_64") then @@ -3811,13 +3816,15 @@ local text_parsed = Cs(((1-open-ampersand)^1 + entity)^1) local somespace = space^1 local optionalspace = space^0 -local value = (squote * C((1 - squote)^0) * squote) + (dquote * C((1 - dquote)^0) * dquote) -- ampersand and < also invalid in value +----- value = (squote * C((1 - squote)^0) * squote) + (dquote * C((1 - dquote)^0) * dquote) -- ampersand and < also invalid in value +local value = (squote * Cs((entity + (1 - squote))^0) * squote) + (dquote * Cs((entity + (1 - dquote))^0) * dquote) -- ampersand and < also invalid in value local endofattributes = slash * close + close -- recovery of flacky html local whatever = space * name * optionalspace * equal local wrongvalue = C(P(1-whatever-close)^1 + P(1-close)^1) / attribute_value_error ------ local wrongvalue = C(P(1-whatever-endofattributes)^1 + P(1-endofattributes)^1) / attribute_value_error -local wrongvalue = C(P(1-space-endofattributes)^1) / attribute_value_error +----- wrongvalue = C(P(1-whatever-endofattributes)^1 + P(1-endofattributes)^1) / attribute_value_error +----- wrongvalue = C(P(1-space-endofattributes)^1) / attribute_value_error +local wrongvalue = Cs(P(entity + (1-space-endofattributes))^1) / attribute_value_error local attributevalue = value + wrongvalue @@ -5530,7 +5537,7 @@ local type, next, tonumber, tostring, setmetatable, loadstring = type, next, ton local format, gsub = string.format, string.gsub --[[ldx-- -<p>The following helper functions best belong to the <t>lmxl-ini</t> +<p>The following helper functions best belong to the <t>lxml-ini</t> module. Some are here because we need then in the <t>mk</t> document and other manuals, others came up when playing with this module. Since this module is also used in <l n='mtxrun'/> we've @@ -6982,12 +6989,12 @@ function logs.tex.stop_page_number() if real > 0 then if user > 0 then if sub > 0 then - logs.report("pages", "flushing page, realpage %s, userpage %s, subpage %s",real,user,sub) + logs.report("pages", "flushing realpage %s, userpage %s, subpage %s",real,user,sub) else - logs.report("pages", "flushing page, realpage %s, userpage %s",real,user) + logs.report("pages", "flushing realpage %s, userpage %s",real,user) end else - logs.report("pages", "flushing page, realpage %s",real) + logs.report("pages", "flushing realpage %s",real) end else logs.report("pages", "flushing page") @@ -7562,7 +7569,7 @@ end local function splitpathexpr(str, t, validate) -- no need for further optimization as it is only called a -- few times, we can use lpeg for the sub - if trace_expansion then + if trace_expansions then logs.report("fileio","expanding variable '%s'",str) end t = t or { } @@ -8049,10 +8056,13 @@ local function split_kpse_path(str) -- beware, this can be either a path or a {s local found = cache[str] if not found then str = gsub(str,"\\","/") - if find(str,";") then - found = checkedsplit(str,";") - else - found = checkedsplit(str,io.pathseparator) + local split = (find(str,";") and checkedsplit(str,";")) or checkedsplit(str,io.pathseparator) + found = { } + for i=1,#split do + local s = split[i] + if not find(s,"^{*unset}*") then + found[#found+1] = s + end end if trace_expansions then logs.report("fileio","splitting path specification '%s'",str) diff --git a/tex/context/base/attr-ini.mkiv b/tex/context/base/attr-ini.mkiv index b04282fb8..3d10086f0 100644 --- a/tex/context/base/attr-ini.mkiv +++ b/tex/context/base/attr-ini.mkiv @@ -51,6 +51,7 @@ \definesystemattribute[destination] \chardef\destinationattribute \dogetattributeid{destination} \definesystemattribute[graphicvadjust] \chardef\graphicvadjustattribute \dogetattributeid{graphicvadjust} \definesystemattribute[ruled] \chardef\ruledattribute \dogetattributeid{ruled} +\definesystemattribute[shifted] \chardef\shiftedattribute \dogetattributeid{shifted} % \definesystemattribute[ignore] % diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex index 40ca60100..218980a51 100644 --- a/tex/context/base/cont-new.tex +++ b/tex/context/base/cont-new.tex @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2009.12.14 22:32} +\newcontextversion{2009.12.18 11:12} %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/context.mkiv b/tex/context/base/context.mkiv index 173e6a3d9..51f5d92d4 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -20,8 +20,7 @@ \loadcorefile{syst-ini} -% \ifnum\luatexversion<47 % also change message -\ifnum\luatexversion<46 % also change message +\ifnum\luatexversion<47 % also change message \writestatus{!!!!}{Your luatex binary is too old, you need at least version 0.47!} \expandafter\end \fi diff --git a/tex/context/base/context.tex b/tex/context/base/context.tex index 55c87b5bb..4290fe723 100644 --- a/tex/context/base/context.tex +++ b/tex/context/base/context.tex @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2009.12.14 22:32} +\edef\contextversion{2009.12.18 11:12} %D For those who want to use this: diff --git a/tex/context/base/data-res.lua b/tex/context/base/data-res.lua index d15046e80..c7f360141 100644 --- a/tex/context/base/data-res.lua +++ b/tex/context/base/data-res.lua @@ -384,7 +384,7 @@ end local function splitpathexpr(str, t, validate) -- no need for further optimization as it is only called a -- few times, we can use lpeg for the sub - if trace_expansion then + if trace_expansions then logs.report("fileio","expanding variable '%s'",str) end t = t or { } @@ -871,10 +871,13 @@ local function split_kpse_path(str) -- beware, this can be either a path or a {s local found = cache[str] if not found then str = gsub(str,"\\","/") - if find(str,";") then - found = checkedsplit(str,";") - else - found = checkedsplit(str,io.pathseparator) + local split = (find(str,";") and checkedsplit(str,";")) or checkedsplit(str,io.pathseparator) + found = { } + for i=1,#split do + local s = split[i] + if not find(s,"^{*unset}*") then + found[#found+1] = s + end end if trace_expansions then logs.report("fileio","splitting path specification '%s'",str) diff --git a/tex/context/base/font-mis.lua b/tex/context/base/font-mis.lua index 37a731735..5faeed2b7 100644 --- a/tex/context/base/font-mis.lua +++ b/tex/context/base/font-mis.lua @@ -11,7 +11,7 @@ local lower, strip = string.lower, string.strip fonts.otf = fonts.otf or { } -fonts.otf.version = fonts.otf.version or 2.636 +fonts.otf.version = fonts.otf.version or 2.640 fonts.otf.pack = true fonts.otf.cache = containers.define("fonts", "otf", fonts.otf.version, true) diff --git a/tex/context/base/font-otf.lua b/tex/context/base/font-otf.lua index 6900b8445..2e9562190 100644 --- a/tex/context/base/font-otf.lua +++ b/tex/context/base/font-otf.lua @@ -83,7 +83,7 @@ otf.features.default = otf.features.default or { } otf.enhancers = otf.enhancers or { } otf.glists = { "gsub", "gpos" } -otf.version = 2.636 -- beware: also sync font-mis.lua +otf.version = 2.640 -- beware: also sync font-mis.lua otf.pack = true -- beware: also sync font-mis.lua otf.syncspace = true otf.notdef = false @@ -214,6 +214,7 @@ local enhancers = { "share widths", "strip not needed data", "migrate metadata", + "check math parameters", } function otf.load(filename,format,sub,featurefile) @@ -238,8 +239,12 @@ function otf.load(filename,format,sub,featurefile) ff, messages = fontloader.open(filename) end if trace_loading and messages and #messages > 0 then - for m=1,#messages do - logs.report("load otf","warning: %s",messages[m]) + if type(messages) == "string" then + logs.report("load otf","warning: %s",messages) + else + for m=1,#messages do + logs.report("load otf","warning: %s",tostring(messages[m])) + end end end if ff then @@ -1166,6 +1171,26 @@ otf.enhancers["migrate metadata"] = function(data,filename) metadata.charwidth = pfminfo and pfminfo.avgwidth end +local private_math_parameters = { + "FractionDelimiterSize", + "FractionDelimiterDisplayStyleSize", +} + +otf.enhancers["check math parameters"] = function(data,filename) + local mathdata = data.metadata.math + if mathdata then + for m=1,#private_math_parameters do + local pmp = private_math_parameters[m] + if not mathdata[pmp] then + if trace_loading then + logs.report("load otf", "setting math parameter '%s' to 0", pmp) + end + mathdata[pmp] = 0 + end + end + end +end + otf.enhancers["flatten glyph lookups"] = function(data,filename) for k, v in next, data.glyphs do if v.lookups then diff --git a/tex/context/base/lxml-tex.lua b/tex/context/base/lxml-tex.lua index f5ff3b9c8..1f0a5d3d2 100644 --- a/tex/context/base/lxml-tex.lua +++ b/tex/context/base/lxml-tex.lua @@ -26,7 +26,7 @@ if not tex and not tex.sprint then end local texsprint, texprint, texwrite = tex.sprint, tex.print, tex.write -local texcatcodes, ctxcatcodes, vrbcatcodes = tex.texcatcodes, tex.ctxcatcodes, tex.vrbcatcodes +local texcatcodes, ctxcatcodes, vrbcatcodes, notcatcodes = tex.texcatcodes, tex.ctxcatcodes, tex.vrbcatcodes, tex.notcatcodes local xmlelements, xmlcollected, xmlsetproperty = xml.elements, xml.collected, xml.setproperty local xmlparseapply, xmlwithelements = xml.parse_apply, xml.withelements @@ -75,7 +75,7 @@ local entity = ampersand * lpeg.C((1-semicolon)^1) * semicolon local xmltextcapture = ( space^0 * newline^2 * lpeg.Cc("") / texprint + -- better ^-2 ? space^0 * newline * space^0 * lpeg.Cc(" ") / texsprint + - content / texsprint + -- current catcodes regime is notcatcodes + content / function(str) return texsprint(notcatcodes,str) end + -- was just texsprint, current catcodes regime is notcatcodes entity / xml.resolved_entity )^0 @@ -937,10 +937,10 @@ local function attribute(collected,a,default) local at = collected[1].at local str = (at and at[a]) or default if str and str ~= "" then - texsprint(ctxcatcodes,str) + texsprint(notcatcodes,str) end elseif default then - texsprint(ctxcatcodes,default) + texsprint(notcatcodes,default) end end @@ -952,7 +952,7 @@ local function chainattribute(collected,arguments) -- todo: optional levels if at then local a = at[arguments] if a then - texsprint(ctxcatcodes,a) + texsprint(notcatcodes,a) end else break -- error @@ -1188,10 +1188,10 @@ function lxml.att(id,a,default) local at = root.at local str = (at and at[a]) or default if str and str ~= "" then - texsprint(ctxcatcodes,str) + texsprint(notcatcodes,str) end elseif default then - texsprint(ctxcatcodes,default) + texsprint(notcatcodes,default) end end diff --git a/tex/context/base/math-dim.lua b/tex/context/base/math-dim.lua index 76d7a33dc..fda1e8551 100644 --- a/tex/context/base/math-dim.lua +++ b/tex/context/base/math-dim.lua @@ -248,7 +248,7 @@ function mathematics.dimensions(dimens) end t[variable] = tt end -logs.report("warning", "version 0.47 is needed for proper delimited math") +--~ logs.report("warning", "version 0.47 is needed for proper delimited math") local d = { AxisHeight = t . axis . text_style, AccentBaseHeight = t . accent_base_height . text_style, @@ -261,8 +261,8 @@ logs.report("warning", "version 0.47 is needed for proper delimited math") FractionNumeratorGapMin = t . fraction_num_vgap . text_style, FractionNumeratorShiftUp = t . fraction_num_up . text_style, FractionRuleThickness = t . fraction_rule . text_style, --- FractionDelimiterSize = t . fraction_del_size . text_style, --- FractionDelimiterDisplayStyleSize = t . fraction_del_size . display_style, + FractionDelimiterSize = t . fraction_del_size . text_style, + FractionDelimiterDisplayStyleSize = t . fraction_del_size . display_style, LowerLimitBaselineDropMin = t . limit_below_bgap . text_style, LowerLimitGapMin = t . limit_below_vgap . text_style, OverbarExtraAscender = t . overbar_kern . text_style, diff --git a/tex/context/base/s-fnt-25.tex b/tex/context/base/s-fnt-25.tex index 7142ee876..abaaaa06e 100644 --- a/tex/context/base/s-fnt-25.tex +++ b/tex/context/base/s-fnt-25.tex @@ -147,7 +147,7 @@ end \endinput -\startbuffer mathtest +\startbuffer[mathtest] \begingroup\mm\mr\showmathfontcharacters\endgroup \stopbuffer diff --git a/tex/context/base/syst-ini.tex b/tex/context/base/syst-ini.tex index 51e78e67b..aea29df5d 100644 --- a/tex/context/base/syst-ini.tex +++ b/tex/context/base/syst-ini.tex @@ -800,9 +800,10 @@ \pdfminorversion \plusfive - \ifdefined\pdfcompresslevel \else \newcount\pdfcompresslevel \fi - \ifdefined\pdfobjcompresslevel \else \newcount\pdfobjcompresslevel \fi - \ifdefined\pdfgentounicode \else \newcount\pdfgentounicode \fi \pdfgentounicode\plusone + \ifdefined\pdfcompresslevel \else \newcount\pdfcompresslevel \fi + \ifdefined\pdfobjcompresslevel \else \newcount\pdfobjcompresslevel \fi + \ifdefined\pdfgentounicode \else \newcount\pdfgentounicode \fi \pdfgentounicode \plusone + \ifdefined\pdfinclusioncopyfonts\else \newcount\pdfinclusioncopyfonts \fi \pdfinclusioncopyfonts\plusone \def\nopdfcompression {\pdfobjcompresslevel\zerocount \pdfcompresslevel\zerocount} \def\maximumpdfcompression{\pdfobjcompresslevel\plusnine \pdfcompresslevel\plusnine } diff --git a/tex/generic/context/luatex-fonts-merged.lua b/tex/generic/context/luatex-fonts-merged.lua index b21e5a2d9..959033e31 100644 --- a/tex/generic/context/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : c:/data/develop/context/texmf/tex/generic/context/luatex-fonts-merged.lua -- parent file : c:/data/develop/context/texmf/tex/generic/context/luatex-fonts.lua --- merge date : 12/14/09 22:36:17 +-- merge date : 12/18/09 11:16:33 do -- begin closure to overcome local limits and interference @@ -5349,7 +5349,7 @@ otf.features.default = otf.features.default or { } otf.enhancers = otf.enhancers or { } otf.glists = { "gsub", "gpos" } -otf.version = 2.636 -- beware: also sync font-mis.lua +otf.version = 2.640 -- beware: also sync font-mis.lua otf.pack = true -- beware: also sync font-mis.lua otf.syncspace = true otf.notdef = false @@ -5480,6 +5480,7 @@ local enhancers = { "share widths", "strip not needed data", "migrate metadata", + "check math parameters", } function otf.load(filename,format,sub,featurefile) @@ -5504,8 +5505,12 @@ function otf.load(filename,format,sub,featurefile) ff, messages = fontloader.open(filename) end if trace_loading and messages and #messages > 0 then - for m=1,#messages do - logs.report("load otf","warning: %s",messages[m]) + if type(messages) == "string" then + logs.report("load otf","warning: %s",messages) + else + for m=1,#messages do + logs.report("load otf","warning: %s",tostring(messages[m])) + end end end if ff then @@ -6432,6 +6437,26 @@ otf.enhancers["migrate metadata"] = function(data,filename) metadata.charwidth = pfminfo and pfminfo.avgwidth end +local private_math_parameters = { + "FractionDelimiterSize", + "FractionDelimiterDisplayStyleSize", +} + +otf.enhancers["check math parameters"] = function(data,filename) + local mathdata = data.metadata.math + if mathdata then + for m=1,#private_math_parameters do + local pmp = private_math_parameters[m] + if not mathdata[pmp] then + if trace_loading then + logs.report("load otf", "setting math parameter '%s' to 0", pmp) + end + mathdata[pmp] = 0 + end + end + end +end + otf.enhancers["flatten glyph lookups"] = function(data,filename) for k, v in next, data.glyphs do if v.lookups then diff --git a/web2c/context.cnf b/web2c/context.cnf index e034ebe67..d3c8d123b 100644 --- a/web2c/context.cnf +++ b/web2c/context.cnf @@ -99,7 +99,8 @@ CTXDEVMPPATH=unset CTXDEVMFPATH=unset #~ TEXINPUTS = .;{$TXRESOURCES}//;{$CTXDEVTXPATH};$TEXMF/{pdftex,pdfetex,etex,xetex,omega,tex}/{context,plain,generic,}// -TEXINPUTS = .;{$TXRESOURCES}//;{$CTXDEVTXPATH};$TEXMF/{pdftex,pdfetex,etex,xetex,omega,tex}/{$progname,plain,generic,}// +#~ TEXINPUTS = .;{$TXRESOURCES}//;{$CTXDEVTXPATH};$TEXMF/{pdftex,pdfetex,etex,xetex,omega,tex}/{$progname,plain,generic,}// +TEXINPUTS = .;{$TXRESOURCES}//;{$CTXDEVTXPATH};$TEXMF/tex/{$progname,plain,generic,}// % TEXINPUTS.context = .;{$TXRESOURCES}//;{$CTXDEVTXPATH};$TEXMF/{pdftex,pdfetex,etex,xetex,omega,tex}/{context,plain,generic,}// % TEXINPUTS.context = .;{$TXRESOURCES}//;{$CTXDEVTXPATH};$TEXMF/{tex,omega}/{context,plain,generic}// @@ -131,7 +132,7 @@ JAVAINPUTS = .;$CTXDEVJVPATH;$TEXMF/scripts/context/java % LUAINPUTS = .;$TEXINPUTS;$TEXMFSCRIPTS LUAINPUTS = .;$CTXDEVLUPATH;$TEXINPUTS;$TEXMF/scripts/context/lua -TEXMFSCRIPTS = .;$CTXDEVLUPATH;$TEXINPUTS;$CTXDEVRBPATH;$CTXDEVPLPATH;$TEXMF/scripts/context// +TEXMFSCRIPTS = .;$CTXDEVLUPATH;$TEXINPUTS;$CTXDEVRBPATH;$CTXDEVPLPATH;$TEXMF/scripts/context/{lua,ruby,perl}// % RUBYINPUTS = .;$CTXDEVPLPATH;$TEXMF/scripts/{$progname,$engine,}/ruby % LUAINPUTS = .;$CTXDEVPYPATH;$TEXMF/scripts/{$progname,$engine,}/lua |