summaryrefslogtreecommitdiff
path: root/tex/context/base/node-fnt.lua
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2015-03-09 20:15:05 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2015-03-09 20:15:05 +0100
commitdc98ffdc842271d05903846b460fab90d4d83739 (patch)
tree49603cd805408ebdde3a7eafc59c40279dc7e9ad /tex/context/base/node-fnt.lua
parent08128a9710f7a34e16f7487b3bccfe7feadb36f1 (diff)
downloadcontext-dc98ffdc842271d05903846b460fab90d4d83739.tar.gz
2015-03-09 19:29:00
Diffstat (limited to 'tex/context/base/node-fnt.lua')
-rw-r--r--tex/context/base/node-fnt.lua36
1 files changed, 26 insertions, 10 deletions
diff --git a/tex/context/base/node-fnt.lua b/tex/context/base/node-fnt.lua
index 1dd944403..774a68718 100644
--- a/tex/context/base/node-fnt.lua
+++ b/tex/context/base/node-fnt.lua
@@ -319,28 +319,44 @@ function handlers.characters(head)
-- skip
elseif b == 1 then
-- only one font
+ local front = head == start
local range = basefonts[1]
- local start, stop = range[1], range[2]
+ local start = range[1]
+ local stop = range[2]
if stop then
- ligaturing(start,stop)
- kerning(start,stop)
+ start, stop = ligaturing(start,stop)
+ start, stop = kerning(start,stop)
+ elseif start then -- safeguard
+ start = ligaturing(start)
+ start = kerning(start)
else
- ligaturing(start)
- kerning(start)
+ -- something bad happened
+ end
+ if front then
+ -- shouldn't happen
+ head = start
end
else
-- multiple fonts
+ local front = head == start
for i=1,b do
local range = basefonts[i]
- local start, stop = range[1], range[2]
+ local start = range[1]
+ local stop = range[2]
if stop then
- ligaturing(start,stop)
- kerning(start,stop)
+ start, stop = ligaturing(start,stop)
+ start, stop = kerning(start,stop)
+ elseif start then -- safeguard
+ start = ligaturing(start)
+ start = kerning(start)
else
- ligaturing(start)
- kerning(start)
+ -- something bad happened
end
end
+ if front then
+ -- shouldn't happen
+ head = start
+ end
end
stoptiming(nodes)
if trace_characters then