diff options
Diffstat (limited to 'tex/context/base/mlib-lua.lua')
-rw-r--r-- | tex/context/base/mlib-lua.lua | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tex/context/base/mlib-lua.lua b/tex/context/base/mlib-lua.lua index 7d95e1b37..392fc1a3c 100644 --- a/tex/context/base/mlib-lua.lua +++ b/tex/context/base/mlib-lua.lua @@ -348,3 +348,35 @@ function metapost.initializescriptrunner(mpx,trialrun) end -- trace_enabled = not trialrun blocks too much end + +-- texts: + +local factor = 65536*(7227/7200) +local textexts = nil +local mptriplet = mp.triplet + +function mp.tt_initialize(tt) + textexts = tt +end + +-- function mp.tt_wd(n) +-- local box = textexts and textexts[n] +-- mpprint(box and box.width/factor or 0) +-- end +-- function mp.tt_ht(n) +-- local box = textexts and textexts[n] +-- mpprint(box and box.height/factor or 0) +-- end +-- function mp.tt_dp(n) +-- local box = textexts and textexts[n] +-- mpprint(box and box.depth/factor or 0) +-- end + +function mp.tt_dimensions(n) + local box = textexts and textexts[n] + if box then + mptriplet(box.width/factor,box.height/factor,box.depth/factor) + else + mptriplet(0,0,0) + end +end |