From bfc7bd2349855039534e8854a97c47864b1eba09 Mon Sep 17 00:00:00 2001 From: Context Git Mirror Bot Date: Tue, 9 Aug 2016 22:36:40 +0200 Subject: 2016-08-09 22:01:00 --- tex/context/base/context-version.pdf | Bin 4256 -> 4260 bytes tex/context/base/mkiv/anch-pos.lua | 71 ++++++++------------- tex/context/base/mkiv/anch-pos.mkiv | 1 + tex/context/base/mkiv/cont-new.mkiv | 2 +- tex/context/base/mkiv/context.mkiv | 2 +- tex/context/base/mkiv/core-uti.lua | 14 ++-- tex/context/base/mkiv/math-fen.mkiv | 12 ++-- tex/context/base/mkiv/pack-lyr.mkiv | 29 ++++----- tex/context/base/mkiv/status-files.pdf | Bin 9250 -> 9240 bytes tex/context/base/mkiv/status-lua.pdf | Bin 368539 -> 368590 bytes tex/context/interface/mkiv/i-context.pdf | Bin 774399 -> 774613 bytes tex/context/interface/mkiv/i-position.xml | 8 ++- tex/context/interface/mkiv/i-readme.pdf | Bin 60790 -> 60791 bytes tex/generic/context/luatex/luatex-fonts-merged.lua | 2 +- 14 files changed, 65 insertions(+), 76 deletions(-) (limited to 'tex') diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf index 6049bcc0e..434cf63e5 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/mkiv/anch-pos.lua b/tex/context/base/mkiv/anch-pos.lua index 1c5b12c13..d9ec1d501 100644 --- a/tex/context/base/mkiv/anch-pos.lua +++ b/tex/context/base/mkiv/anch-pos.lua @@ -113,14 +113,6 @@ local f_region = formatters["region:%s"] local f_tag_three = formatters["%s:%s:%s"] local f_tag_two = formatters["%s:%s"] ------ f_enhance = formatters["_plib_.enhance(%q)"] - ------ f_b_column = formatters["_plib_.b_column(%q)"] ------ f_e_column = formatters["_plib_.e_column()"] - ------ f_b_region = formatters["_plib_.b_region(%q)"] ------ f_e_region = formatters["_plib_.e_region(%s)"] - local function sorter(a,b) return a.y > b.y end @@ -138,7 +130,7 @@ local function initializer() collected = jobpositions.collected -- add sparse regions local pages = structures.pages.collected - if pages then + if pages then local last = nil for p=1,#pages do local region = "page:" .. p @@ -211,21 +203,6 @@ local getpos = function() getpos = backends.codeinjections.getpos return getp local gethpos = function() gethpos = backends.codeinjections.gethpos return gethpos() end local getvpos = function() getvpos = backends.codeinjections.getvpos return getvpos() end --- local function setdim(name,w,h,d,extra) -- not used --- local x, y = getpos() --- tobesaved[name] = { --- p = texgetcount("realpageno"), --- x = x ~= 0 and x or nil, --- y = y ~= 0 and y or nil, --- w = w ~= 0 and w or nil, --- h = h ~= 0 and h or nil, --- d = d ~= 0 and d or nil, --- e = extra ~= "" and extra or nil, --- r = region, --- c = column, --- } --- end - local function setall(name,p,x,y,w,h,d,extra) tobesaved[name] = { p = p, @@ -237,7 +214,7 @@ local function setall(name,p,x,y,w,h,d,extra) e = extra ~= "" and extra or nil, r = region, c = column, -r2l = texgetcount("inlinelefttoright") == 1 and true or nil, + r2l = texgetcount("inlinelefttoright") == 1 and true or nil, } end @@ -267,15 +244,12 @@ local function enhance(data) if data.c == true then data.c = column end - -- if rawget(data,"w") == 0 then if data.w == 0 then data.w = nil end - -- if rawget(data,"h") == 0 then if data.h == 0 then data.h = nil end - -- if rawget(data,"d") == 0 then if data.d == 0 then data.d = nil end @@ -381,7 +355,6 @@ scanners.bposcolumnregistered = function() -- tag local tag = scanstring() insert(columns,tag) column = tag - -- ctxnode(new_latelua_node(f_b_column(tag))) ctxnode(new_latelua_node(function() b_column(tag) end)) end @@ -391,7 +364,6 @@ scanners.eposcolumn = function() end scanners.eposcolumnregistered = function() - -- ctxnode(new_latelua_node(f_e_column())) ctxnode(new_latelua_node(e_column)) remove(columns) column = columns[#columns] @@ -433,10 +405,10 @@ local function setregionbox(n,tag) local w = getfield(box,"width") local h = getfield(box,"height") local d = getfield(box,"depth") - local y = getvpos() + local x, y = getpos() -- was only y tobesaved[tag] = { - p = true, -- not enhanced - x = true, -- not enhanced + -- p = texgetcount("realpageno"), -- we copy them + x = x ~= 0 and x or nil, -- was true y = y ~= 0 and y or nil, w = w ~= 0 and w or nil, h = h ~= 0 and h or nil, @@ -448,8 +420,6 @@ end local function markregionbox(n,tag,correct) -- correct needs checking local tag, box = setregionbox(n,tag) -- todo: check if tostring is needed with formatter - -- local push = new_latelua(f_b_region(tag)) - -- local pop = new_latelua(f_e_region(tostring(correct))) local push = new_latelua(function() b_region(tag) end) local pop = new_latelua(function() e_region(correct) end) -- maybe we should construct a hbox first (needs experimenting) so that we can avoid some at the tex end @@ -522,7 +492,6 @@ scanners.parpos = function() -- todo: relate to localpar (so this is an intermed end local tag = f_p_tag(nofparagraphs) tobesaved[tag] = t - -- ctxnode(new_latelua_node(f_enhance(tag))) ctxnode(new_latelua_node(function() enhance(tobesaved[tag]) end)) end @@ -535,9 +504,8 @@ scanners.dosetposition = function() -- name x = true, y = true, n = nofparagraphs > 0 and nofparagraphs or nil, -r2l = texgetcount("inlinelefttoright") == 1 or nil, + r2l = texgetcount("inlinelefttoright") == 1 or nil, } - -- ctxnode(new_latelua_node(f_enhance(name))) ctxnode(new_latelua_node(function() enhance(tobesaved[name]) end)) end @@ -556,9 +524,8 @@ scanners.dosetpositionwhd = function() -- name w h d extra h = h ~= 0 and h or nil, d = d ~= 0 and d or nil, n = nofparagraphs > 0 and nofparagraphs or nil, -r2l = texgetcount("inlinelefttoright") == 1 or nil, + r2l = texgetcount("inlinelefttoright") == 1 or nil, } - -- ctxnode(new_latelua_node(f_enhance(name))) ctxnode(new_latelua_node(function() enhance(tobesaved[name]) end)) end @@ -578,9 +545,8 @@ scanners.dosetpositionbox = function() -- name box h = h ~= 0 and h or nil, d = d ~= 0 and d or nil, n = nofparagraphs > 0 and nofparagraphs or nil, -r2l = texgetcount("inlinelefttoright") == 1 or nil, + r2l = texgetcount("inlinelefttoright") == 1 or nil, } - -- ctxnode(new_latelua_node(f_enhance(name))) ctxnode(new_latelua_node(function() enhance(tobesaved[name]) end)) end @@ -600,9 +566,8 @@ scanners.dosetpositionplus = function() -- name w h d extra d = d ~= 0 and d or nil, n = nofparagraphs > 0 and nofparagraphs or nil, e = scanstring(), -r2l = texgetcount("inlinelefttoright") == 1 or nil, + r2l = texgetcount("inlinelefttoright") == 1 or nil, } - -- ctxnode(new_latelua_node(f_enhance(name))) ctxnode(new_latelua_node(function() enhance(tobesaved[name]) end)) end @@ -620,9 +585,8 @@ scanners.dosetpositionstrut = function() -- name h = h ~= 0 and h or nil, d = d ~= 0 and d or nil, n = nofparagraphs > 0 and nofparagraphs or nil, -r2l = texgetcount("inlinelefttoright") == 1 or nil, + r2l = texgetcount("inlinelefttoright") == 1 or nil, } - -- ctxnode(new_latelua_node(f_enhance(name))) ctxnode(new_latelua_node(function() enhance(tobesaved[name]) end)) end @@ -972,6 +936,20 @@ scanners.MPxy = function() -- name end end +scanners.MPwhd = function() -- name + local jpi = collected[scanstring()] + if jpi then + local w = jpi.w or 0 + local h = jpi.h or 0 + local d = jpi.d or 0 + if w ~= 0 or h ~= 0 or d ~= 0 then + context("%.5Fpt,%.5Fpt,%.5Fpt",w*pt,h*pt,d*pt) + return + end + end + context('0pt,0pt,0pt') +end + scanners.MPll = function() -- name local jpi = collected[scanstring()] if jpi then @@ -1073,6 +1051,7 @@ scanners.MPr = function() -- name local r = jpi.r if r and r ~= true then context(r) + return end local p = jpi.p if p then diff --git a/tex/context/base/mkiv/anch-pos.mkiv b/tex/context/base/mkiv/anch-pos.mkiv index 5d9c2fd34..ecfbb9ce7 100644 --- a/tex/context/base/mkiv/anch-pos.mkiv +++ b/tex/context/base/mkiv/anch-pos.mkiv @@ -66,6 +66,7 @@ \def\MPh #1{\clf_MPh {#1}} \def\MPd #1{\clf_MPd {#1}} \def\MPxy #1{\clf_MPxy {#1}} +\def\MPwhd #1{\clf_MPwhd {#1}} \def\MPll #1{\clf_MPll {#1}} \def\MPlr #1{\clf_MPlr {#1}} \def\MPur #1{\clf_MPur {#1}} diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index cd21ef076..48df71ccb 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{2016.08.08 21:28} +\newcontextversion{2016.08.09 21:55} %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 099ad73d9..44cb967d1 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{2016.08.08 21:28} +\edef\contextversion{2016.08.09 21:55} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/mkiv/core-uti.lua b/tex/context/base/mkiv/core-uti.lua index 1ddfffaf2..54bcba08d 100644 --- a/tex/context/base/mkiv/core-uti.lua +++ b/tex/context/base/mkiv/core-uti.lua @@ -283,21 +283,27 @@ function job.load(filename) local utilitydata = load(filename) if utilitydata then local jobpacker = utilitydata.job.packed - for l=1,#savelist do - local list = savelist[l] + local handlers = { } + for i=1,#savelist do + local list = savelist[i] local target = list[1] local initializer = list[3] local result = accesstable(target,utilitydata) - local done = packers.unpack(result,jobpacker,true) + local done = packers.unpack(result,jobpacker,true) if done then migratetable(target,mark(result)) if type(initializer) == "function" then - initializer(result) + handlers[#handlers+1] = { initializer, result } end else report_passes("pack version mismatch") end end + -- so we have all tables available (unpacked) + for i=1,#handlers do + local handler = handlers[i] + handler[1](handler[2]) + end end statistics.stoptiming(_load_) end diff --git a/tex/context/base/mkiv/math-fen.mkiv b/tex/context/base/mkiv/math-fen.mkiv index 8d004636f..3dfaa7f33 100644 --- a/tex/context/base/mkiv/math-fen.mkiv +++ b/tex/context/base/mkiv/math-fen.mkiv @@ -58,10 +58,10 @@ \def\math_fenced_left {\edef\p_left {\ifconditional\c_math_fenced_mirror - \ifcase\c_math_bidi - \mathfenceparameter\c!left - \else + \ifconditional\c_math_right_to_left \mathfenceparameter\c!right + \else + \mathfenceparameter\c!left \fi \else \mathfenceparameter\c!left @@ -79,10 +79,10 @@ \def\math_fenced_right {\edef\p_right {\ifconditional\c_math_fenced_mirror - \ifcase\c_math_bidi - \mathfenceparameter\c!right - \else + \ifconditional\c_math_right_to_left \mathfenceparameter\c!left + \else + \mathfenceparameter\c!right \fi \else \mathfenceparameter\c!right diff --git a/tex/context/base/mkiv/pack-lyr.mkiv b/tex/context/base/mkiv/pack-lyr.mkiv index 61ed1e64b..1235c47ce 100644 --- a/tex/context/base/mkiv/pack-lyr.mkiv +++ b/tex/context/base/mkiv/pack-lyr.mkiv @@ -217,6 +217,7 @@ \def\pack_layers_set[#1][#2][#3]% #4 == box do \fi is ok {\bgroup + \checkpositionoverlays % otherwise funny regions \edef\currentlayer{#1}% \edef\p_pack_layers_state{\layerparameter\c!state}% \ifx\p_pack_layers_state\v!stop @@ -266,26 +267,22 @@ \fi \egroup} -% todo left/right - +% todo: left/right % todo: get position data in one go \def\pack_layers_set_last_position_yes % target: left|right {% this will become one call \edef\m_pack_layers_anchor{\??layerposition\the\c_pack_layers_current_data}% \edef\m_pack_layers_page {\MPp\m_pack_layers_anchor}% - \edef\m_pack_layers_region{\MPr\m_pack_layers_anchor}% + %edef\m_pack_layers_region{\MPr\m_pack_layers_anchor}% wrong one + \edef\m_pack_layers_region{\layerparameter\c!region}% \d_pack_layers_x_position \dimexpr-\MPx\m_pack_layers_region+\MPx\m_pack_layers_anchor\relax \d_pack_layers_y_position \dimexpr \MPy\m_pack_layers_region-\MPy\m_pack_layers_anchor+\MPh\m_pack_layers_region\relax \xdef\lastlayerxpos{\the\d_pack_layers_x_position}% \xdef\lastlayerypos{\the\d_pack_layers_y_position}% - % \writestatus{region}{\m_pack_layers_region -> (\MPx\m_pack_layers_region,\MPy\m_pack_layers_region)}% - % \writestatus{self} {\m_pack_layers_anchor -> (\MPx\m_pack_layers_anchor,\MPy\m_pack_layers_anchor)}% - % \writestatus{delta} {(\lastlayerxpos,\lastlayerypos)}% - % \begingroup - % \edef\currentlayer{\currentlayer\m_pack_layers_page}% - % \global\letlayerparameter\c!position\v!yes - % \endgroup + % \writestatus{layering}{region: \m_pack_layers_region=>\MPxywhd\m_pack_layers_region}% + % \writestatus {}{anchor: \m_pack_layers_anchor=>\MPxywhd\m_pack_layers_anchor}% + % \writestatus {}{offset: \c!dx,\c!dy =>\lastlayerxpos,\lastlayerypos}% \global\letlayerparameter\c!state\v!start % needed ? \setbox\b_layers\vpack to \d_pack_layers_y_size {\hpack to \d_pack_layers_x_size @@ -294,6 +291,8 @@ \def\pack_layers_set_last_position_nop {\setbox\b_layers\emptybox + \d_pack_layers_x_position\p_pack_layers_sx\dimexpr\p_pack_layers_x\relax + \d_pack_layers_y_position\p_pack_layers_sy\dimexpr\p_pack_layers_y\relax \globallet\lastlayerxpos\!!zeropoint \globallet\lastlayerypos\!!zeropoint \doifinset\v!bottom\p_pack_layers_corner\pack_layers_set_bottom_positions @@ -359,8 +358,6 @@ \d_pack_layers_y_offset\p_pack_layers_sy\dimexpr \ifx\p_pack_layers_voffset\v!max\d_pack_layers_y_size\else\p_pack_layers_voffset\fi+\p_pack_layers_offset+\p_pack_layers_dy \relax - \d_pack_layers_x_position\p_pack_layers_sx\dimexpr\p_pack_layers_x\relax - \d_pack_layers_y_position\p_pack_layers_sy\dimexpr\p_pack_layers_y\relax \ifx\p_pack_layers_position\v!yes \pack_layers_set_last_position_yes \else @@ -603,7 +600,7 @@ {\setlayoutcomponentattribute{\v!layer:#2}}% \resetlayoutcomponentattribute % we have conflicting demands: some mechanisms want ll anchoring .. I need to figure this out - % an dmaybe we will have 'origin=bottom' or so + % and maybe we will have 'origin=bottom' or so \setbox\nextbox \ifx\p_pack_layers_option\v!test \ruledvbox \else \vpack \fi \ifx\p_pack_layers_method\v!overlay to \d_overlay_height \fi \layoutcomponentboxattribute {\pack_layers_top_fill @@ -611,13 +608,13 @@ {\box\nextbox \hss}% \pack_layers_bottom_fill}% - % % \edef\currentlayer{#2}% :\the\realpageno}% local .. check \anchor % \edef\p_pack_layers_position{\layerparameter\c!position}% local \ifx\p_pack_layers_position\v!yes \edef\p_pack_layers_region{\layerparameter\c!region}% - \ifx\p_pack_layers_region\empty \else - \anch_mark_tagged_box\nextbox\layeranchor + \ifx\p_pack_layers_region\empty + \else + \anch_mark_tagged_box\nextbox\p_pack_layers_region % was \layeranchor \fi \fi \box\nextbox diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf index e7078fa4f..a83cc821d 100644 Binary files a/tex/context/base/mkiv/status-files.pdf and b/tex/context/base/mkiv/status-files.pdf differ diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf index 33902825c..72d2dd8b1 100644 Binary files a/tex/context/base/mkiv/status-lua.pdf and b/tex/context/base/mkiv/status-lua.pdf differ diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf index 4bc0d2390..102a41e63 100644 Binary files a/tex/context/interface/mkiv/i-context.pdf and b/tex/context/interface/mkiv/i-context.pdf differ diff --git a/tex/context/interface/mkiv/i-position.xml b/tex/context/interface/mkiv/i-position.xml index 54bc952dc..e43ee58ef 100644 --- a/tex/context/interface/mkiv/i-position.xml +++ b/tex/context/interface/mkiv/i-position.xml @@ -183,6 +183,12 @@ + + + + + + @@ -525,4 +531,4 @@ - \ No newline at end of file + diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf index 210410795..b39f48fde 100644 Binary files a/tex/context/interface/mkiv/i-readme.pdf and b/tex/context/interface/mkiv/i-readme.pdf differ diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index d4aa8a51e..1bd1d0a98 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 : 08/08/16 21:28:04 +-- merge date : 08/09/16 21:55:17 do -- begin closure to overcome local limits and interference -- cgit v1.2.3