diff options
author | Philipp Gesang <phg@phi-gamma.net> | 2015-11-20 22:05:33 +0100 |
---|---|---|
committer | Philipp Gesang <phg@phi-gamma.net> | 2015-11-20 22:05:33 +0100 |
commit | 4256d04d076d788428d4a8eb9a316da9d52a1622 (patch) | |
tree | c7120bd4b8576c85022f936df0e72a40c71bae37 /src/fontloader/misc/fontloader-fonts-cbk.lua | |
parent | 7baac9244235ce00255a0f61c5931585aa99163c (diff) | |
parent | cf6c8c94cc88db6564ccea266b3c6d8f7a5bb1a1 (diff) | |
download | luaotfload-4256d04d076d788428d4a8eb9a316da9d52a1622.tar.gz |
Merge pull request #291 from phi-gamma/master
pluggable fontloaders
Diffstat (limited to 'src/fontloader/misc/fontloader-fonts-cbk.lua')
-rw-r--r-- | src/fontloader/misc/fontloader-fonts-cbk.lua | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/src/fontloader/misc/fontloader-fonts-cbk.lua b/src/fontloader/misc/fontloader-fonts-cbk.lua index 81b5b6e..9da8151 100644 --- a/src/fontloader/misc/fontloader-fonts-cbk.lua +++ b/src/fontloader/misc/fontloader-fonts-cbk.lua @@ -160,12 +160,31 @@ function nodes.handlers.nodepass(head) local range = basefonts[i] local start = range[1] local stop = range[2] - if stop then - start, stop = ligaturing(start,stop) - start, stop = kerning(start,stop) - elseif start then - start = ligaturing(start) - start = kerning(start) + -- maybe even: if start and start ~= stop then + if start or stop then + local prev = nil + local next = nil + local front = start == head + if stop then + next = stop.next + start, stop = ligaturing(start,stop) + start, stop = kerning(start,stop) + elseif start then + prev = start.prev + start = ligaturing(start) + start = kerning(start) + end + if prev then + start.prev = prev + prev.next = start + end + if next then + stop.next = next + next.prev = stop + end + if front then + head = start + end end end end @@ -176,7 +195,7 @@ function nodes.handlers.nodepass(head) end function nodes.handlers.basepass(head) - if not basepass then + if basepass then head = ligaturing(head) head = kerning(head) end |