summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-letterspace.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luaotfload/luaotfload-letterspace.lua')
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-letterspace.lua27
1 files changed, 20 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-letterspace.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-letterspace.lua
index c89d89cfded..6cd8dcced36 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-letterspace.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-letterspace.lua
@@ -5,8 +5,8 @@
local ProvidesLuaModule = {
name = "luaotfload-letterspace",
- version = "2.96", --TAGVERSION
- date = "2019-02-14", --TAGDATE
+ version = "2.97", --TAGVERSION
+ date = "2019-05-18", --TAGDATE
description = "luaotfload submodule / color",
license = "GPL v2.0",
copyright = "PRAGMA ADE / ConTeXt Development Team",
@@ -76,12 +76,26 @@ local glyph_code = node.id"glyph"
local kern_code = node.id"kern"
local disc_code = node.id"disc"
local glue_code = node.id"glue"
+local whatsit_code = node.id"whatsit"
local fonthashes = fonts.hashes
local identifiers = fonthashes.identifiers
local chardata = fonthashes.characters
local otffeatures = fonts.constructors.newfeatures "otf"
+local function getprevreal(n)
+ repeat
+ n = getprev(n)
+ until not n or getid(n) ~= whatsit_code
+ return n
+end
+local function getnextreal(n)
+ repeat
+ n = getnext(n)
+ until not n or getid(n) ~= whatsit_code
+ return n
+end
+
--[[doc--
Since the letterspacing method was derived initially from Context’s
@@ -261,7 +275,7 @@ kerncharacters = function (head)
end -- kern ligature
--- 3) apply the extra kerning
- local prev = getprev(start)
+ local prev = getprevreal(start)
if prev then
local pid = getid(prev)
@@ -288,7 +302,7 @@ kerncharacters = function (head)
or prev_subtype == userkern_code --- attribute; we may need a test
then
- local pprev = getprev(prev)
+ local pprev = getprevreal(prev)
local pprev_id = getid(pprev)
if keeptogether
@@ -332,8 +346,8 @@ kerncharacters = function (head)
elseif pid == disc_code then
local disc = prev -- disc
local pre, post, replace = getdisc (disc)
- local prv = getprev(disc)
- local nxt = getnext(disc)
+ local prv = getprevreal(disc)
+ local nxt = getnextreal(disc)
if pre and prv then -- must pair with start.prev
-- this one happens in most cases
@@ -353,7 +367,6 @@ kerncharacters = function (head)
local tail = find_node_tail(post)
setnext(tail, after)
setprev(after, tail)
- setnext(after, nil)
post = kerncharacters (post)
setnext(getprev(after), nil)
setfield(disc, "post", post)