diff options
author | Hans Hagen <pragma@wxs.nl> | 2016-12-21 20:09:16 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-12-21 20:09:16 +0100 |
commit | 72e032447232f3f89056f352d3f6b8e2abc499cb (patch) | |
tree | dcce6719b22076c68a286ac202ea4245999c0843 /tex/context/base/mkiv/font-nod.lua | |
parent | ae375264381ae74f70415b2351bdbf209248e1af (diff) | |
download | context-72e032447232f3f89056f352d3f6b8e2abc499cb.tar.gz |
2016-12-21 18:57:00
Diffstat (limited to 'tex/context/base/mkiv/font-nod.lua')
-rw-r--r-- | tex/context/base/mkiv/font-nod.lua | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tex/context/base/mkiv/font-nod.lua b/tex/context/base/mkiv/font-nod.lua index 519a5c478..41fc215b1 100644 --- a/tex/context/base/mkiv/font-nod.lua +++ b/tex/context/base/mkiv/font-nod.lua @@ -469,16 +469,16 @@ end -- -local threshold = 65536 +local threshold = 65536 -- 1pt -local function toutf(list,result,nofresult,stopcriterium) +local function toutf(list,result,nofresult,stopcriterium,nostrip) if list then for n in traverse_nodes(tonut(list)) do local c, id = isglyph(n) if c then local components = getfield(n,"components") if components then - result, nofresult = toutf(components,result,nofresult) + result, nofresult = toutf(components,result,nofresult,false,true) elseif c > 0 then local fc = fontcharacters[getfont(n)] if fc then @@ -510,20 +510,20 @@ local function toutf(list,result,nofresult,stopcriterium) result[nofresult] = f_badcode(c) end elseif id == disc_code then - result, nofresult = toutf(getfield(n,"replace"),result,nofresult) -- needed? + result, nofresult = toutf(getfield(n,"replace"),result,nofresult,false,true) -- needed? elseif id == hlist_code or id == vlist_code then -- if nofresult > 0 and result[nofresult] ~= " " then -- nofresult = nofresult + 1 -- result[nofresult] = " " -- end - result, nofresult = toutf(getlist(n),result,nofresult) + result, nofresult = toutf(getlist(n),result,nofresult,false,true) elseif id == glue_code then - if nofresult > 0 and result[nofresult] ~= " " then + if nofresult > 0 and result[nofresult] ~= " " and getfield(n,"width") > threshold then nofresult = nofresult + 1 result[nofresult] = " " end - elseif id == kern_code and getfield(n,"kern") > threshold then - if nofresult > 0 and result[nofresult] ~= " " then + elseif id == kern_code then + if nofresult > 0 and result[nofresult] ~= " " and getfield(n,"kern") > threshold then nofresult = nofresult + 1 result[nofresult] = " " end @@ -533,7 +533,7 @@ local function toutf(list,result,nofresult,stopcriterium) end end end - if nofresult > 0 and result[nofresult] == " " then + if not nostrip and nofresult > 0 and result[nofresult] == " " then result[nofresult] = nil nofresult = nofresult - 1 end |