diff options
author | Hans Hagen <pragma@wxs.nl> | 2019-09-27 20:24:34 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2019-09-27 20:24:34 +0200 |
commit | 0a5f59a9aa25b3de7e9659b39ad201aaf7eb5a67 (patch) | |
tree | a652bb083d6bc6a9b6309908dd5d09a539ac3859 /tex/context/base/mkiv/mlib-scn.lua | |
parent | 58c7c9288160407c874930aac789ef6ef3faa6b5 (diff) | |
download | context-0a5f59a9aa25b3de7e9659b39ad201aaf7eb5a67.tar.gz |
2019-09-27 18:10:00
Diffstat (limited to 'tex/context/base/mkiv/mlib-scn.lua')
-rw-r--r-- | tex/context/base/mkiv/mlib-scn.lua | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tex/context/base/mkiv/mlib-scn.lua b/tex/context/base/mkiv/mlib-scn.lua index a85c861bd..8867455b6 100644 --- a/tex/context/base/mkiv/mlib-scn.lua +++ b/tex/context/base/mkiv/mlib-scn.lua @@ -60,6 +60,7 @@ local scancolor = scanners.color local scancmykcolor = scanners.cmykcolor local scantransform = scanners.transform local scanpath = scanners.path +local scanpen = scanners.pen local mpprint = mp.print local mpnumeric = mp.numeric @@ -164,6 +165,7 @@ typescanners = { [types.cmykcolor] = scan_cmykcolor, [types.transform] = scan_transform, [types.path] = scanpath, + [types.pen] = scanpen, } table.setmetatableindex(tokenscanners,function() @@ -603,6 +605,22 @@ local function getparameterpath() end end +local function getparameterpen() + local list, n = collectnames() + local v = namespaces + for i=1,n do + v = v[list[i]] + if not v then + break + end + end + if type(v) == "table" then + return mppath(v,"..",true) + else + return mppair(0,0) + end +end + local function getparametertext() local list, n = collectnames() local strut = list[n] @@ -660,6 +678,7 @@ metapost.registerscript("getparameterdefault", getparameterdefault) metapost.registerscript("getparametercount", getparametercount) metapost.registerscript("getmaxparametercount",getmaxparametercount) metapost.registerscript("getparameterpath", getparameterpath) +metapost.registerscript("getparameterpen", getparameterpen) metapost.registerscript("getparametertext", getparametertext) --------.registerscript("getparameteroption", getparameteroption) metapost.registerscript("pushparameters", pushparameters) |