diff options
author | Hans Hagen <pragma@wxs.nl> | 2011-10-12 10:14:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2011-10-12 10:14:00 +0200 |
commit | 4680e3b1c502484cdba78372162dd4f51e398894 (patch) | |
tree | c90941ed8418d2ddadf7bbf01342857f705b3122 /tex/context/base/node-tra.lua | |
parent | bd9c410acd522b2308bd5c4a60f7f7670ecfa6c9 (diff) | |
download | context-4680e3b1c502484cdba78372162dd4f51e398894.tar.gz |
beta 2011.10.12 10:14
Diffstat (limited to 'tex/context/base/node-tra.lua')
-rw-r--r-- | tex/context/base/node-tra.lua | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/tex/context/base/node-tra.lua b/tex/context/base/node-tra.lua index 5012095b3..3b5b1d018 100644 --- a/tex/context/base/node-tra.lua +++ b/tex/context/base/node-tra.lua @@ -643,15 +643,32 @@ local bpfactor = number.dimenfactors.bp local stripper = lpeg.patterns.stripzeros local points = function(n) - return lpegmatch(stripper,format("%.5fpt",n*ptfactor)) + if not n or n == 0 then + return "0pt" + else + return lpegmatch(stripper,format("%.5fpt",n*ptfactor)) + end end local basepoints = function(n) - return lpegmatch(stripper,format("%.5fbp",n*bpfactor)) + if not n or n == 0 then + return "0bp" + else + return lpegmatch(stripper,format("%.5fbp",n*bpfactor)) + end +end + +local pts = function(n) + if not n or n == 0 then + return "0pt" + else + return format("%.5fpt",n*ptfactor) + end end number.points = points number.basepoints = basepoints +number.pts = pts --~ function nodes.thespec(s) --~ local stretch_order = s.stretch_order |