diff options
author | Hans Hagen <pragma@wxs.nl> | 2017-02-19 17:46:26 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2017-02-19 17:46:26 +0100 |
commit | b5ef32a9a6a99e134e669b702e89a55fbabf5306 (patch) | |
tree | e0b152cee73c98ea43d93e707dad31bfdebc1ef0 /tex | |
parent | 601e63e757d4cf40d5923cee4b6b3debff57364c (diff) | |
download | context-b5ef32a9a6a99e134e669b702e89a55fbabf5306.tar.gz |
2017-02-19 17:20:00
Diffstat (limited to 'tex')
22 files changed, 242 insertions, 53 deletions
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii index e3b49959a..9a3e4701c 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{2017.02.18 11:47} +\newcontextversion{2017.02.19 17:14} %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 c505ce092..0da99796f 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{2017.02.18 11:47} +\edef\contextversion{2017.02.19 17:14} %D For those who want to use this: diff --git a/tex/context/base/mkiv/anch-pgr.mkiv b/tex/context/base/mkiv/anch-pgr.mkiv index 1a583142e..4a86671a4 100644 --- a/tex/context/base/mkiv/anch-pgr.mkiv +++ b/tex/context/base/mkiv/anch-pgr.mkiv @@ -16,7 +16,11 @@ %D Before we come to graphics support, we have to make sure of the reference point %D on the page. The next macros do so and are hooked into the page building routine. -\registerctxluafile{anch-pgr}{1.001} +\doifelsefile {anch-pgr-new.lua} { + \registerctxluafile{anch-pgr-new}{1.001} +} { + \registerctxluafile{anch-pgr}{1.001} +} \unprotect diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index 5f849dd69..8b77ca89c 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{2017.02.18 11:47} +\newcontextversion{2017.02.19 17:14} %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 5bda44eea..33b264f8e 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -39,7 +39,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2017.02.18 11:47} +\edef\contextversion{2017.02.19 17:14} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/mkiv/data-res.lua b/tex/context/base/mkiv/data-res.lua index 24d53c343..4f171c445 100644 --- a/tex/context/base/mkiv/data-res.lua +++ b/tex/context/base/mkiv/data-res.lua @@ -69,12 +69,13 @@ local initializesetter = utilities.setters.initialize local ostype, osname, osenv, ossetenv, osgetenv = os.type, os.name, os.env, os.setenv, os.getenv -resolvers.cacheversion = "1.100" -resolvers.configbanner = "" -resolvers.homedir = environment.homedir -resolvers.criticalvars = allocate { "SELFAUTOLOC", "SELFAUTODIR", "SELFAUTOPARENT", "TEXMFCNF", "TEXMF", "TEXOS" } -resolvers.luacnfname = "texmfcnf.lua" -resolvers.luacnfstate = "unknown" +resolvers.cacheversion = "1.100" +resolvers.configbanner = "" +resolvers.homedir = environment.homedir +resolvers.criticalvars = allocate { "SELFAUTOLOC", "SELFAUTODIR", "SELFAUTOPARENT", "TEXMFCNF", "TEXMF", "TEXOS" } +resolvers.luacnfname = "texmfcnf.lua" +resolvers.luacnffallback = "contextcnf.lua" +resolvers.luacnfstate = "unknown" -- The web2c tex binaries as well as kpse have built in paths for the configuration -- files and there can be a depressing truckload of them. This is actually the weak @@ -376,24 +377,32 @@ local function identify_configuration_files() end reportcriticalvariables(cnfspec) local cnfpaths = expandedpathfromlist(resolvers.splitpath(cnfspec)) - local luacnfname = resolvers.luacnfname - for i=1,#cnfpaths do - local filepath = cnfpaths[i] - local filename = collapsepath(filejoin(filepath,luacnfname)) - local realname = resolveprefix(filename) -- can still have "//" ... needs checking - -- todo: environment.skipweirdcnfpaths directive - if trace_locating then - local fullpath = gsub(resolveprefix(collapsepath(filepath)),"//","/") - local weirdpath = find(fullpath,"/texmf.+/texmf") or not find(fullpath,"/web2c",1,true) - report_resolving("looking for %a on %s path %a from specification %a",luacnfname,weirdpath and "weird" or "given",fullpath,filepath) - end - if isfile(realname) then - specification[#specification+1] = filename -- unresolved as we use it in matching, relocatable + + local function locatecnf(luacnfname,kind) + for i=1,#cnfpaths do + local filepath = cnfpaths[i] + local filename = collapsepath(filejoin(filepath,luacnfname)) + local realname = resolveprefix(filename) -- can still have "//" ... needs checking + -- todo: environment.skipweirdcnfpaths directive if trace_locating then - report_resolving("found configuration file %a",realname) + local fullpath = gsub(resolveprefix(collapsepath(filepath)),"//","/") + local weirdpath = find(fullpath,"/texmf.+/texmf") or not find(fullpath,"/web2c",1,true) + report_resolving("looking for %s %a on %s path %a from specification %a", + kind,luacnfname,weirdpath and "weird" or "given",fullpath,filepath) + end + if isfile(realname) then + specification[#specification+1] = filename -- unresolved as we use it in matching, relocatable + if trace_locating then + report_resolving("found %s configuration file %a",kind,realname) + end end end end + + locatecnf(resolvers.luacnfname,"regular") + if #specification == 0 then + locatecnf(resolvers.luacnffallback,"fallback") + end if trace_locating then report_resolving() end diff --git a/tex/context/base/mkiv/font-ext.lua b/tex/context/base/mkiv/font-ext.lua index eb263d316..0b2bfd44f 100644 --- a/tex/context/base/mkiv/font-ext.lua +++ b/tex/context/base/mkiv/font-ext.lua @@ -556,10 +556,10 @@ local textitalics_specification = { registerotffeature(textitalics_specification) registerafmfeature(textitalics_specification) -local function initializemathitalics(tfmdata,value) -- yes no delay - tfmdata.properties.mathitalics = toboolean(value) -end - +-- local function initializemathitalics(tfmdata,value) -- yes no delay +-- tfmdata.properties.mathitalics = toboolean(value) +-- end +-- -- local mathitalics_specification = { -- name = "mathitalics", -- description = "use alternative math italic correction", @@ -1242,3 +1242,47 @@ do } end + +do -- another hack for a crappy font + + local function additalictowidth(tfmdata,key,value) + local characters = tfmdata.characters + local resources = tfmdata.resources + local additions = { } + local private = resources.private + for unicode, old_c in next, characters do + -- maybe check for math + local oldwidth = old_c.width + local olditalic = old_c.italic + if olditalic and olditalic ~= 0 then + private = private + 1 + local new_c = { + width = oldwidth + olditalic, + height = old_c.height, + depth = old_c.depth, + commands = { + { "slot", 1, private }, + { "right", olditalic }, + }, + } + setmetatableindex(new_c,old_c) + characters[unicode] = new_c + additions[private] = old_c + end + end + for k, v in next, additions do + characters[k] = v + end + resources.private = private + end + + registerotffeature { + name = "italicwidths", + description = "add italic to width", + manipulators = { + base = additalictowidth, + -- node = additalictowidth, -- only makes sense for math + } + } + +end diff --git a/tex/context/base/mkiv/font-pre.mkiv b/tex/context/base/mkiv/font-pre.mkiv index 24bb8de54..0994221eb 100644 --- a/tex/context/base/mkiv/font-pre.mkiv +++ b/tex/context/base/mkiv/font-pre.mkiv @@ -265,6 +265,10 @@ \mathnolimitsmode\plusone % font driven (only opentype) \fi +\ifdefined\mathitalicsmode + \mathitalicsmode\plusone % experiment +\fi + % \adaptfontfeature[*math*][mathnolimitsmode=1000] % only subscript \definefontfeature diff --git a/tex/context/base/mkiv/luat-exe.lua b/tex/context/base/mkiv/luat-exe.lua index 1e9811218..db06c63cb 100644 --- a/tex/context/base/mkiv/luat-exe.lua +++ b/tex/context/base/mkiv/luat-exe.lua @@ -103,10 +103,7 @@ sandbox.initializer{ end if type(root_list) == "table" then for i=1,#root_list do - local entry = root_list[i] - if entry ~= "" then - registerroot(entry) - end + registerroot(root_list[i]) end end end diff --git a/tex/context/base/mkiv/math-noa.lua b/tex/context/base/mkiv/math-noa.lua index fb08c4ef4..e8918a978 100644 --- a/tex/context/base/mkiv/math-noa.lua +++ b/tex/context/base/mkiv/math-noa.lua @@ -1235,9 +1235,9 @@ end -- and text. Also, for a while in context we had to deal with a mix of virtual math fonts and -- real ones. --- in opentype the italic correction of a limop is added to the width and luatex does some juggling --- that we want to avoid but we need to do something here (in fact, we could better fix the width of --- the character +-- in opentype the italic correction of a limop is added to the width and luatex does +-- some juggling that we want to avoid but we need to do something here (in fact, we could +-- better fix the width of the character local a_mathitalics = privateattribute("mathitalics") @@ -1332,7 +1332,8 @@ italics[math_char] = function(pointer,what,n,parent) if correction and correction ~= 0 then local next_noad = getnext(parent) if not next_noad then - if n == 1 then -- only at the outer level .. will become an option (always,endonly,none) + if n == 1 then + -- only at the outer level .. will become an option (always,endonly,none) if trace_italics then report_italics("method %a, flagging italic correction %p between %C and end math",method,correction,char) end diff --git a/tex/context/base/mkiv/mult-prm.lua b/tex/context/base/mkiv/mult-prm.lua index ef6a5a0ad..59c3b7f2e 100644 --- a/tex/context/base/mkiv/mult-prm.lua +++ b/tex/context/base/mkiv/mult-prm.lua @@ -285,6 +285,7 @@ return { "mathdir", "mathdisplayskipmode", "matheqnogapstep", + "mathitalicsmode", "mathnolimitsmode", "mathoption", "mathscriptsmode", @@ -932,6 +933,7 @@ return { "mathdisplayskipmode", "matheqnogapstep", "mathinner", + "mathitalicsmode", "mathnolimitsmode", "mathop", "mathopen", diff --git a/tex/context/base/mkiv/node-ini.mkiv b/tex/context/base/mkiv/node-ini.mkiv index 369b06ab2..d65813f5c 100644 --- a/tex/context/base/mkiv/node-ini.mkiv +++ b/tex/context/base/mkiv/node-ini.mkiv @@ -35,7 +35,12 @@ \registerctxluafile{node-acc}{1.001} % experimental %registerctxluafile{node-prp}{1.001} % makes no sense (yet) \registerctxluafile{node-ppt}{1.001} -\registerctxluafile{node-scn}{1.001} + +\doifelsefile {node-scn-new.lua} { + \registerctxluafile{node-scn-new}{1.001} +} { + \registerctxluafile{node-scn}{1.001} +} \newcount\c_node_tracers_show_box % box number diff --git a/tex/context/base/mkiv/node-nut.lua b/tex/context/base/mkiv/node-nut.lua index 0c6714667..ed3c06c28 100644 --- a/tex/context/base/mkiv/node-nut.lua +++ b/tex/context/base/mkiv/node-nut.lua @@ -203,6 +203,11 @@ if not direct.getcomponents then end +if LUATEXVERSION < 1.005 then + local getfield = direct.getfield + function direct.getsup(n) return getfield(n,"sup") end +end + -- if LUATEXVERSION < 1.004 then -- local gc = direct.getcomponents -- getcomponents = function(n) local c = gc(n) return c ~= 0 and c or nil end diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf Binary files differindex de32cee5f..24a936e81 100644 --- a/tex/context/base/mkiv/status-files.pdf +++ b/tex/context/base/mkiv/status-files.pdf diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf Binary files differindex 584d6e654..8813b05ad 100644 --- a/tex/context/base/mkiv/status-lua.pdf +++ b/tex/context/base/mkiv/status-lua.pdf diff --git a/tex/context/base/mkiv/syst-ini.mkiv b/tex/context/base/mkiv/syst-ini.mkiv index 1bdc9daae..d5e311448 100644 --- a/tex/context/base/mkiv/syst-ini.mkiv +++ b/tex/context/base/mkiv/syst-ini.mkiv @@ -1171,5 +1171,6 @@ \ifdefined\mathrulesfam \else \newcount\mathrulesfam \fi \ifdefined\mathrulesmode \else \newcount\mathrulesmode \fi \ifdefined\mathsurroundmode \else \newcount\mathsurroundmode \fi +\ifdefined\mathitalicsmode \else \newcount\mathitalicsmode \fi \protect \endinput diff --git a/tex/context/base/mkiv/util-env.lua b/tex/context/base/mkiv/util-env.lua index b72226900..fb3dda41f 100644 --- a/tex/context/base/mkiv/util-env.lua +++ b/tex/context/base/mkiv/util-env.lua @@ -15,14 +15,44 @@ local concat, insert, remove = table.concat, table.insert, table.remove environment = environment or { } local environment = environment --- precautions +-- locales are a useless feature in and even dangerous for luatex -os.setlocale(nil,nil) -- useless feature and even dangerous in luatex +os.setlocale(nil,nil) -- setlocale("all","C") function os.setlocale() -- no way you can mess with it end +-- do +-- +-- local setlocale = os.setlocale +-- +-- function os.resetlocale() +-- setlocale(nil,nil) +-- end +-- +-- function os.pushlocale(...) +-- insert(stack, { +-- collate = setlocale("collate"), +-- ctype = setlocale("ctype"), +-- monetary = setlocale("monetary"), +-- numeric = setlocale("numeric"), +-- time = setlocale("time"), +-- }) +-- setlocale(...) +-- end +-- +-- function os.poplocale(...) +-- local l = remove(stack) +-- if l then +-- setlocale(unpack(l)) +-- else +-- resetlocale() +-- end +-- end +-- +-- end + -- dirty tricks (we will replace the texlua call by luatex --luaonly) local validengines = allocate { diff --git a/tex/context/base/mkiv/util-sbx.lua b/tex/context/base/mkiv/util-sbx.lua index 48c424f00..0db2e0295 100644 --- a/tex/context/base/mkiv/util-sbx.lua +++ b/tex/context/base/mkiv/util-sbx.lua @@ -58,12 +58,22 @@ local function registerroot(root,what) -- what == read|write if finalized then report("roots are already finalized") else - root = collapsepath(expandname(root)) - if platform == "windows" then - root = lower(root) -- we assume ascii names + if type(root) == "table" then + root, what = root[1], root[2] + end + if type(root) == "string" and root ~= "" then + root = collapsepath(expandname(root)) + -- if platform == "windows" then + -- root = lower(root) -- we assume ascii names + -- end + if what == "r" or what == "ro" or what == "readable" then + what = "read" + elseif what == "w" or what == "wo" or what == "writable" then + what = "write" + end + -- true: read & write | false: read + validroots[root] = what == "write" or false end - -- true: read & write | false: read - validroots[root] = what == "write" or false end end @@ -146,9 +156,9 @@ end local function validfilename(name,what) if p_validroot and type(name) == "string" and lpegmatch(p_path,name) then local asked = collapsepath(expandname(name)) - if platform == "windows" then - asked = lower(asked) -- we assume ascii names - end + -- if platform == "windows" then + -- asked = lower(asked) -- we assume ascii names + -- end local okay = lpegmatch(p_validroot,asked) if okay == true then -- read and write access @@ -175,10 +185,8 @@ local function validfilename(name,what) end return name end - else - if filenamelogger then - filenamelogger(name,"*",name,false) - end + elseif filenamelogger then + filenamelogger(name,"*",name,false) end else return name diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf Binary files differindex 3a86b8090..152dd82cb 100644 --- a/tex/context/interface/mkiv/i-context.pdf +++ b/tex/context/interface/mkiv/i-context.pdf diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf Binary files differindex 374b0ec39..069ad08be 100644 --- a/tex/context/interface/mkiv/i-readme.pdf +++ b/tex/context/interface/mkiv/i-readme.pdf diff --git a/tex/generic/context/luatex/luatex-fonts-ext.lua b/tex/generic/context/luatex/luatex-fonts-ext.lua index 0b61e27fd..7d9c58ccb 100644 --- a/tex/generic/context/luatex/luatex-fonts-ext.lua +++ b/tex/generic/context/luatex/luatex-fonts-ext.lua @@ -285,3 +285,45 @@ otffeatures.register { node = ignore, } } + +local setmetatableindex = table.setmetatableindex + +local function additalictowidth(tfmdata,key,value) + local characters = tfmdata.characters + local resources = tfmdata.resources + local additions = { } + local private = resources.private + for unicode, old_c in next, characters do + -- maybe check for math + local oldwidth = old_c.width + local olditalic = old_c.italic + if olditalic and olditalic ~= 0 then + private = private + 1 + local new_c = { + width = oldwidth + olditalic, + height = old_c.height, + depth = old_c.depth, + commands = { + { "slot", 1, private }, + { "right", olditalic }, + }, + } + setmetatableindex(new_c,old_c) + characters[unicode] = new_c + additions[private] = old_c + end + end + for k, v in next, additions do + characters[k] = v + end + resources.private = private +end + +otffeatures.register { + name = "italicwidths", + description = "add italic to width", + manipulators = { + base = additalictowidth, + -- node = additalictowidth, -- only makes sense for math + } +} diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 8df4c966b..dc16e2426 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 : 02/18/17 11:47:12 +-- merge date : 02/19/17 17:14:56 do -- begin closure to overcome local limits and interference @@ -27187,6 +27187,43 @@ otffeatures.register { node=ignore, } } +local setmetatableindex=table.setmetatableindex +local function additalictowidth(tfmdata,key,value) + local characters=tfmdata.characters + local resources=tfmdata.resources + local additions={} + local private=resources.private + for unicode,old_c in next,characters do + local oldwidth=old_c.width + local olditalic=old_c.italic + if olditalic and olditalic~=0 then + private=private+1 + local new_c={ + width=oldwidth+olditalic, + height=old_c.height, + depth=old_c.depth, + commands={ + { "slot",1,private }, + { "right",olditalic }, + }, + } + setmetatableindex(new_c,old_c) + characters[unicode]=new_c + additions[private]=old_c + end + end + for k,v in next,additions do + characters[k]=v + end + resources.private=private +end +otffeatures.register { + name="italicwidths", + description="add italic to width", + manipulators={ + base=additalictowidth, + } +} end -- closure |