diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2015-04-29 20:15:05 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2015-04-29 20:15:05 +0200 |
commit | 59947aaf3bf2ad07251a569a77338c8c41f9e377 (patch) | |
tree | 0da53be81a91ea3bed5bcb4c5be8f725e6da54aa /tex/context/base/font-ctx.lua | |
parent | d60cd418153b3ea6909c8b4691a160f54c41a670 (diff) | |
download | context-59947aaf3bf2ad07251a569a77338c8c41f9e377.tar.gz |
2015-04-29 19:33:00
Diffstat (limited to 'tex/context/base/font-ctx.lua')
-rw-r--r-- | tex/context/base/font-ctx.lua | 83 |
1 files changed, 61 insertions, 22 deletions
diff --git a/tex/context/base/font-ctx.lua b/tex/context/base/font-ctx.lua index 2c96e9ac2..81db31652 100644 --- a/tex/context/base/font-ctx.lua +++ b/tex/context/base/font-ctx.lua @@ -2003,15 +2003,15 @@ end do - local scanners = tokens.scanners - local scanstring = scanners.string - local scaninteger = scanners.integer - local scandimen = scanners.dimen - local scanboolean = scanners.boolean + -- local scanners = tokens.scanners + -- local scanstring = scanners.string + -- local scaninteger = scanners.integer + -- local scandimen = scanners.dimen + -- local scanboolean = scanners.boolean - local setmacro = tokens.setters.macro + -- local scanners = interfaces.scanners - local scanners = interfaces.scanners + local setmacro = tokens.setters.macro function constructors.currentfonthasfeature(n) local f = fontdata[currentfont()] @@ -2040,25 +2040,64 @@ do -- context(lpegmatch(stripper,f(amount/65536))) -- end - local f = formatters["%0.2fpt"] -- normally this value is changed only once - + local f_strip = formatters["%0.2fpt"] -- normally this value is changed only once local stripper = lpeg.patterns.stripzeros - scanners.nbfs = function() - context(lpegmatch(stripper,f(scandimen()/65536))) - end + -- scanners.nbfs = function() + -- context(lpegmatch(stripper,f_strip(scandimen()/65536))) + -- end + + implement { + name = "nbfs", + arguments = "dimen", + actions = function(d) + context(lpegmatch(stripper,f_strip(d/65536))) + end + } + + -- commands.featureattribute = function(tag) context(contextnumber(tag)) end + -- commands.setfontfeature = function(tag) texsetattribute(0,contextnumber(tag)) end + -- commands.resetfontfeature = function() texsetattribute(0,0) end + -- commands.setfontofid = function(id) context_getvalue(csnames[id]) end + -- commands.definefontfeature = presetcontext - commands.featureattribute = function(tag) context(contextnumber(tag)) end - commands.setfontfeature = function(tag) texsetattribute(0,contextnumber(tag)) end - commands.resetfontfeature = function() texsetattribute(0,0) end - commands.setfontofid = function(id) context_getvalue(csnames[id]) end - commands.definefontfeature = presetcontext + -- scanners.featureattribute = function() context(contextnumber(scanstring())) end + -- scanners.setfontfeature = function() texsetattribute(0,contextnumber(scanstring())) end + -- scanners.resetfontfeature = function() texsetattribute(0,0) end + -- scanners.setfontofid = function() context_getvalue(csnames[scaninteger()]) end + -- scanners.definefontfeature = function() presetcontext(scanstring(),scanstring(),scanstring()) end - scanners.featureattribute = function() context(contextnumber(scanstring())) end - scanners.setfontfeature = function() texsetattribute(0,contextnumber(scanstring())) end - scanners.resetfontfeature = function() texsetattribute(0,0) end - scanners.setfontofid = function() context_getvalue(csnames[scaninteger()]) end - scanners.definefontfeature = function() presetcontext(scanstring(),scanstring(),scanstring()) end + implement { + name = "featureattribute", + arguments = "string", + actions = { contextnumber, context } + } + + implement { + name = "setfontfeature", + arguments = "string", + actions = function(tag) texsetattribute(0,contextnumber(tag)) end + } + + implement { + name = "resetfontfeature", + arguments = { 0, 0 }, + actions = texsetattribute, + } + + implement { + name = "setfontofid", + arguments = "integer", + actions = function(id) + context_getvalue(csnames[id]) + end + } + + implement { + name = "definefontfeature", + arguments = { "string", "string", "string" }, + actions = presetcontext + } local cache = { } |