summaryrefslogtreecommitdiff
path: root/luaotfload-merged.lua
diff options
context:
space:
mode:
authorElie Roux <elie.roux@telecom-bretagne.eu>2013-04-29 15:42:56 +0200
committerElie Roux <elie.roux@telecom-bretagne.eu>2013-04-29 15:42:56 +0200
commit1d871e6152c1acfa01db6fd90ee809274b9f8751 (patch)
tree94e152a8442ca68434c3b99a59e4844443c9b70b /luaotfload-merged.lua
parentb297c2876fe1578cf621f42ee18910a2ccaa6cb7 (diff)
downloadluaotfload-1d871e6152c1acfa01db6fd90ee809274b9f8751.tar.gz
Merging pull request #18
Diffstat (limited to 'luaotfload-merged.lua')
-rw-r--r--luaotfload-merged.lua65
1 files changed, 47 insertions, 18 deletions
diff --git a/luaotfload-merged.lua b/luaotfload-merged.lua
index da5e35a..0cf2ce4 100644
--- a/luaotfload-merged.lua
+++ b/luaotfload-merged.lua
@@ -1,6 +1,6 @@
-- merged file : luatex-fonts-merged.lua
-- parent file : luatex-fonts.lua
--- merge date : 04/24/13 13:39:43
+-- merge date : 04/26/13 15:13:48
do -- begin closure to overcome local limits and interference
@@ -7412,6 +7412,7 @@ nodes.injections=nodes.injections or {}
local injections=nodes.injections
local nodecodes=nodes.nodecodes
local glyph_code=nodecodes.glyph
+local kern_code=nodecodes.kern
local nodepool=nodes.pool
local newkern=nodepool.kern
local traverse_id=node.traverse_id
@@ -7505,7 +7506,7 @@ local function trace(head)
local cb=n[a_cursbase]
local cc=n[a_curscurs]
local char=n.char
- report_injections("font %s, char %U, glyph %c",char,n.font,char)
+ report_injections("font %s, char %U, glyph %c",n.font,char,char)
if kp then
local k=kerns[kp]
if k[3] then
@@ -7542,6 +7543,24 @@ local function trace(head)
end
report_injections("end run")
end
+local function show_result(head)
+ local current=head
+ local skipping=false
+ while current do
+ local id=current.id
+ if id==glyph_code then
+ report_injections("char: %C, width %p, xoffset %p, yoffset %p",current.char,current.width,current.xoffset,current.yoffset)
+ skipping=false
+ elseif id==kern_code then
+ report_injections("kern: %p",current.kern)
+ skipping=false
+ elseif not skipping then
+ report_injections()
+ skipping=true
+ end
+ current=current.next
+ end
+end
function injections.handler(head,where,keep)
local has_marks,has_cursives,has_kerns=next(marks),next(cursives),next(kerns)
if has_marks or has_cursives then
@@ -7680,17 +7699,26 @@ function injections.handler(head,where,keep)
local d=mrks[index]
if d then
local rlmode=d[3]
- if rlmode and rlmode>=0 then
- local k=wx[p]
- if k then
- n.xoffset=p.xoffset-p.width+d[1]-k[2]
+ local k=wx[p]
+ if k then
+ local x=k[2]
+ local w=k[4]
+ if w then
+ if rlmode and rlmode>=0 then
+ n.xoffset=p.xoffset-p.width+d[1]-(w-x)
+ else
+ n.xoffset=p.xoffset-d[1]-x
+ end
else
- n.xoffset=p.xoffset-p.width+d[1]
+ if rlmode and rlmode>=0 then
+ n.xoffset=p.xoffset-p.width+d[1]
+ else
+ n.xoffset=p.xoffset-d[1]-x
+ end
end
else
- local k=wx[p]
- if k then
- n.xoffset=p.xoffset-d[1]-k[2]
+ if rlmode and rlmode>=0 then
+ n.xoffset=p.xoffset-p.width+d[1]
else
n.xoffset=p.xoffset-d[1]
end
@@ -7717,27 +7745,28 @@ function injections.handler(head,where,keep)
end
if next(wx) then
for n,k in next,wx do
- local x,w=k[2] or 0,k[4]
+ local x=k[2]
+ local w=k[4]
if w then
local rl=k[1]
local wx=w-x
if rl<0 then
if wx~=0 then
- insert_node_before(head,n,newkern(wx))
+ insert_node_before(head,n,newkern(wx))
end
if x~=0 then
- insert_node_after (head,n,newkern(x))
+ insert_node_after (head,n,newkern(x))
end
else
if x~=0 then
- insert_node_before(head,n,newkern(x))
+ insert_node_before(head,n,newkern(x))
end
if wx~=0 then
- insert_node_after(head,n,newkern(wx))
+ insert_node_after (head,n,newkern(wx))
end
end
elseif x~=0 then
- insert_node_before(head,n,newkern(x))
+ insert_node_before(head,n,newkern(x))
end
end
end
@@ -7746,9 +7775,9 @@ function injections.handler(head,where,keep)
if k~=0 then
local rln=rl[n]
if rln and rln<0 then
- insert_node_before(head,n,newkern(-k))
+ insert_node_before(head,n,newkern(-k))
else
- insert_node_before(head,n,newkern(k))
+ insert_node_before(head,n,newkern(k))
end
end
end