From 386844fcee1ab9452cea887e4b5fba9001368026 Mon Sep 17 00:00:00 2001 From: Marius Date: Tue, 31 Dec 2013 00:00:25 +0200 Subject: beta 2013.12.30 22:40 --- scripts/context/lua/mtxrun.lua | 8 +-- scripts/context/stubs/mswin/mtxrun.lua | 8 +-- scripts/context/stubs/unix/mtxrun | 8 +-- tex/context/base/cont-new.mkiv | 2 +- tex/context/base/context-version.pdf | Bin 4126 -> 4128 bytes tex/context/base/context.mkiv | 2 +- tex/context/base/l-package.lua | 2 +- tex/context/base/pack-rul.lua | 73 ++++++++++++--------- tex/context/base/status-files.pdf | Bin 24634 -> 24540 bytes tex/context/base/status-lua.pdf | Bin 228351 -> 228351 bytes tex/generic/context/luatex/luatex-fonts-merged.lua | 2 +- 11 files changed, 59 insertions(+), 46 deletions(-) diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index 9b064adbc..0ff2d2897 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -144,7 +144,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-package"] = package.loaded["l-package"] or true --- original size: 10594, stripped down to: 7819 +-- original size: 10587, stripped down to: 7815 if not modules then modules={} end modules ['l-package']={ version=1.001, @@ -355,7 +355,7 @@ methods["qualified path"]=function(name) return loadedbyname(addsuffix(lualibfile(name),"lua"),name) end methods["lua extra list"]=function(name) - return loadedbypath(addsuffix(lualibfile(name),"lua" ),name,getextraluapaths(),false,"lua") + return loadedbypath(addsuffix(lualibfile(name),"lua"),name,getextraluapaths(),false,"lua") end methods["lib extra list"]=function(name) return loadedbypath(addsuffix(lualibfile(name),os.libsuffix),name,getextralibpaths(),true,"lib") @@ -16681,8 +16681,8 @@ end -- of closure -- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 685071 --- stripped bytes : 242356 +-- original bytes : 685064 +-- stripped bytes : 242353 -- end library merge diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index 9b064adbc..0ff2d2897 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -144,7 +144,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-package"] = package.loaded["l-package"] or true --- original size: 10594, stripped down to: 7819 +-- original size: 10587, stripped down to: 7815 if not modules then modules={} end modules ['l-package']={ version=1.001, @@ -355,7 +355,7 @@ methods["qualified path"]=function(name) return loadedbyname(addsuffix(lualibfile(name),"lua"),name) end methods["lua extra list"]=function(name) - return loadedbypath(addsuffix(lualibfile(name),"lua" ),name,getextraluapaths(),false,"lua") + return loadedbypath(addsuffix(lualibfile(name),"lua"),name,getextraluapaths(),false,"lua") end methods["lib extra list"]=function(name) return loadedbypath(addsuffix(lualibfile(name),os.libsuffix),name,getextralibpaths(),true,"lib") @@ -16681,8 +16681,8 @@ end -- of closure -- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 685071 --- stripped bytes : 242356 +-- original bytes : 685064 +-- stripped bytes : 242353 -- end library merge diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index 9b064adbc..0ff2d2897 100644 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -144,7 +144,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-package"] = package.loaded["l-package"] or true --- original size: 10594, stripped down to: 7819 +-- original size: 10587, stripped down to: 7815 if not modules then modules={} end modules ['l-package']={ version=1.001, @@ -355,7 +355,7 @@ methods["qualified path"]=function(name) return loadedbyname(addsuffix(lualibfile(name),"lua"),name) end methods["lua extra list"]=function(name) - return loadedbypath(addsuffix(lualibfile(name),"lua" ),name,getextraluapaths(),false,"lua") + return loadedbypath(addsuffix(lualibfile(name),"lua"),name,getextraluapaths(),false,"lua") end methods["lib extra list"]=function(name) return loadedbypath(addsuffix(lualibfile(name),os.libsuffix),name,getextralibpaths(),true,"lib") @@ -16681,8 +16681,8 @@ end -- of closure -- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 685071 --- stripped bytes : 242356 +-- original bytes : 685064 +-- stripped bytes : 242353 -- end library merge diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 7049cf8d1..60cb19079 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2013.12.29 19:28} +\newcontextversion{2013.12.30 22:40} %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/context-version.pdf b/tex/context/base/context-version.pdf index ad5b023ef..95266774e 100644 Binary files a/tex/context/base/context-version.pdf and b/tex/context/base/context-version.pdf differ diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index 95123348d..be68a3eb1 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -28,7 +28,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2013.12.29 19:28} +\edef\contextversion{2013.12.30 22:40} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/l-package.lua b/tex/context/base/l-package.lua index 0dbff7c57..075fcde25 100644 --- a/tex/context/base/l-package.lua +++ b/tex/context/base/l-package.lua @@ -274,7 +274,7 @@ methods["qualified path"]=function(name) end methods["lua extra list"] = function(name) - return loadedbypath(addsuffix(lualibfile(name),"lua" ),name,getextraluapaths(),false,"lua") + return loadedbypath(addsuffix(lualibfile(name),"lua"),name,getextraluapaths(),false,"lua") end methods["lib extra list"] = function(name) diff --git a/tex/context/base/pack-rul.lua b/tex/context/base/pack-rul.lua index fc6295018..1f41b505a 100644 --- a/tex/context/base/pack-rul.lua +++ b/tex/context/base/pack-rul.lua @@ -10,19 +10,23 @@ if not modules then modules = { } end modules ['pack-rul'] = {

An explanation is given in the history document mk.

--ldx]]-- -local hpack = node.hpack -local free = node.free -local copy = node.copy_list -local traverse_id = node.traverse_id -local node_dimensions = node.dimensions +-- we need to be careful with display math as it uses shifts +-- challenge: adapt glue_set +-- setfield(h,"glue_set", getfield(h,"glue_set") * getfield(h,"width")/maxwidth -- interesting ... doesn't matter much local hlist_code = nodes.nodecodes.hlist local vlist_code = nodes.nodecodes.vlist local box_code = nodes.listcodes.box +local line_code = nodes.listcodes.line local texsetdimen = tex.setdimen local texsetcount = tex.setcount local texgetbox = tex.getbox +local hpack = nodes.hpack +local free = nodes.free +local copy = nodes.copy_list +local traverse_id = nodes.traverse_id +local node_dimensions = nodes.dimensions function commands.doreshapeframedbox(n) local box = texgetbox(n) @@ -38,7 +42,7 @@ function commands.doreshapeframedbox(n) if boxwidth ~= 0 then -- and h.subtype == vlist_code local list = box.list if list then - local function check(n,usewidth) + local function check(n,repack) if not firstheight then firstheight = n.height end @@ -46,10 +50,15 @@ function commands.doreshapeframedbox(n) noflines = noflines + 1 local l = n.list if l then - if usewidth or n.subtype == box_code then -- maybe more - lastlinelength = n.width + if repack then + local subtype = n.subtype + if subtype == box_code or subtype == line_code then + lastlinelength = node_dimensions(l,l.dir) -- used to be: hpack(copy(l)).width + else + lastlinelength = n.width + end else - lastlinelength = node_dimensions(l) -- used to be: hpack(copy(l)).width + lastlinelength = n.width end if lastlinelength > maxwidth then maxwidth = lastlinelength @@ -61,39 +70,43 @@ function commands.doreshapeframedbox(n) end end local hdone = false - -- local vdone = false for h in traverse_id(hlist_code,list) do -- no dir etc needed - check(h) + check(h,true) hdone = true end + -- local vdone = false for v in traverse_id(vlist_code,list) do -- no dir etc needed - check(v) + check(v,false) -- vdone = true end - if firstheight then - if maxwidth ~= 0 then - if hdone then - for h in traverse_id(hlist_code,list) do - local l = h.list - if l then - if h.subtype == box_code then - -- explicit box, no 'line' - else - -- if h.width ~= maxwidth then -- else no display math handling (uses shift) - -- challenge: adapt glue_set - -- h.glue_set = h.glue_set * h.width/maxwidth -- interesting ... doesn't matter much - -- h.width = maxwidth - h.list = hpack(l,maxwidth,'exactly',h.dir) - h.shift = 0 -- needed for display math - h.width = maxwidth - -- end - end + if not firstheight then + -- done + elseif maxwidth ~= 0 then + if hdone then + for h in traverse_id(hlist_code,list) do + local l = h.list + if l then + local subtype = h.subtype + if subtype == box_code or subtype == line_code then + h.list = hpack(l,maxwidth,'exactly',h.dir) + h.shift = 0 -- needed for display math end + h.width = maxwidth end end box.width = maxwidth -- moved averagewidth = noflines > 0 and totalwidth/noflines or 0 end + -- if vdone then + -- for v in traverse_id(vlist_code,list) do + -- local width = n.width + -- if width > maxwidth then + -- v.width = maxwidth + -- end + -- end + -- end + box.width = maxwidth + averagewidth = noflines > 0 and totalwidth/noflines or 0 end end end diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf index 74315adf7..c0b423c4e 100644 Binary files a/tex/context/base/status-files.pdf and b/tex/context/base/status-files.pdf differ diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf index 04c498a7d..f836ffa32 100644 Binary files a/tex/context/base/status-lua.pdf and b/tex/context/base/status-lua.pdf differ diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index c0748c698..1e9c82e04 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 : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 12/29/13 19:28:51 +-- merge date : 12/30/13 22:40:58 do -- begin closure to overcome local limits and interference -- cgit v1.2.3