diff options
| author | Philipp Gesang <phg42.2a@gmail.com> | 2014-12-22 17:24:25 +0100 | 
|---|---|---|
| committer | Philipp Gesang <phg42.2a@gmail.com> | 2014-12-22 17:24:25 +0100 | 
| commit | b966e35c9df3cca2a25baaf68574d0b8d94eef39 (patch) | |
| tree | 299468068c249d5e8edf663687b3d17c35bc342c /src/fontloader/misc/fontloader-fonts-cbk.lua | |
| parent | 747e6fb2c41045add6a799498026ff0d2ddf115b (diff) | |
| parent | 3a5009d6feedc1a4c4e5a8d61c7e67b9c35399fa (diff) | |
| download | luaotfload-b966e35c9df3cca2a25baaf68574d0b8d94eef39.tar.gz | |
Merge pull request #262 from phi-gamma/master
[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.lua | 44 | 
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 | 
