From 8c264fd9af50c767be17918fc6b4d0da09167dec Mon Sep 17 00:00:00 2001 From: Marius Date: Sat, 17 Dec 2011 11:40:14 +0200 Subject: beta 2011.12.17 10:04 --- tex/context/base/attr-lay.mkiv | 6 +-- tex/context/base/cont-new.mkii | 2 +- tex/context/base/cont-new.mkiv | 2 +- tex/context/base/context-version.pdf | Bin 4070 -> 4071 bytes tex/context/base/context-version.png | Bin 105590 -> 104996 bytes tex/context/base/context.mkii | 2 +- tex/context/base/context.mkiv | 2 +- tex/context/base/font-ini.mkiv | 32 ++++++++----- tex/context/base/pack-rul.lua | 50 ++++++++++++++------- tex/context/base/pack-rul.mkiv | 12 +++-- tex/context/base/page-ini.mkiv | 12 ++--- tex/context/base/page-sid.mkiv | 16 +++---- tex/context/base/status-files.pdf | Bin 24005 -> 23984 bytes tex/context/base/status-lua.pdf | Bin 169716 -> 169712 bytes tex/context/base/supp-box.mkiv | 47 +++++++++++-------- tex/context/base/x-set-11.mkiv | 2 +- tex/context/base/x-set-12.mkiv | 3 -- tex/generic/context/luatex/luatex-fonts-merged.lua | 2 +- 18 files changed, 113 insertions(+), 77 deletions(-) diff --git a/tex/context/base/attr-lay.mkiv b/tex/context/base/attr-lay.mkiv index 55f3bcdc8..047bbcd45 100644 --- a/tex/context/base/attr-lay.mkiv +++ b/tex/context/base/attr-lay.mkiv @@ -76,10 +76,10 @@ printable = "\v!yes" }}}% \edef\layoutcomponentboxattribute{attr \viewerlayerattribute \layoutcomponentboxattribute\relax}% - \expandafter\glet\csname\??ly:a:#1\endcsname\layoutcomponentboxattribute} + \expandafter\glet\csname\??lr:a:#1\endcsname\layoutcomponentboxattribute} \def\dosetlayoutcomponentattribute#1% make this faster - {\expandafter\let\expandafter\layoutcomponentboxattribute\csname\??ly:a:#1\endcsname + {\expandafter\let\expandafter\layoutcomponentboxattribute\csname\??lr:a:#1\endcsname \ifx\layoutcomponentboxattribute\relax \doinitializelayoutcomponent{#1}% get rid of { } \fi} @@ -92,7 +92,7 @@ \let\layoutcomponentboxattribute \empty \def\showlayoutcomponents - {\ctxlua{attributes.viewerlayers.enable()}% + {\ctxlua{attributes.viewerlayers.enable()}% will go \let\setlayoutcomponentattribute \dosetlayoutcomponentattribute \let\resetlayoutcomponentattribute\doresetlayoutcomponentattribute} diff --git a/tex/context/base/cont-new.mkii b/tex/context/base/cont-new.mkii index d17753ab7..54e5b76c2 100644 --- a/tex/context/base/cont-new.mkii +++ b/tex/context/base/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2011.12.16 17:07} +\newcontextversion{2011.12.17 10:04} %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/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 9828fcf67..9573a034c 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{2011.12.16 17:07} +\newcontextversion{2011.12.17 10:04} %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-version.pdf b/tex/context/base/context-version.pdf index 739da779f..d294b4d27 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-version.png b/tex/context/base/context-version.png index f6b70f417..f70c28fb0 100644 Binary files a/tex/context/base/context-version.png and b/tex/context/base/context-version.png differ diff --git a/tex/context/base/context.mkii b/tex/context/base/context.mkii index f88dcc041..5fb02040a 100644 --- a/tex/context/base/context.mkii +++ b/tex/context/base/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2011.12.16 17:07} +\edef\contextversion{2011.12.17 10:04} %D For those who want to use this: diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index 1b39a7e0b..cf9fd47c2 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2011.12.16 17:07} +\edef\contextversion{2011.12.17 10:04} %D For those who want to use this: diff --git a/tex/context/base/font-ini.mkiv b/tex/context/base/font-ini.mkiv index e4c63a4c9..4f6f2927a 100644 --- a/tex/context/base/font-ini.mkiv +++ b/tex/context/base/font-ini.mkiv @@ -547,7 +547,7 @@ \csname \fontbody\c!mm\fontfamily\fontsize\currentmathsize\endcsname \else \ifcsname \fontbody\c!mm\fontfamily \currentmathsize\endcsname \autofontsizetrue \csname \fontbody\c!mm\fontfamily \currentmathsize\endcsname \else - \font\nullfont \autofontsizetrue + \nullfont \autofontsizetrue \fi\fi} \def\dosetmathfamilyindeed#1#2% \currentmathsize etc are also used later on @@ -563,23 +563,31 @@ \let\fontbody\savedfontbody \autofontsizefalse} -\def\dodosetboldmathfamily#1% - {\ifcsname\fontclass \fontbody\c!mm\fontfamily\fontsize\currentmathsize\endcsname \autofontsizefalse - \csname\fontclass \fontbody\c!mm\fontfamily\fontsize\currentmathsize\endcsname - \else\ifcsname\fontclass \fontbody\c!mm\fontfamily \currentmathsize\endcsname \autofontsizetrue - \csname\fontclass \fontbody\c!mm\fontfamily \currentmathsize\endcsname - \else - \font#1% +\def\dodosetboldmathfamily#1#2#3% + {\ifcsname\fontclass\fontbody\c!mm\fontfamily\fontsize\currentmathsize\endcsname \autofontsizefalse + \csname\fontclass\fontbody\c!mm\fontfamily\fontsize\currentmathsize\endcsname #1#2\font \else + \ifcsname\fontclass\fontbody\c!mm\fontfamily \currentmathsize\endcsname \autofontsizetrue + \csname\fontclass\fontbody\c!mm\fontfamily \currentmathsize\endcsname #1#2\font \else + #1#2#1#3% \fi\fi} -\def\dosetboldmathfamilyindeed#1#2#3% +% \def\dodosetboldmathfamily#1#2#3% +% {\ifcsname\fontclass\fontbody\c!mm\fontfamily\fontsize\currentmathsize\endcsname \autofontsizefalse +% \csname\fontclass\fontbody\c!mm\fontfamily\fontsize\currentmathsize\endcsname \else +% \ifcsname\fontclass\fontbody\c!mm\fontfamily \currentmathsize\endcsname \autofontsizetrue +% \csname\fontclass\fontbody\c!mm\fontfamily \currentmathsize\endcsname \else +% \the#1#3% +% \fi\fi +% #1#2\font} + +\def\dosetboldmathfamilyindeed#1#2#3% \mbfam \c!mb \mrfam {\let\savedfontclass\defaultfontclass \let\defaultfontclass\fontclass % else truefontname falls back on the wrong one \let\savedfontbody\fontbody \let\fontfamily#2% - \let\currentmathsize\!!plusthree\let\fontbody\scriptscriptface\dodosetboldmathfamily#3\scriptscriptfont#1\font - \let\currentmathsize\!!plustwo \let\fontbody\scriptface \dodosetboldmathfamily#3\scriptfont #1\font - \let\currentmathsize\!!plusone \let\fontbody\textface \dodosetboldmathfamily#3\textfont #1\font + \let\currentmathsize\!!plusthree\let\fontbody\scriptscriptface\dodosetboldmathfamily\scriptscriptfont#1#3% + \let\currentmathsize\!!plustwo \let\fontbody\scriptface \dodosetboldmathfamily\scriptfont #1#3% + \let\currentmathsize\!!plusone \let\fontbody\textface \dodosetboldmathfamily\textfont #1#3% \ifconditional\optimizemathfontdefinitions \dosavefontclassmathfamily#1#2% \fi diff --git a/tex/context/base/pack-rul.lua b/tex/context/base/pack-rul.lua index 181bff234..cd2e809e7 100644 --- a/tex/context/base/pack-rul.lua +++ b/tex/context/base/pack-rul.lua @@ -17,52 +17,68 @@ local texdimen, texcount = tex.dimen, tex.count -- fastrepack function commands.doreshapeframedbox(n) - local box, noflines, firstheight, lastdepth, lastlinelength = texbox[n], 0, nil, nil, 0 + local box = texbox[n] + local noflines = 0 + local firstheight = nil + local lastdepth = nil + local lastlinelength = 0 + local minwidth = 0 + local maxwidth = 0 + local totalwidth = 0 if box.width ~= 0 then local list = box.list if list then - local width, done = 0, false for h in traverse_id('hlist',list) do -- no dir etc needed if not firstheight then firstheight = h.height end lastdepth = h.depth + noflines = noflines + 1 local l = h.list if l then - done = true local p = hpack(copy(l)) lastlinelength = p.width - if lastlinelength > width then - width = lastlinelength + if lastlinelength > maxwidth then + maxwidth = lastlinelength + end + if lastlinelength < minwidth or minwidth == 0 then + minwidth = lastlinelength end + totalwidth = totalwidth + lastlinelength free(p) end end - if done then - if width ~= 0 then + if firstheight then + if maxwidth ~= 0 then for h in traverse_id('hlist',list) do local l = h.list if l then - -- if h.width ~= width then -- else no display math handling (uses shift) - h.list = hpack(l,width,'exactly',h.dir) + -- if h.width ~= maxwidth then -- else no display math handling (uses shift) + h.list = hpack(l,maxwidth,'exactly',h.dir) h.shift = 0 -- needed for display math - h.width = width + h.width = maxwidth -- end end end end - box.width = width + box.width = maxwidth end end end ---~ print("reshape", noflines, firstheight or 0, lastdepth or 0) - texsetcount("global","framednoflines", noflines) - texsetdimen("global","framedfirstheight", firstheight or 0) - texsetdimen("global","framedlastdepth", lastdepth or 0) + -- print("reshape", noflines, firstheight or 0, lastdepth or 0) + texsetcount("global","framednoflines", noflines) + texsetdimen("global","framedfirstheight", firstheight or 0) + texsetdimen("global","framedlastdepth", lastdepth or 0) + texsetdimen("global","framedminwidth", minwidth) + texsetdimen("global","framedmaxwidth", maxwidth) + texsetdimen("global","framedaveragewidth", noflines > 0 and totalwidth/noflines or 0) end function commands.doanalyzeframedbox(n) - local box, noflines, firstheight, lastdepth = texbox[n], 0, nil, nil + local box = texbox[n] + local noflines = 0 + local firstheight = nil + local lastdepth = nil if box.width ~= 0 then local list = box.list if list then @@ -75,7 +91,7 @@ function commands.doanalyzeframedbox(n) end end end ---~ print("analyze", noflines, firstheight or 0, lastdepth or 0) + -- print("analyze", noflines, firstheight or 0, lastdepth or 0) texsetcount("global","framednoflines", noflines) texsetdimen("global","framedfirstheight", firstheight or 0) texsetdimen("global","framedlastdepth", lastdepth or 0) diff --git a/tex/context/base/pack-rul.mkiv b/tex/context/base/pack-rul.mkiv index 4f6b14d71..f3de471f3 100644 --- a/tex/context/base/pack-rul.mkiv +++ b/tex/context/base/pack-rul.mkiv @@ -1962,11 +1962,17 @@ \newcount\framednoflines \newdimen\framedfirstheight \newdimen\framedlastdepth +\newdimen\framedminwidth +\newdimen\framedmaxwidth +\newdimen\framedaveragewidth \def\resetshapeframebox - {\framednoflines \zerocount - \framedfirstheight\zeropoint - \framedlastdepth \zeropoint} + {\framednoflines \zerocount + \framedfirstheight \zeropoint + \framedlastdepth \zeropoint + \framedminwidth \zeropoint + \framedmaxwidth \zeropoint + \framedaveragewidth\zeropoint} \let\framedboxwidth \!!zeropoint \let\framedboxheight\!!zeropoint diff --git a/tex/context/base/page-ini.mkiv b/tex/context/base/page-ini.mkiv index d423a5d8a..b8e419a79 100644 --- a/tex/context/base/page-ini.mkiv +++ b/tex/context/base/page-ini.mkiv @@ -272,7 +272,7 @@ \def\page_otr_force_another_page {% we should actually remove the dummy line in the otr - \hbox to \hsize{} + \hbox to \hsize{}% \kern-\topskip \nobreak \vfill @@ -332,11 +332,11 @@ % Can't we get rid of this hackery? It's used in some widgets % stuff so probably not. -\newbox\d_page_otr_special +\newbox\b_page_otr_special \def\page_otr_flush_special_content - {\ifvoid\d_page_otr_special \else - \box\d_page_otr_special + {\ifvoid\b_page_otr_special \else + \box\b_page_otr_special \fi} \def\page_otr_add_special_content @@ -346,9 +346,9 @@ {\wd\nextbox\zeropoint \ht\nextbox\zeropoint \dp\nextbox\zeropoint - \global\setbox\d_page_otr_special\hbox + \global\setbox\b_page_otr_special\hbox {%\hskip-\maxdimen % not here, fails in acrobat (clips) - \box\d_page_otr_special\box\nextbox}}% was \unhbox, is now box again + \box\b_page_otr_special\box\nextbox}}% was \unhbox, is now box again \let\flushatshipout\page_otr_add_special_content diff --git a/tex/context/base/page-sid.mkiv b/tex/context/base/page-sid.mkiv index efea19e70..38ae1cfcc 100644 --- a/tex/context/base/page-sid.mkiv +++ b/tex/context/base/page-sid.mkiv @@ -205,14 +205,14 @@ \boxrulewidth.5\points \ruledhbox{\strut\kern\d_page_sides_width}}% \fi - \par - \ifdim\dimexpr\d_page_sides_vsize-\pagetotal\relax>\zeropoint - \ifnum\recurselevel>\plushundred % safeguard, sort of deadcycles - \exitloop - \fi - \else - \exitloop - \fi}% + \par + \ifdim\dimexpr\d_page_sides_vsize-\pagetotal\relax>\zeropoint + \ifnum\recurselevel>\plushundred % safeguard, sort of deadcycles + \exitloop + \fi + \else + \exitloop + \fi}% \endgroup \ifdim\parskip>\zeropoint % why this test ? \ifdim\sidefloatbottomskip>\parskip diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf index a886a25ac..27f401f74 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 930ea4472..ef503386e 100644 Binary files a/tex/context/base/status-lua.pdf and b/tex/context/base/status-lua.pdf differ diff --git a/tex/context/base/supp-box.mkiv b/tex/context/base/supp-box.mkiv index ce4f0544f..1b24b0455 100644 --- a/tex/context/base/supp-box.mkiv +++ b/tex/context/base/supp-box.mkiv @@ -92,33 +92,35 @@ \newcount\c_boxes_register \unexpanded\def\smashbox - {\afterassignment\dosmashbox\c_boxes_register} + {\afterassignment\boxes_smash_boxes_register\c_boxes_register} -\def\dosmashbox +\def\boxes_smash_boxes_register {\wd\c_boxes_register\zeropoint \ht\c_boxes_register\zeropoint \dp\c_boxes_register\zeropoint} -\unexpanded\def\smashedbox - {\afterassignment\thesmashedbox\c_boxes_register} - -\unexpanded\def\thesmashedbox - {\dosmashbox - \box\c_boxes_register} - \unexpanded\def\hsmashbox - {\afterassignment\dohsmashbox\c_boxes_register} + {\afterassignment\boxes_hsmashed_boxes_register\c_boxes_register} -\def\dohsmashbox +\def\boxes_hsmashed_boxes_register {\wd\c_boxes_register\zeropoint} \unexpanded\def\vsmashbox - {\afterassignment\dovsmashbox\c_boxes_register} + {\afterassignment\boxes_vsmashed_boxes_register\c_boxes_register} -\def\dovsmashbox +\def\boxes_vsmashed_boxes_register {\ht\c_boxes_register\zeropoint \dp\c_boxes_register\zeropoint} +\unexpanded\def\smashedbox + {\afterassignment\boxes_smashed_boxes_register\c_boxes_register} + +\unexpanded\def\boxes_smashed_boxes_register + {\wd\c_boxes_register\zeropoint + \ht\c_boxes_register\zeropoint + \dp\c_boxes_register\zeropoint + \box\c_boxes_register} + %D \macros %D {hsmash,vsmash, %D hsmashed,vsmashed} @@ -685,19 +687,26 @@ %D %D {\em todo: Search source for potential usage!} +% \unexpanded\def\dowithnextboxcontent#1#2% inside, after +% {\def\boxes_with_next_box_one{#2}% +% \def\boxes_with_next_box_two{#1\aftergroup\boxes_with_next_box_one}% +% \afterassignment\boxes_with_next_box_two +% \setbox\nextbox} + \unexpanded\def\dowithnextboxcontent#1#2% inside, after - {\def\boxes_with_next_box{#2}% - \def\boxes_with_next_box_indeed{#1\aftergroup\boxes_with_next_box}% - \afterassignment\boxes_with_next_box_indeed + {\def\boxes_with_next_box_one{#2}% + \def\boxes_with_next_box_two{#1}% + \afterassignment\boxes_with_next_box_content_indeed \setbox\nextbox} \unexpanded\def\dowithnextboxcontentcs#1#2% inside, after - {\let\boxes_with_next_box#2% - \let\boxes_with_next_box_indeed#1% + {\let\boxes_with_next_box_one#2% + \let\boxes_with_next_box_two#1% \afterassignment\boxes_with_next_box_content_indeed \setbox\nextbox} -\def\boxes_with_next_box_content_indeed{\boxes_with_next_box_indeed\aftergroup\boxes_with_next_box}% +\def\boxes_with_next_box_content_indeed + {\boxes_with_next_box_two\aftergroup\boxes_with_next_box_one} %D \macros %D {llap, rlap, tlap, blap, clap} diff --git a/tex/context/base/x-set-11.mkiv b/tex/context/base/x-set-11.mkiv index 5a14b5ebd..f55b63859 100644 --- a/tex/context/base/x-set-11.mkiv +++ b/tex/context/base/x-set-11.mkiv @@ -516,7 +516,7 @@ %\blank[\v!line] % packed mode (we could do \startunpacked ...) \godown[.75\lineheight] \switchtobodyfont[small] - \ignorespaces\xmlfilter{#1}{/arguments/text()}\endgraf + \ignorespaces\xmlfilter{#1}{/arguments/text()}\endgraf \egroup } \getvalue{\e!stop setuptext} diff --git a/tex/context/base/x-set-12.mkiv b/tex/context/base/x-set-12.mkiv index 43a3ede29..bfeb0ab54 100644 --- a/tex/context/base/x-set-12.mkiv +++ b/tex/context/base/x-set-12.mkiv @@ -75,9 +75,6 @@ \usetypescript[palatino] \setupbodyfont[palatino,9pt] -\setupcolors - [\c!state=\v!start] - \defineoverlay [cover] [\hbox to \paperwidth{\hss\reuseMPgraphic{cover+back}}] diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 0781e84ec..dcfc88170 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/16/11 17:07:02 +-- merge date : 12/17/11 10:04:41 do -- begin closure to overcome local limits and interference -- cgit v1.2.3