summaryrefslogtreecommitdiff
path: root/tex/context/base/mkxl/typo-krn.lmt
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkxl/typo-krn.lmt')
-rw-r--r--tex/context/base/mkxl/typo-krn.lmt58
1 files changed, 29 insertions, 29 deletions
diff --git a/tex/context/base/mkxl/typo-krn.lmt b/tex/context/base/mkxl/typo-krn.lmt
index bfd50062d..65068d897 100644
--- a/tex/context/base/mkxl/typo-krn.lmt
+++ b/tex/context/base/mkxl/typo-krn.lmt
@@ -220,22 +220,7 @@ end
local function inject_begin(boundary,prev,keeptogether,krn,ok) -- prev is a glyph
local char, id = isglyph(boundary)
- if id == kern_code then
- if getsubtype(boundary) == fontkern_code then
- local inject = true
- if keeptogether then
- local next = getnext(boundary)
- if not next or (getid(next) == glyph_code and keeptogether(prev,next)) then
- inject = false
- end
- end
- if inject then
- -- not yet ok, as injected kerns can be overlays (from node-inj.lua)
- setkern(boundary,getkern(boundary) + quaddata[getfont(prev)]*krn,userkern_code)
- return boundary, true
- end
- end
- elseif char then
+ if char then
if keeptogether and keeptogether(boundary,prev) then
-- keep 'm
else
@@ -249,29 +234,29 @@ local function inject_begin(boundary,prev,keeptogether,krn,ok) -- prev is a glyp
return kern, true
end
end
- end
- return boundary, ok
-end
-
-local function inject_end(boundary,next,keeptogether,krn,ok)
- local tail = find_node_tail(boundary)
- local char, id = isglyph(tail)
- if id == kern_code then
- if getsubtype(tail) == fontkern_code then
+ elseif id == kern_code then
+ if getsubtype(boundary) == fontkern_code then
local inject = true
if keeptogether then
- local prev = getprev(tail)
- if getid(prev) == glyph_code and keeptogether(prev,two) then
+ local next = getnext(boundary)
+ if not next or (getid(next) == glyph_code and keeptogether(prev,next)) then
inject = false
end
end
if inject then
-- not yet ok, as injected kerns can be overlays (from node-inj.lua)
- setkern(tail,getkern(tail) + quaddata[getfont(next)]*krn,userkern_code)
+ setkern(boundary,getkern(boundary) + quaddata[getfont(prev)]*krn,userkern_code)
return boundary, true
end
end
- elseif char then
+ end
+ return boundary, ok
+end
+
+local function inject_end(boundary,next,keeptogether,krn,ok)
+ local tail = find_node_tail(boundary)
+ local char, id = isglyph(tail)
+ if char then
if keeptogether and keeptogether(tail,two) then
-- keep 'm
else
@@ -285,6 +270,21 @@ local function inject_end(boundary,next,keeptogether,krn,ok)
return boundary, true
end
end
+ elseif id == kern_code then
+ if getsubtype(tail) == fontkern_code then
+ local inject = true
+ if keeptogether then
+ local prev = getprev(tail)
+ if getid(prev) == glyph_code and keeptogether(prev,two) then
+ inject = false
+ end
+ end
+ if inject then
+ -- not yet ok, as injected kerns can be overlays (from node-inj.lua)
+ setkern(tail,getkern(tail) + quaddata[getfont(next)]*krn,userkern_code)
+ return boundary, true
+ end
+ end
end
return boundary, ok
end