summaryrefslogtreecommitdiff
path: root/src/fontloader/misc/fontloader-fonts-cbk.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2014-12-22 16:42:02 +0100
committerPhilipp Gesang <phg42.2a@gmail.com>2014-12-22 16:42:02 +0100
commit3a5009d6feedc1a4c4e5a8d61c7e67b9c35399fa (patch)
tree299468068c249d5e8edf663687b3d17c35bc342c /src/fontloader/misc/fontloader-fonts-cbk.lua
parentd2a1af0a62a2540c8b88345b8d1e84ba61a8a49f (diff)
downloadluaotfload-3a5009d6feedc1a4c4e5a8d61c7e67b9c35399fa.tar.gz
[fontloader] sync with Context as of 2014-12-22
Diffstat (limited to 'src/fontloader/misc/fontloader-fonts-cbk.lua')
-rw-r--r--src/fontloader/misc/fontloader-fonts-cbk.lua44
1 files changed, 37 insertions, 7 deletions
diff --git a/src/fontloader/misc/fontloader-fonts-cbk.lua b/src/fontloader/misc/fontloader-fonts-cbk.lua
index 965b968..414cafb 100644
--- a/src/fontloader/misc/fontloader-fonts-cbk.lua
+++ b/src/fontloader/misc/fontloader-fonts-cbk.lua
@@ -29,11 +29,28 @@ local kerning = node.kerning
local basepass = true
+local function l_warning() texio.write_nl("warning: node.ligaturing called directly") l_warning = nil end
+local function k_warning() texio.write_nl("warning: node.kerning called directly") k_warning = nil end
+
+function node.ligaturing(...)
+ if basepass and l_warning then
+ l_warning()
+ end
+ return ligaturing(...)
+end
+
+function node.kerning(...)
+ if basepass and k_warning then
+ k_warning()
+ end
+ return kerning(...)
+end
+
function nodes.handlers.setbasepass(v)
basepass = v
end
-function nodes.handlers.characters(head)
+function nodes.handlers.nodepass(head)
local fontdata = fonts.hashes.identifiers
if fontdata then
local usedfonts = { }
@@ -115,14 +132,27 @@ function nodes.handlers.characters(head)
end
end
-function nodes.simple_font_handler(head)
- -- lang.hyphenate(head)
- head = nodes.handlers.characters(head)
- nodes.injections.handler(head)
+function nodes.handlers.basepass(head)
if not basepass then
head = ligaturing(head)
head = kerning(head)
end
- nodes.handlers.protectglyphs(head)
- return head
+ return head, true
+end
+
+local nodepass = nodes.handlers.nodepass
+local basepass = nodes.handlers.basepass
+local injectpass = nodes.injections.handler
+local protectpass = nodes.handlers.protectglyphs
+
+function nodes.simple_font_handler(head)
+ if head then
+ head = nodepass(head)
+ head = injectpass(head)
+ head = basepass(head)
+ protectpass(head)
+ return head, true
+ else
+ return head, false
+ end
end