diff options
author | Hans Hagen <pragma@wxs.nl> | 2010-02-25 19:46:00 +0100 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2010-02-25 19:46:00 +0100 |
commit | 8ce9c33634056a6c8b9673c7f14a27cef1f3348f (patch) | |
tree | 2cc2233e523548c9925349ff60b80a6ab5b2f3b1 /tex/context/base/font-ctx.lua | |
parent | 66aa7cfc8c9424ee0fe4e62a83b86dac39dc59a1 (diff) | |
download | context-8ce9c33634056a6c8b9673c7f14a27cef1f3348f.tar.gz |
beta 2010.02.25 19:46
Diffstat (limited to 'tex/context/base/font-ctx.lua')
-rw-r--r-- | tex/context/base/font-ctx.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tex/context/base/font-ctx.lua b/tex/context/base/font-ctx.lua index 6ee2ca0d9..e37c0ea76 100644 --- a/tex/context/base/font-ctx.lua +++ b/tex/context/base/font-ctx.lua @@ -451,12 +451,14 @@ function fonts.cleanname(name) texsprint(ctxcatcodes,fonts.names.cleanname(name)) end -local p, f = 1, "%0.01fpt" -- normally this value is changed only once +local p, f = 1, "%0.1fpt" -- normally this value is changed only once + +local stripper = lpeg.patterns.strip_zeros function fonts.nbfs(amount,precision) if precision ~= p then p = precision - f = "%0.0" .. p .. "fpt" + f = "%0." .. p .. "fpt" end - texsprint(ctxcatcodes,format(f,amount/65536)) + texsprint(ctxcatcodes,lpegmatch(stripper,format(f,amount/65536))) end |