From 9858ddd23d54c56b2ce9e1f5580190d3210d18ed Mon Sep 17 00:00:00 2001 From: Context Git Mirror Bot Date: Fri, 23 Sep 2016 11:04:57 +0200 Subject: 2016-09-23 10:19:00 --- tex/context/base/mkiv/typo-bld.lua | 63 ++++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 29 deletions(-) (limited to 'tex/context/base/mkiv/typo-bld.lua') diff --git a/tex/context/base/mkiv/typo-bld.lua b/tex/context/base/mkiv/typo-bld.lua index 3f9d4429a..27171bfbd 100644 --- a/tex/context/base/mkiv/typo-bld.lua +++ b/tex/context/base/mkiv/typo-bld.lua @@ -46,6 +46,8 @@ local hpack_node = nodes.hpack local starttiming = statistics.starttiming local stoptiming = statistics.stoptiming +local registercallback = callbacks.register + storage.register("builders/paragraphs/constructors/names", names, "builders.paragraphs.constructors.names") storage.register("builders/paragraphs/constructors/numbers", numbers, "builders.paragraphs.constructors.numbers") @@ -172,7 +174,7 @@ end function constructors.enable () enabled = true end function constructors.disable() enabled = false end -callbacks.register('linebreak_filter', processor, "breaking paragraps into lines") +registercallback('linebreak_filter', processor, "breaking paragraps into lines") statistics.register("linebreak processing time", function() return statistics.elapsedseconds(parbuilders) @@ -255,9 +257,9 @@ function builders.buildpage_filter(groupcode) end end -callbacks.register('vpack_filter', builders.vpack_filter, "vertical spacing etc") -callbacks.register('buildpage_filter', builders.buildpage_filter, "vertical spacing etc (mvl)") ----------.register('contribute_filter', builders.contribute_filter, "adding content to lists") +registercallback('vpack_filter', builders.vpack_filter, "vertical spacing etc") +registercallback('buildpage_filter', builders.buildpage_filter, "vertical spacing etc (mvl)") +----------------('contribute_filter', builders.contribute_filter, "adding content to lists") statistics.register("v-node processing time", function() return statistics.elapsedseconds(builders) @@ -296,7 +298,7 @@ local function vpack_quality(how,n,detail,first,last) end trackers.register("builders.vpack.quality",function(v) - callback.register("vpack_quality",v and report_vpack_quality or nil) + registercallback("vpack_quality",v and report_vpack_quality or nil,"check vpack quality") end) local report, show = false, false @@ -347,37 +349,40 @@ end trackers.register("builders.hpack.quality",function(v) report = v - callback.register("hpack_quality",(report or show) and hpack_quality or nil) + registercallback("hpack_quality",(report or show) and hpack_quality or nil,"check hpack quality") end) trackers.register("builders.hpack.overflow",function(v) show = v - callback.register("hpack_quality",(report or show) and hpack_quality or nil) + registercallback("hpack_quality",(report or show) and hpack_quality or nil,"check hpack quality") end) -- local ignoredepth = - 65536000 -- --- callback.register("append_to_vlist_filter", function(box,location,prevdepth,mirrored) --- if prevdepth > ignoredepth then --- local b = tex.baselineskip --- local d = b.width - prevdepth --- local g = nil --- if mirrored then --- d = d - box.depth --- else --- d = d - box.height --- end --- if d < tex.lineskiplimit then --- g = nodes.pool.glue() --- g.spec = tex.lineskip +-- registercallback( +-- "append_to_vlist_filter", +-- function(box,location,prevdepth,mirrored), +-- if prevdepth > ignoredepth then +-- local b = tex.baselineskip +-- local d = b.width - prevdepth +-- local g = nil +-- if mirrored then +-- d = d - box.depth +-- else +-- d = d - box.height +-- end +-- if d < tex.lineskiplimit then +-- g = nodes.pool.glue() +-- g.spec = tex.lineskip +-- else +-- g = nodes.pool.baselineskip(d) +-- end +-- g.next = box +-- box.prev = g +-- return g, mirrored and box.height or box.depth -- else --- g = nodes.pool.baselineskip(d) +-- return box, mirrored and box.height or box.depth -- end --- g.next = box --- box.prev = g --- return g, mirrored and box.height or box.depth --- else --- return box, mirrored and box.height or box.depth --- end --- end) --- +-- end, +-- "experimental prevdepth checking" +-- ) -- cgit v1.2.3