From cf4c4c56e5748e91ecc28f8126f5fc6eadfd73fa Mon Sep 17 00:00:00 2001 From: Context Git Mirror Bot Date: Fri, 4 Sep 2015 11:15:09 +0200 Subject: 2015-09-04 11:02:00 --- tex/generic/context/luatex/luatex-fonts-inj.lua | 16 +++++++++--- tex/generic/context/luatex/luatex-fonts-merged.lua | 30 +++++++++++++++++++--- 2 files changed, 39 insertions(+), 7 deletions(-) (limited to 'tex/generic') diff --git a/tex/generic/context/luatex/luatex-fonts-inj.lua b/tex/generic/context/luatex/luatex-fonts-inj.lua index cdf14b935..10108a271 100644 --- a/tex/generic/context/luatex/luatex-fonts-inj.lua +++ b/tex/generic/context/luatex/luatex-fonts-inj.lua @@ -549,9 +549,19 @@ local function inject_marks(marks,marki,nofmarks) else -- kern(x) glyph(p) kern(w-x) mark(n) -- ox = px - getfield(p,"width") + pn.markx - pp.leftkern - local leftkern = pp.leftkern - if leftkern then - ox = px - pn.markx - leftkern + -- + -- According to Kai we don't need to handle leftkern here but I'm + -- pretty sure I've run into a case where it was needed so maybe + -- some day we need something more clever here. + -- + if false then + -- a mark with kerning + local leftkern = pp.leftkern + if leftkern then + ox = px - pn.markx - leftkern + else + ox = px - pn.markx + end else ox = px - pn.markx end diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index da21fa6d8..7d3e981fe 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 09/01/15 11:10:11 +-- merge date : 09/04/15 11:00:13 do -- begin closure to overcome local limits and interference @@ -9496,6 +9496,22 @@ function otf.getmultiple(tfmdata,k,kind) end return { k } end +function otf.getkern(tfmdata,left,right,kind) + local kerns=getgsub(tfmdata,left,kind or "kern",true) + if kerns then + local found=kerns[right] + local kind=type(found) + if kind=="table" then + found=found[1][3] + elseif kind~="number" then + found=false + end + if found then + return found*tfmdata.parameters.factor + end + end + return 0 +end end -- closure @@ -10572,9 +10588,15 @@ local function inject_marks(marks,marki,nofmarks) if pn.markdir<0 then ox=px-pn.markx-rightkern else - local leftkern=pp.leftkern - if leftkern then - ox=px-pn.markx-leftkern + + + if false then + local leftkern=pp.leftkern + if leftkern then + ox=px-pn.markx-leftkern + else + ox=px-pn.markx + end else ox=px-pn.markx end -- cgit v1.2.3