summaryrefslogtreecommitdiff
path: root/tex/context/base/font-ctx.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2012-07-26 19:37:00 +0200
committerHans Hagen <pragma@wxs.nl>2012-07-26 19:37:00 +0200
commit07f9052e9f88459a4ee947f6c01d9de1119b8355 (patch)
treebab894ba034423f33358488de889e64e83220979 /tex/context/base/font-ctx.lua
parent860c6eaca8251c559f0486c0c1acf7f161821d82 (diff)
downloadcontext-07f9052e9f88459a4ee947f6c01d9de1119b8355.tar.gz
beta 2012.07.26 19:37
Diffstat (limited to 'tex/context/base/font-ctx.lua')
-rw-r--r--tex/context/base/font-ctx.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/tex/context/base/font-ctx.lua b/tex/context/base/font-ctx.lua
index a7dcd6edd..8fdb42c7d 100644
--- a/tex/context/base/font-ctx.lua
+++ b/tex/context/base/font-ctx.lua
@@ -790,6 +790,18 @@ 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
+function helpers.splitfontpattern(str)
+ local name, size = lpegmatch(splitpattern,str)
+ local kind, size = lpegmatch(sizepattern,size)
+ return name, kind, size
+end
+
+function helpers.fontpatternhassize(str)
+ local name, size = lpegmatch(splitpattern,str)
+ local kind, size = lpegmatch(sizepattern,size)
+ return size or false
+end
+
local specification -- still needed as local ?
local getspecification = definers.getspecification