summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ots.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ots.lua')
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ots.lua45
1 files changed, 24 insertions, 21 deletions
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ots.lua b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ots.lua
index 4d011a93471..24a8688875f 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ots.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ots.lua
@@ -185,8 +185,6 @@ local setprev = nuts.setprev
local getboth = nuts.getboth
local setboth = nuts.setboth
local getid = nuts.getid
-local getattr = nuts.getattr
-local setattr = nuts.setattr
local getprop = nuts.getprop
local setprop = nuts.setprop
local getsubtype = nuts.getsubtype
@@ -199,8 +197,11 @@ local setlink = nuts.setlink
local getcomponents = nuts.getcomponents -- the original one, not yet node-aux
local setcomponents = nuts.setcomponents -- the original one, not yet node-aux
local getwidth = nuts.getwidth
+local getattr = nuts.getattr
+
+local getglyphdata = nuts.getglyphdata
-local ischar = nuts.is_char
+local ischar = nuts.ischar
local isglyph = nuts.isglyph
local usesfont = nuts.uses_font
@@ -829,7 +830,7 @@ function handlers.gsub_ligature(head,start,dataset,sequence,ligature,rlmode,skip
end
end
if not match and not pre or not replace then
- local n = getnext(discfound)
+ local n = getnext(discfound)
local char = ischar(n,currentfont)
if char and ligature[char] then
match = true
@@ -841,8 +842,8 @@ function handlers.gsub_ligature(head,start,dataset,sequence,ligature,rlmode,skip
local prev = getprev(start)
if stop then
setnext(stop)
- local tail = getprev(stop)
local copy = copy_node_list(start)
+ local tail = stop -- was: getprev(stop) -- Kai: needs checking on your samples
local liat = find_node_tail(copy)
if pre then
setlink(liat,pre)
@@ -939,7 +940,8 @@ function handlers.gpos_pair(head,start,dataset,sequence,kerns,rlmode,skiphash,st
end
local format = step.format
if format == "pair" then
- local a, b = krn[1], krn[2]
+ local a = krn[1]
+ local b = krn[2]
if a == true then
-- zero
elseif a then -- #a > 0
@@ -1559,7 +1561,8 @@ function chainprocs.gpos_pair(head,start,stop,dataset,sequence,currentlookup,rlm
end
local format = currentlookup.format
if format == "pair" then
- local a, b = krn[1], krn[2]
+ local a = krn[1]
+ local b = krn[2]
if a == true then
-- zero
elseif a then
@@ -3192,7 +3195,7 @@ local function testrun(disc,t_run,c_run,...)
local d = d_replace > d_post and d_replace or d_post
local head = getnext(disc) -- is: next
local tail = head
- for i=2,d do -- must start at 2 according to Kai
+ for i=2,d do -- must start at 2 according to Kai
local nx = getnext(tail)
local id = getid(nx)
if id == disc_code then
@@ -3289,7 +3292,7 @@ end
-- discretionaries (maybe we need to tag those some day). So, at least for now, we don't
-- have the following test in the sub runs:
--
--- -- local a = getattr(start,0)
+-- -- local a = getglyhpdata(start)
-- -- if a then
-- -- a = (a == attr) and (not attribute or getprop(start,a_state) == attribute)
-- -- else
@@ -3299,7 +3302,7 @@ end
--
-- but use this instead:
--
--- -- local a = getattr(start,0)
+-- -- local a = getglyphdata(start)
-- -- if not a or (a == attr) then
--
-- and even that one is probably not needed. However, we can handle interesting
@@ -3325,7 +3328,7 @@ local function c_run_single(head,font,attr,lookupcache,step,dataset,sequence,rlm
if char then
local a -- happens often so no assignment is faster
if attr then
- a = getattr(start,0)
+ a = getglyphdata(start)
end
if not a or (a == attr) then
local lookupmatch = lookupcache[char]
@@ -3365,7 +3368,7 @@ local function t_run_single(start,stop,font,attr,lookupcache)
if char then
local a -- happens often so no assignment is faster
if attr then
- a = getattr(start,0)
+ a = getglyphdata(start)
end
local startnext = getnext(start)
if not a or (a == attr) then
@@ -3449,7 +3452,7 @@ end
local function k_run_single(sub,injection,last,font,attr,lookupcache,step,dataset,sequence,rlmode,skiphash,handler)
local a -- happens often so no assignment is faster
if attr then
- a = getattr(sub,0)
+ a = getglyphdata(sub)
end
if not a or (a == attr) then
for n in nextnode, sub do -- only gpos
@@ -3485,7 +3488,7 @@ local function c_run_multiple(head,font,attr,steps,nofsteps,dataset,sequence,rlm
if char then
local a -- happens often so no assignment is faster
if attr then
- a = getattr(start,0)
+ a = getglyphdata(start)
end
if not a or (a == attr) then
for i=1,nofsteps do
@@ -3533,7 +3536,7 @@ local function t_run_multiple(start,stop,font,attr,steps,nofsteps)
if char then
local a -- happens often so no assignment is faster
if attr then
- a = getattr(start,0)
+ a = getglyphdata(start)
end
local startnext = getnext(start)
if not a or (a == attr) then
@@ -3614,7 +3617,7 @@ end
local function k_run_multiple(sub,injection,last,font,attr,steps,nofsteps,dataset,sequence,rlmode,skiphash,handler)
local a -- happens often so no assignment is faster
if attr then
- a = getattr(sub,0)
+ a = getglyphdata(sub)
end
if not a or (a == attr) then
for n in nextnode, sub do -- only gpos
@@ -3707,7 +3710,7 @@ do
-- reference:
--
- -- local a = attr and getattr(start,0)
+ -- local a = attr and getglyphdata(start)
-- if a then
-- a = (a == attr) and (not attribute or getprop(start,a_state) == attribute)
-- else
@@ -3718,7 +3721,7 @@ do
--
-- local a -- happens often so no assignment is faster
-- if attr then
- -- if getattr(start,0) == attr and (not attribute or getprop(start,a_state) == attribute) then
+ -- if getglyphdata(start) == attr and (not attribute or getprop(start,a_state) == attribute) then
-- a = true
-- end
-- elseif not attribute or getprop(start,a_state) == attribute then
@@ -3858,7 +3861,7 @@ do
if m then
local a -- happens often so no assignment is faster
if attr then
- a = getattr(start,0)
+ a = getglyphdata(start)
end
if not a or (a == attr) then
for i=m[1],m[2] do
@@ -3905,7 +3908,7 @@ do
if lookupmatch then
local a -- happens often so no assignment is faster
if attr then
- if getattr(start,0) == attr and (not attribute or getprop(start,a_state) == attribute) then
+ if getglyphdata(start) == attr and (not attribute or getprop(start,a_state) == attribute) then
a = true
end
elseif not attribute or getprop(start,a_state) == attribute then
@@ -3972,7 +3975,7 @@ do
if m then
local a -- happens often so no assignment is faster
if attr then
- if getattr(start,0) == attr and (not attribute or getprop(start,a_state) == attribute) then
+ if getglyphdata(start) == attr and (not attribute or getprop(start,a_state) == attribute) then
a = true
end
elseif not attribute or getprop(start,a_state) == attribute then