summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/mlib-pps.lua
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2016-06-25 15:40:51 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2016-06-25 15:40:51 +0200
commitb2a2304cbb0c65040d7b118ac9b857d304e333e6 (patch)
treeed5212e37a91ec78c12d9f72ca1186a59c139b40 /tex/context/base/mkiv/mlib-pps.lua
parentb2276ae7a04a9f9c35403e508670049d8c3e4b3e (diff)
downloadcontext-b2a2304cbb0c65040d7b118ac9b857d304e333e6.tar.gz
2016-06-25 14:42:00
Diffstat (limited to 'tex/context/base/mkiv/mlib-pps.lua')
-rw-r--r--tex/context/base/mkiv/mlib-pps.lua34
1 files changed, 34 insertions, 0 deletions
diff --git a/tex/context/base/mkiv/mlib-pps.lua b/tex/context/base/mkiv/mlib-pps.lua
index 358bd9f52..42a2cf12a 100644
--- a/tex/context/base/mkiv/mlib-pps.lua
+++ b/tex/context/base/mkiv/mlib-pps.lua
@@ -931,6 +931,8 @@ local function cl_reset(t)
t[#t+1] = metapost.colorinitializer() -- only color
end
+-- text
+
local function tx_reset()
if top then
-- why ?
@@ -1083,6 +1085,37 @@ local function tx_process(object,prescript,before,after)
end
end
+-- we could probably redo normal textexts in the next way but as it's rather optimized
+-- we keep away from that (at least for now)
+
+local function bx_process(object,prescript,before,after)
+ local bx_category = prescript.bx_category
+ local bx_name = prescript.bx_name
+ if bx_category and bx_name then
+ if trace_textexts then
+ report_textexts("category %a, name %a",bx_category,bx_name)
+ end
+ local sx, rx, ry, sy, tx, ty = cm(object) -- needs to be frozen outside the function
+ local wd, ht, dp = nodes.boxes.dimensions(bx_category,bx_name)
+ before[#before+1] = function()
+ context.MPLIBgetboxscaledcm(bx_category,bx_name,
+ f_f(sx), -- bah ... %s no longer checks
+ f_f(rx), -- bah ... %s no longer checks
+ f_f(ry), -- bah ... %s no longer checks
+ f_f(sy), -- bah ... %s no longer checks
+ f_f(tx), -- bah ... %s no longer checks
+ f_f(ty), -- bah ... %s no longer checks
+ sxsy(wd,ht,dp))
+ end
+ if not trace_textexts then
+ object.path = false -- else: keep it
+ end
+ object.color = false
+ object.grouped = true
+ object.istext = true
+ end
+end
+
-- graphics (we use the given index because pictures can be reused)
local graphics = { }
@@ -1508,6 +1541,7 @@ appendaction(processoractions,"system",sh_process)
-- (processoractions,"system",gt_process)
appendaction(processoractions,"system",bm_process)
appendaction(processoractions,"system",tx_process)
+appendaction(processoractions,"system",bx_process)
appendaction(processoractions,"system",ps_process)
appendaction(processoractions,"system",fg_process)
appendaction(processoractions,"system",tr_process) -- last, as color can be reset