summaryrefslogtreecommitdiff
path: root/tex/context/base/font-ctx.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2012-08-16 22:20:00 +0200
committerHans Hagen <pragma@wxs.nl>2012-08-16 22:20:00 +0200
commitbc1e8c26c1c0596eb7410b522bff296fa6e7e2fc (patch)
tree82f6f25cd9d26e77a0c076cc1694e1d247f3cd19 /tex/context/base/font-ctx.lua
parent0dc23517ffebac8da38bbf8b4b8753d2a39848a7 (diff)
downloadcontext-bc1e8c26c1c0596eb7410b522bff296fa6e7e2fc.tar.gz
beta 2012.08.16 22:20
Diffstat (limited to 'tex/context/base/font-ctx.lua')
-rw-r--r--tex/context/base/font-ctx.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/tex/context/base/font-ctx.lua b/tex/context/base/font-ctx.lua
index 1badc090d..4961c4ae8 100644
--- a/tex/context/base/font-ctx.lua
+++ b/tex/context/base/font-ctx.lua
@@ -1601,3 +1601,18 @@ commands.definefontfeature = fonts.specifiers.presetcontext
function commands.featurelist(...)
context(fonts.specifiers.contexttostring(...))
end
+
+-- a fontkern plug:
+
+local copy_node = node.copy
+local kern = nodes.pool.register(nodes.pool.kern())
+
+node.set_attribute(kern,attributes.private('fontkern'),1) -- we can have several, attributes are shared
+
+nodes.injections.installnewkern(function(k)
+ local c = copy_node(kern)
+ c.kern = k
+ return c
+end)
+
+directives.register("nodes.injections.fontkern", function(v) kern.subtype = v and 0 or 1 end)