diff options
author | Hans Hagen <pragma@wxs.nl> | 2010-02-24 22:28:00 +0100 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2010-02-24 22:28:00 +0100 |
commit | 66aa7cfc8c9424ee0fe4e62a83b86dac39dc59a1 (patch) | |
tree | 51611577dc8b62bd54d559ccc469ca8e46713f82 /tex/context/base/font-ctx.lua | |
parent | 8098b3762ab0700f87d8dd18e3c37e43b5b54357 (diff) | |
download | context-66aa7cfc8c9424ee0fe4e62a83b86dac39dc59a1.tar.gz |
beta 2010.02.24 22:28
Diffstat (limited to 'tex/context/base/font-ctx.lua')
-rw-r--r-- | tex/context/base/font-ctx.lua | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/tex/context/base/font-ctx.lua b/tex/context/base/font-ctx.lua index 48f99efba..6ee2ca0d9 100644 --- a/tex/context/base/font-ctx.lua +++ b/tex/context/base/font-ctx.lua @@ -277,12 +277,13 @@ local spaces = space^0 local leftparent = (P"(") local rightparent = (P")") local value = C((leftparent * (1-rightparent)^0 * rightparent + (1-space))^1) +local dimension = C((space/"" + P(1))^1) local rest = C(P(1)^0) local scale_none = Cc(0) -local scale_at = P("at") * Cc(1) * spaces * value -local scale_sa = P("sa") * Cc(2) * spaces * value -local scale_mo = P("mo") * Cc(3) * spaces * value -local scale_scaled = P("scaled") * Cc(4) * spaces * value +local scale_at = P("at") * Cc(1) * spaces * dimension -- value +local scale_sa = P("sa") * Cc(2) * spaces * dimension -- value +local scale_mo = P("mo") * Cc(3) * spaces * dimension -- value +local scale_scaled = P("scaled") * Cc(4) * spaces * dimension -- value local sizepattern = spaces * (scale_at + scale_sa + scale_mo + scale_scaled + scale_none) local splitpattern = spaces * value * spaces * rest @@ -449,3 +450,13 @@ end function fonts.cleanname(name) texsprint(ctxcatcodes,fonts.names.cleanname(name)) end + +local p, f = 1, "%0.01fpt" -- normally this value is changed only once + +function fonts.nbfs(amount,precision) + if precision ~= p then + p = precision + f = "%0.0" .. p .. "fpt" + end + texsprint(ctxcatcodes,format(f,amount/65536)) +end |