summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2010-10-06 15:53:25 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2010-10-06 15:59:45 +0200
commitbe40844cfd078c8ec6b7ace73185a318e6d47840 (patch)
tree414aead836335370f3d76a28e58abce34ffbd4c0
parente05cbf8d7d512840e943bb62875a104d46c37701 (diff)
downloadluaotfload-be40844cfd078c8ec6b7ace73185a318e6d47840.tar.gz
Fix GPOS mark placement for LTR text
Fix by Hans. fixes #18
-rw-r--r--otfl-node-inj.lua18
-rw-r--r--tests/marks.tex4
2 files changed, 16 insertions, 6 deletions
diff --git a/otfl-node-inj.lua b/otfl-node-inj.lua
index 5b55c8c..fdea7f1 100644
--- a/otfl-node-inj.lua
+++ b/otfl-node-inj.lua
@@ -115,7 +115,7 @@ function nodes.set_mark(start,base,factor,rlmode,ba,ma,index) --ba=baseanchor, m
set_attribute(base,markbase,bound)
set_attribute(start,markmark,bound)
set_attribute(start,markdone,index)
- marks[bound] = { [index] = { dx, dy } }
+ marks[bound] = { [index] = { dx, dy, rlmode } }
return dx, dy, bound
end
@@ -314,17 +314,23 @@ function nodes.inject_kerns(head,where,keep)
local index = has_attribute(n,markdone) or 1
local d = mrks[index]
if d then
- -- local rlmode = d[3] -- not used
- -- if rlmode and rlmode > 0 then
- -- todo
- -- else
+ local rlmode = d[3]
+ if rlmode and rlmode > 0 then
+ -- new per 2010-10-06
+ local k = wx[p]
+ if k then -- maybe (d[1] - p.width) and/or + k[2]
+ n.xoffset = p.xoffset - (p.width - d[1]) - k[2]
+ else
+ n.xoffset = p.xoffset - (p.width - d[1])
+ end
+ else
local k = wx[p]
if k then
n.xoffset = p.xoffset - d[1] - k[2]
else
n.xoffset = p.xoffset - d[1]
end
- -- end
+ end
if mk[p] then
n.yoffset = p.yoffset + d[2]
else
diff --git a/tests/marks.tex b/tests/marks.tex
new file mode 100644
index 0000000..9e7755e
--- /dev/null
+++ b/tests/marks.tex
@@ -0,0 +1,4 @@
+\input luaotfload.sty
+\font\test={file:GenBasR.ttf:script=latn}
+\test ä\quad Ä
+\bye