summaryrefslogtreecommitdiff
path: root/tex/generic/context/luatex/luatex-fonts-merged.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/generic/context/luatex/luatex-fonts-merged.lua')
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua31
1 files changed, 23 insertions, 8 deletions
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 99c22f268..6202ac04e 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 : 08/26/11 01:43:42
+-- merge date : 08/26/11 13:33:00
do -- begin closure to overcome local limits and interference
@@ -9058,17 +9058,29 @@ example, the following is valid:</p>
<p>Therefore we we don't really do the replacement here already unless we have the
single lookup case. The efficiency of the replacements can be improved by deleting
-as less as needed but that would also mke the code even more messy.</p>
+as less as needed but that would also make the code even more messy.</p>
--ldx]]--
local function delete_till_stop(start,stop,ignoremarks)
- if start ~= stop then
- -- todo keep marks
+ local n = 1
+ if start == stop then
+ -- done
+ elseif ignoremarks then
+ repeat -- start x x m x x stop => start m
+ local next = start.next
+ if not marks[next.char] then
+ delete_node(start,next)
+ end
+ n = n + 1
+ until next == stop
+ else -- start x x x stop => start
repeat
local next = start.next
delete_node(start,next)
+ n = n + 1
until next == stop
end
+ return n
end
--[[ldx--
@@ -9158,29 +9170,32 @@ end
function chainprocs.gsub_alternate(start,stop,kind,chainname,currentcontext,lookuphash,currentlookup,chainlookupname)
-- todo: marks ?
- delete_till_stop(start,stop)
+ local n = delete_till_stop(start,stop)
local current = start
local subtables = currentlookup.subtables
+ local m = 0
while current do
if current.id == glyph_code then
+ m = m + 1
local currentchar = current.char
local lookupname = subtables[1]
local alternatives = lookuphash[lookupname]
if not alternatives then
if trace_bugs then
- logwarning("%s: no alternative hits",cref(kind,chainname,chainlookupname,lookupname))
+ logwarning("%s: %s of %s, no alternative hit",cref(kind,chainname,chainlookupname,lookupname),m,n)
end
else
alternatives = alternatives[currentchar]
if not alternatives then
if trace_bugs then
- logwarning("%s: no alternative for %s",cref(kind,chainname,chainlookupname,lookupname),gref(currentchar))
+ logwarning("%s: %s of %s, no alternative for %s",cref(kind,chainname,chainlookupname,lookupname),m,n,gref(currentchar))
end
else
local choice, index = alternative_glyph(current,alternatives,kind,chainname,chainlookupname,lookupname)
current.char = choice
if trace_alternatives then
- logprocess("%s: replacing single %s by alternative %s (%s)",cref(kind,chainname,chainlookupname,lookupname),index,gref(currentchar),gref(choice),index)
+ logprocess("%s: %s of %s, replacing single %s by alternative %s (%s)",
+ cref(kind,chainname,chainlookupname,lookupname),m,n,index,gref(currentchar),gref(choice))
end
end
end