diff options
author | Hans Hagen <pragma@wxs.nl> | 2012-01-05 19:27:25 +0100 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2012-01-05 19:27:25 +0100 |
commit | 8faafb7250a84be6f1d96be67cbbe27d500d3b47 (patch) | |
tree | 775abb16e550075b2993863e828412e3f06c59ae /tex/context/base/typo-pag.lua | |
parent | 2653bbd48f47c80579c28e2df1a456e0d9fad428 (diff) | |
download | context-8faafb7250a84be6f1d96be67cbbe27d500d3b47.tar.gz |
beta 2011.11.13 23:53
Diffstat (limited to 'tex/context/base/typo-pag.lua')
-rw-r--r-- | tex/context/base/typo-pag.lua | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/tex/context/base/typo-pag.lua b/tex/context/base/typo-pag.lua index 92c8e2c62..482a3a9f8 100644 --- a/tex/context/base/typo-pag.lua +++ b/tex/context/base/typo-pag.lua @@ -24,13 +24,15 @@ local points = number.points local a_keeptogether = attributes.private("keeptogether") -local trace_keeptogether = false trackers.register("parbuilders.keeptogether", function(v) trace_keeptogether = v end) +local trace_keeptogether = false local report_keeptogether = logs.reporter("parbuilders","keeptogether") local cache = { } local last = 0 local enabled = false +trackers.register("parbuilders.keeptogether", function(v) trace_keeptogether = v end) + -- todo: also support lines = 3 etc (e.g. dropped caps) but how to set that -- when no hlists are there ? ... maybe the local_par @@ -71,8 +73,17 @@ function builders.paragraphs.registertogether(line,specification) -- might chang local a = a or last local c = cache[a] if trace_keeptogether then - report_keeptogether("registered, index: %s, height: %s, depth: %s, slack: %s", - a,points(c.height),points(c.depth),points(c.slack)) + local noflines = specification.lineheight + local height = c.height + local depth = c.depth + local slack = c.slack + if not noflines or noflines == 0 then + noflines = "unknown" + else + noflines = math.round((height + depth - slack) / noflines) + end + report_keeptogether("registered, index: %s, height: %s, depth: %s, slack: %s, noflines: %s", + a,points(height),points(depth),points(slack),noflines) end end end |