From 817e18d3f6969b1b50b4883ec4d5bb05c985db88 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Fri, 4 Aug 2017 09:53:17 +0200 Subject: 2017-08-04 09:46:00 --- tex/generic/context/luatex/luatex-fonts-merged.lua | 216 +++++++++++---------- 1 file changed, 114 insertions(+), 102 deletions(-) (limited to 'tex/generic') diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 4e0a15bd3..c1bbcd2d0 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 : c:/data/develop/context/sources/luatex-fonts-merged.lua -- parent file : c:/data/develop/context/sources/luatex-fonts.lua --- merge date : 08/03/17 11:02:54 +-- merge date : 08/04/17 09:40:52 do -- begin closure to overcome local limits and interference @@ -19501,8 +19501,14 @@ local function mergesteps(t,k) return merged end end +local function checkmerge(sequence) + local steps=sequence.steps + if steps then + setmetatableindex(steps,mergesteps) + end +end local function checkflags(sequence,resources) - if not sequence.skipsome then + if not sequence.skiphash then local flags=sequence.flags if flags then local skipmark=flags[1] @@ -19511,23 +19517,32 @@ local function checkflags(sequence,resources) local markclass=sequence.markclass local skipsome=skipmark or skipligature or skipbase or markclass or false if skipsome then - sequence.skipsome=setmetatableindex(function(t,k) + sequence.skiphash=setmetatableindex(function(t,k) local c=resources.classes[k] local v=c==skipmark or (markclass and c=="mark" and not markclass[k]) or c==skipligature or c==skipbase t[k]=v or false return v end) else - sequence.skipsome=false + sequence.skiphash=false end else - sequence.skipsome=false + sequence.skiphash=false + end + end +end +local function checksteps(sequence) + local steps=sequence.steps + if steps then + for i=1,#steps do + steps[i].index=i end end end if fonts.helpers then - fonts.helpers.mergesteps=mergesteps + fonts.helpers.checkmerge=checkmerge fonts.helpers.checkflags=checkflags + fonts.helpers.checksteps=checksteps end function readers.expand(data) if not data or data.expanded then @@ -19574,7 +19589,6 @@ function readers.expand(data) local steps=sequence.steps if steps then local nofsteps=sequence.nofsteps - setmetatableindex(steps,mergesteps) local kind=sequence.type local markclass=sequence.markclass if markclass then @@ -19585,7 +19599,9 @@ function readers.expand(data) sequence.markclass=markclasses[markclass] end end + checkmerge(sequence) checkflags(sequence,resources) + checksteps(sequence) for i=1,nofsteps do local step=steps[i] local baseclasses=step.baseclasses @@ -19715,7 +19731,7 @@ local trace_defining=false registertracker("fonts.defining",function(v) trace_de local report_otf=logs.reporter("fonts","otf loading") local fonts=fonts local otf=fonts.handlers.otf -otf.version=3.101 +otf.version=3.102 otf.cache=containers.define("fonts","otl",otf.version,true) otf.svgcache=containers.define("fonts","svg",otf.version,true) otf.sbixcache=containers.define("fonts","sbix",otf.version,true) @@ -21676,6 +21692,9 @@ local function inject_everything(head,where) if rightkern then if pn.markdir<0 then ox=px-pn.markx-rightkern +if not pn.markmark then + ox=ox+(pn.leftkern or 0) +end else if false then local leftkern=pp.leftkern @@ -23067,7 +23086,7 @@ function handlers.gsub_single(head,start,dataset,sequence,replacement) setchar(start,replacement) return head,start,true end -function handlers.gsub_alternate(head,start,dataset,sequence,alternative) +function handlers.gsub_alternate(head,start,dataset,sequence,alternative,rlmode,skiphash) local kind=dataset[4] local what=dataset[1] local value=what==true and tfmdata.shared.features[kind] or what @@ -23085,13 +23104,13 @@ function handlers.gsub_alternate(head,start,dataset,sequence,alternative) end return head,start,true end -function handlers.gsub_multiple(head,start,dataset,sequence,multiple) +function handlers.gsub_multiple(head,start,dataset,sequence,multiple,rlmode,skiphash) if trace_multiples then logprocess("%s: replacing %s by multiple %s",pref(dataset,sequence),gref(getchar(start)),gref(multiple)) end return multiple_glyphs(head,start,multiple,sequence.flags[1],dataset[1]) end -function handlers.gsub_ligature(head,start,dataset,sequence,ligature) +function handlers.gsub_ligature(head,start,dataset,sequence,ligature,rlmode,skiphash) local current=getnext(start) if not current then return head,start,false,nil @@ -23201,7 +23220,7 @@ function handlers.gsub_ligature(head,start,dataset,sequence,ligature) end return head,start,false,discfound end -function handlers.gpos_single(head,start,dataset,sequence,kerns,rlmode,step,i,injection) +function handlers.gpos_single(head,start,dataset,sequence,kerns,rlmode,skiphash,step,injection) local startchar=getchar(start) local format=step.format if format=="single" or type(kerns)=="table" then @@ -23217,7 +23236,7 @@ function handlers.gpos_single(head,start,dataset,sequence,kerns,rlmode,step,i,in end return head,start,false end -function handlers.gpos_pair(head,start,dataset,sequence,kerns,rlmode,step,i,injection) +function handlers.gpos_pair(head,start,dataset,sequence,kerns,rlmode,skiphash,step,injection) local snext=getnext(start) if not snext then return head,start,false @@ -23275,7 +23294,7 @@ function handlers.gpos_pair(head,start,dataset,sequence,kerns,rlmode,step,i,inje return head,start,false end end -function handlers.gpos_mark2base(head,start,dataset,sequence,markanchors,rlmode) +function handlers.gpos_mark2base(head,start,dataset,sequence,markanchors,rlmode,skiphash) local markchar=getchar(start) if marks[markchar] then local base=getprev(start) @@ -23328,7 +23347,7 @@ function handlers.gpos_mark2base(head,start,dataset,sequence,markanchors,rlmode) end return head,start,false end -function handlers.gpos_mark2ligature(head,start,dataset,sequence,markanchors,rlmode) +function handlers.gpos_mark2ligature(head,start,dataset,sequence,markanchors,rlmode,skiphash) local markchar=getchar(start) if marks[markchar] then local base=getprev(start) @@ -23391,7 +23410,7 @@ function handlers.gpos_mark2ligature(head,start,dataset,sequence,markanchors,rlm end return head,start,false end -function handlers.gpos_mark2mark(head,start,dataset,sequence,markanchors,rlmode) +function handlers.gpos_mark2mark(head,start,dataset,sequence,markanchors,rlmode,skiphash) local markchar=getchar(start) if marks[markchar] then local base=getprev(start) @@ -23426,7 +23445,7 @@ function handlers.gpos_mark2mark(head,start,dataset,sequence,markanchors,rlmode) end return head,start,false end -function handlers.gpos_cursive(head,start,dataset,sequence,exitanchors,rlmode,step,i) +function handlers.gpos_cursive(head,start,dataset,sequence,exitanchors,rlmode,skiphash,step) local startchar=getchar(start) if marks[startchar] then if trace_cursive then @@ -23476,7 +23495,7 @@ local function logprocess(...) report_chain(...) end local logwarning=report_chain -local function reversesub(head,start,stop,dataset,sequence,replacements,rlmode) +local function reversesub(head,start,stop,dataset,sequence,replacements,rlmode,skiphash) local char=getchar(start) local replacement=replacements[char] if replacement then @@ -23497,7 +23516,7 @@ end local function reportmoresteps(dataset,sequence) logwarning("%s: more than 1 step",cref(dataset,sequence)) end -function chainprocs.gsub_single(head,start,stop,dataset,sequence,currentlookup,chainindex) +function chainprocs.gsub_single(head,start,stop,dataset,sequence,currentlookup,rlmode,skiphash,chainindex) local steps=currentlookup.steps local nofsteps=currentlookup.nofsteps if nofsteps>1 then @@ -23681,7 +23700,7 @@ function chainprocs.gsub_ligature(head,start,stop,dataset,sequence,currentlookup end return head,start,false,0,false end -function chainprocs.gpos_single(head,start,stop,dataset,sequence,currentlookup,rlmode,chainindex) +function chainprocs.gpos_single(head,start,stop,dataset,sequence,currentlookup,rlmode,skiphash,chainindex) local steps=currentlookup.steps local nofsteps=currentlookup.nofsteps if nofsteps>1 then @@ -23711,7 +23730,7 @@ function chainprocs.gpos_single(head,start,stop,dataset,sequence,currentlookup,r end return head,start,false end -function chainprocs.gpos_pair(head,start,stop,dataset,sequence,currentlookup,rlmode,chainindex) +function chainprocs.gpos_pair(head,start,stop,dataset,sequence,currentlookup,rlmode,skiphash,chainindex) local steps=currentlookup.steps local nofsteps=currentlookup.nofsteps if nofsteps>1 then @@ -23780,7 +23799,7 @@ function chainprocs.gpos_pair(head,start,stop,dataset,sequence,currentlookup,rlm end return head,start,false end -function chainprocs.gpos_mark2base(head,start,stop,dataset,sequence,currentlookup,rlmode) +function chainprocs.gpos_mark2base(head,start,stop,dataset,sequence,currentlookup,rlmode,skiphash) local steps=currentlookup.steps local nofsteps=currentlookup.nofsteps if nofsteps>1 then @@ -23847,7 +23866,7 @@ function chainprocs.gpos_mark2base(head,start,stop,dataset,sequence,currentlooku end return head,start,false end -function chainprocs.gpos_mark2ligature(head,start,stop,dataset,sequence,currentlookup,rlmode) +function chainprocs.gpos_mark2ligature(head,start,stop,dataset,sequence,currentlookup,rlmode,skiphash) local steps=currentlookup.steps local nofsteps=currentlookup.nofsteps if nofsteps>1 then @@ -23918,7 +23937,7 @@ function chainprocs.gpos_mark2ligature(head,start,stop,dataset,sequence,currentl end return head,start,false end -function chainprocs.gpos_mark2mark(head,start,stop,dataset,sequence,currentlookup,rlmode) +function chainprocs.gpos_mark2mark(head,start,stop,dataset,sequence,currentlookup,rlmode,skiphash) local steps=currentlookup.steps local nofsteps=currentlookup.nofsteps if nofsteps>1 then @@ -23973,7 +23992,7 @@ function chainprocs.gpos_mark2mark(head,start,stop,dataset,sequence,currentlooku end return head,start,false end -function chainprocs.gpos_cursive(head,start,stop,dataset,sequence,currentlookup,rlmode) +function chainprocs.gpos_cursive(head,start,stop,dataset,sequence,currentlookup,rlmode,skiphash) local steps=currentlookup.steps local nofsteps=currentlookup.nofsteps if nofsteps>1 then @@ -24069,7 +24088,7 @@ local function setdiscchecked(d,pre,post,replace) setdisc(d,pre,post,replace) end local noflags={ false,false,false,false } -local function chainrun(head,start,last,dataset,sequence,rlmode,ck,skipsome) +local function chainrun(head,start,last,dataset,sequence,rlmode,skiphash,ck) local size=ck[5]-ck[4]+1 local chainlookups=ck[6] local done=false @@ -24082,7 +24101,7 @@ local function chainrun(head,start,last,dataset,sequence,rlmode,ck,skipsome) local chainproc=chainprocs[chainkind] if chainproc then local ok - head,start,ok=chainproc(head,start,last,dataset,sequence,chainstep,rlmode,1) + head,start,ok=chainproc(head,start,last,dataset,sequence,chainstep,rlmode,skiphash) if ok then done=true end @@ -24091,18 +24110,15 @@ local function chainrun(head,start,last,dataset,sequence,rlmode,ck,skipsome) end end else - if skipsome then - skipsome=sequence.skipsome - end local i=1 local laststart=start local nofchainlookups=#chainlookups while start do - if skipsome then + if skiphash then while start do local char=ischar(start,currentfont) if char then - if skipsome[char] then + if skiphash and skiphash[char] then start=getnext(start) else break @@ -24120,7 +24136,7 @@ local function chainrun(head,start,last,dataset,sequence,rlmode,ck,skipsome) local chainproc=chainprocs[chainkind] if chainproc then local ok,n - head,start,ok,n=chainproc(head,start,last,dataset,sequence,chainstep,rlmode,i) + head,start,ok,n=chainproc(head,start,last,dataset,sequence,chainstep,rlmode,skiphash) if ok then done=true if n and n>1 and i+n>nofchainlookups then @@ -24148,7 +24164,7 @@ local function chainrun(head,start,last,dataset,sequence,rlmode,ck,skipsome) else local replacements=ck[7] if replacements then - head,start,done=reversesub(head,start,last,dataset,sequence,replacements,rlmode) + head,start,done=reversesub(head,start,last,dataset,sequence,replacements,rlmode,skiphash) else done=true if trace_contexts then @@ -24158,7 +24174,7 @@ local function chainrun(head,start,last,dataset,sequence,rlmode,ck,skipsome) end return head,start,done end -local function chaindisk(head,start,dataset,sequence,rlmode,ck,skipped) +local function chaindisk(head,start,dataset,sequence,rlmode,skiphash,ck) if not start then return head,start,false end @@ -24371,14 +24387,14 @@ local function chaindisk(head,start,dataset,sequence,rlmode,ck,skipped) end if not notmatchpre[lookaheaddisc] then local ok=false - cf,start,ok=chainrun(cf,start,cl,dataset,sequence,rlmode,ck,skipped) + cf,start,ok=chainrun(cf,start,cl,dataset,sequence,rlmode,skiphash,ck) if ok then done=true end end if not notmatchreplace[lookaheaddisc] then local ok=false - new,cnew,ok=chainrun(new,cnew,clast,dataset,sequence,rlmode,ck,skipped) + new,cnew,ok=chainrun(new,cnew,clast,dataset,sequence,rlmode,skiphash,ck) if ok then done=true end @@ -24424,14 +24440,14 @@ local function chaindisk(head,start,dataset,sequence,rlmode,ck,skipped) end if not notmatchpost[backtrackdisc] then local ok=false - cf,start,ok=chainrun(cf,start,last,dataset,sequence,rlmode,ck,skipped) + cf,start,ok=chainrun(cf,start,last,dataset,sequence,rlmode,skiphash,ck) if ok then done=true end end if not notmatchreplace[backtrackdisc] then local ok=false - new,cnew,ok=chainrun(new,cnew,clast,dataset,sequence,rlmode,ck,skipped) + new,cnew,ok=chainrun(new,cnew,clast,dataset,sequence,rlmode,skiphash,ck) if ok then done=true end @@ -24456,14 +24472,14 @@ local function chaindisk(head,start,dataset,sequence,rlmode,ck,skipped) sweephead[replace]=getnext(last) or false else local ok=false - head,start,ok=chainrun(head,start,last,dataset,sequence,rlmode,ck,skipped) + head,start,ok=chainrun(head,start,last,dataset,sequence,rlmode,skiphash,ck) if ok then done=true end end return head,start,done end -local function chaintrac(head,start,dataset,sequence,rlmode,ck,skipped,match) +local function chaintrac(head,start,dataset,sequence,rlmode,skiphash,ck,match) local rule=ck[1] local lookuptype=ck[8] or ck[2] local nofseq=#ck[3] @@ -24473,7 +24489,7 @@ local function chaintrac(head,start,dataset,sequence,rlmode,ck,skipped,match) logwarning("%s: rule %s %s at char %s for (%s,%s,%s) chars, lookuptype %a", cref(dataset,sequence),rule,match and "matches" or "nomatch",gref(char),first-1,last-first+1,nofseq-last,lookuptype) end -local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode) +local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,skiphash) local sweepnode=sweepnode local sweeptype=sweeptype local postreplace @@ -24492,7 +24508,6 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode) end local currentfont=currentfont local skipped - local skipsome=sequence.skipsome local startprev, startnext=getboth(start) local done @@ -24522,7 +24537,7 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode) if last then local char,id=ischar(last,currentfont) if char then - if skipsome and skipsome[char] then + if skiphash and skiphash[char] then skipped=true if trace_skips then show_skip(dataset,sequence,char,ck,classes[char]) @@ -24624,7 +24639,7 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode) if prev then local char,id=ischar(prev,currentfont) if char then - if skipsome and skipsome[char] then + if skiphash and skiphash[char] then skipped=true if trace_skips then show_skip(dataset,sequence,char,ck,classes[char]) @@ -24742,7 +24757,7 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode) if current then local char,id=ischar(current,currentfont) if char then - if skipsome and skipsome[char] then + if skiphash and skiphash[char] then skipped=true if trace_skips then show_skip(dataset,sequence,char,ck,classes[char]) @@ -24847,12 +24862,12 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode) end end if trace_contexts then - chaintrac(head,start,dataset,sequence,rlmode,ck,skipped,true) + chaintrac(head,start,dataset,sequence,rlmode,skipped and skiphash,ck,true) end if diskseen or sweepnode then - head,start,done=chaindisk(head,start,dataset,sequence,rlmode,ck,skipped) + head,start,done=chaindisk(head,start,dataset,sequence,rlmode,skipped and skiphash,ck) else - head,start,done=chainrun(head,start,last,dataset,sequence,rlmode,ck,skipped) + head,start,done=chainrun(head,start,last,dataset,sequence,rlmode,skipped and skiphash,ck) end if done then break @@ -24871,13 +24886,13 @@ handlers.gsub_contextchain=handle_contextchain handlers.gsub_reversecontextchain=handle_contextchain handlers.gpos_contextchain=handle_contextchain handlers.gpos_context=handle_contextchain -local function chained_contextchain(head,start,stop,dataset,sequence,currentlookup,rlmode) +local function chained_contextchain(head,start,stop,dataset,sequence,currentlookup,rlmode,skiphash) local steps=currentlookup.steps local nofsteps=currentlookup.nofsteps if nofsteps>1 then reportmoresteps(dataset,sequence) end - return handle_contextchain(head,start,dataset,sequence,currentlookup,rlmode) + return handle_contextchain(head,start,dataset,sequence,currentlookup,rlmode,skiphash) end chainprocs.gsub_context=chained_contextchain chainprocs.gsub_contextchain=chained_contextchain @@ -25197,7 +25212,7 @@ local function testrun(disc,t_run,c_run,...) end end local nesting=0 -local function c_run_single(head,font,attr,lookupcache,step,dataset,sequence,rlmode,handler) +local function c_run_single(head,font,attr,lookupcache,step,dataset,sequence,rlmode,skiphash,handler) local done=false local sweep=sweephead[head] if sweep then @@ -25217,7 +25232,7 @@ local function c_run_single(head,font,attr,lookupcache,step,dataset,sequence,rlm local lookupmatch=lookupcache[char] if lookupmatch then local ok - head,start,ok=handler(head,start,dataset,sequence,lookupmatch,rlmode,step,1) + head,start,ok=handler(head,start,dataset,sequence,lookupmatch,rlmode,skiphash,step) if ok then done=true end @@ -25311,7 +25326,7 @@ local function t_run_single(start,stop,font,attr,lookupcache) end return 0 end -local function k_run_single(sub,injection,last,font,attr,lookupcache,step,dataset,sequence,rlmode,handler) +local function k_run_single(sub,injection,last,font,attr,lookupcache,step,dataset,sequence,rlmode,skiphash,handler) local a if attr then a=getattr(sub,0) @@ -25325,7 +25340,7 @@ local function k_run_single(sub,injection,last,font,attr,lookupcache,step,datase if char then local lookupmatch=lookupcache[char] if lookupmatch then - local h,d,ok=handler(sub,n,dataset,sequence,lookupmatch,rlmode,step,1,injection) + local h,d,ok=handler(sub,n,dataset,sequence,lookupmatch,rlmode,skiphash,step,injection) if ok then return true end @@ -25334,7 +25349,7 @@ local function k_run_single(sub,injection,last,font,attr,lookupcache,step,datase end end end -local function c_run_multiple(head,font,attr,steps,nofsteps,dataset,sequence,rlmode,handler) +local function c_run_multiple(head,font,attr,steps,nofsteps,dataset,sequence,rlmode,skiphash,handler) local done=false local sweep=sweephead[head] if sweep then @@ -25357,7 +25372,7 @@ local function c_run_multiple(head,font,attr,steps,nofsteps,dataset,sequence,rlm local lookupmatch=lookupcache[char] if lookupmatch then local ok - head,start,ok=handler(head,start,dataset,sequence,lookupmatch,rlmode,step,i) + head,start,ok=handler(head,start,dataset,sequence,lookupmatch,rlmode,skiphash,step) if ok then done=true break @@ -25459,7 +25474,7 @@ local function t_run_multiple(start,stop,font,attr,steps,nofsteps) end return 0 end -local function k_run_multiple(sub,injection,last,font,attr,steps,nofsteps,dataset,sequence,rlmode,handler) +local function k_run_multiple(sub,injection,last,font,attr,steps,nofsteps,dataset,sequence,rlmode,skiphash,handler) local a if attr then a=getattr(sub,0) @@ -25476,7 +25491,7 @@ local function k_run_multiple(sub,injection,last,font,attr,steps,nofsteps,datase local lookupcache=step.coverage local lookupmatch=lookupcache[char] if lookupmatch then - local h,d,ok=handler(sub,n,dataset,sequence,lookupmatch,rlmode,step,i,injection) + local h,d,ok=handler(sub,n,dataset,sequence,lookupmatch,rlmode,skiphash,step,injection) if ok then return true end @@ -25583,14 +25598,14 @@ do local handler=handlers[typ] local steps=sequence.steps local nofsteps=sequence.nofsteps - local skipsome=sequence.skipsome + local skiphash=sequence.skiphash if not steps then - local h,d,ok=handler(head,head,dataset,sequence,nil,nil,nil,0,font,attr) + local h,ok=handler(head,dataset,sequence,initialrl,font,attr) if ok then done=true - if h then - head=h - end + end + if h and h~=head then + head=h end elseif typ=="gsub_reversecontextchain" then local start=find_node_tail(head) @@ -25612,7 +25627,7 @@ do local lookupmatch=lookupcache[char] if lookupmatch then local ok - head,start,ok=handler(head,start,dataset,sequence,lookupmatch,rlmode,step,i) + head,start,ok=handler(head,start,dataset,sequence,lookupmatch,rlmode,skiphash,step) if ok then done=true break @@ -25641,7 +25656,7 @@ do while start do local char,id=ischar(start,font) if char then - if skipsome and skipsome[char] then + if skiphash and skiphash[char] then start=getnext(start) else local lookupmatch=lookupcache[char] @@ -25656,7 +25671,7 @@ do end if a then local ok - head,start,ok=handler(head,start,dataset,sequence,lookupmatch,rlmode,step,1) + head,start,ok=handler(head,start,dataset,sequence,lookupmatch,rlmode,skiphash,step) if ok then done=true end @@ -25676,11 +25691,11 @@ do if not discs or discs[start]==true then local ok if gpossing then - start,ok=kernrun(start,k_run_single,font,attr,lookupcache,step,dataset,sequence,rlmode,handler) + start,ok=kernrun(start,k_run_single,font,attr,lookupcache,step,dataset,sequence,rlmode,skiphash,handler) elseif typ=="gsub_ligature" then - start,ok=testrun(start,t_run_single,c_run_single,font,attr,lookupcache,step,dataset,sequence,rlmode,handler) + start,ok=testrun(start,t_run_single,c_run_single,font,attr,lookupcache,step,dataset,sequence,rlmode,skiphash,handler) else - start,ok=comprun(start,c_run_single,font,attr,lookupcache,step,dataset,sequence,rlmode,handler) + start,ok=comprun(start,c_run_single,font,attr,lookupcache,step,dataset,sequence,rlmode,skiphash,handler) end if ok then done=true @@ -25705,7 +25720,7 @@ do if char then local m=merged[char] if m then - if skipsome and skipsome[char] then + if skiphash and skiphash[char] then start=getnext(start) else local a @@ -25723,7 +25738,7 @@ do local lookupmatch=lookupcache[char] if lookupmatch then local ok - head,start,ok=handler(head,start,dataset,sequence,lookupmatch,rlmode,step,i) + head,start,ok=handler(head,start,dataset,sequence,lookupmatch,rlmode,skiphash,step) if ok then done=true break @@ -25748,11 +25763,11 @@ do if not discs or discs[start]==true then local ok if gpossing then - start,ok=kernrun(start,k_run_multiple,font,attr,steps,nofsteps,dataset,sequence,rlmode,handler) + start,ok=kernrun(start,k_run_multiple,font,attr,steps,nofsteps,dataset,sequence,rlmode,skiphash,handler) elseif typ=="gsub_ligature" then - start,ok=testrun(start,t_run_multiple,c_run_multiple,font,attr,steps,nofsteps,dataset,sequence,rlmode,handler) + start,ok=testrun(start,t_run_multiple,c_run_multiple,font,attr,steps,nofsteps,dataset,sequence,rlmode,skiphash,handler) else - start,ok=comprun(start,c_run_multiple,font,attr,steps,nofsteps,dataset,sequence,rlmode,handler) + start,ok=comprun(start,c_run_multiple,font,attr,steps,nofsteps,dataset,sequence,rlmode,skiphash,handler) end if ok then done=true @@ -25815,7 +25830,7 @@ do position=position+1 local m=merged[char] if m then - if skipsome and skipsome[char] then + if skiphash and skiphash[char] then start=getnext(start) else for i=m[1],m[2] do @@ -25824,7 +25839,7 @@ do local lookupmatch=lookupcache[char] if lookupmatch then local ok - head,start,ok=handler(head,start,dataset,sequence,lookupmatch,rlmode,step,i) + head,start,ok=handler(head,start,dataset,sequence,lookupmatch,rlmode,skiphash,step) if ok then break elseif not start then @@ -25897,23 +25912,23 @@ registerotffeature { otf.handlers=handlers local setspacekerns=nodes.injections.setspacekerns if not setspacekerns then os.exit() end if fontfeatures then - function otf.handlers.trigger_space_kerns(head,start,dataset,sequence,_,_,_,_,font,attr) + function handlers.trigger_space_kerns(head,dataset,sequence,initialrl,font,attr) local features=fontfeatures[font] local enabled=features and features.spacekern and features.kern if enabled then setspacekerns(font,sequence) end - return head,start,enabled + return head,enabled end else - function otf.handlers.trigger_space_kerns(head,start,dataset,sequence,_,_,_,_,font,attr) + function handlers.trigger_space_kerns(head,dataset,sequence,initialrl,font,attr) local shared=fontdata[font].shared local features=shared and shared.features local enabled=features and features.spacekern and features.kern if enabled then setspacekerns(font,sequence) end - return head,start,enabled + return head,enabled end end local function hasspacekerns(data) @@ -26350,7 +26365,6 @@ local sequence_reorder_matras={ nofsteps=1, steps={ { - osdstep=true, coverage=pre_mark, } } @@ -26364,7 +26378,6 @@ local sequence_reorder_reph={ nofsteps=1, steps={ { - osdstep=true, coverage={}, } } @@ -26378,7 +26391,6 @@ local sequence_reorder_pre_base_reordering_consonants={ nofsteps=1, steps={ { - osdstep=true, coverage={}, } } @@ -26391,7 +26403,7 @@ local sequence_remove_joiners={ type="devanagari_remove_joiners", nofsteps=1, steps={ - { osdstep=true, + { coverage=both_joiners_true, }, } @@ -26500,24 +26512,21 @@ local function initializedevanagi(tfmdata) if coverage then local reph=false if kind=="rphf" then - if true then - for k,v in next,ra do - local r=coverage[k] - if r then - local h=false - for k,v in next,halant do - local h=r[k] - if h then - reph=h.ligature or false - break - end - end - if reph then + for k,v in next,ra do + local r=coverage[k] + if r then + local h=false + for k,v in next,halant do + local h=r[k] + if h then + reph=h.ligature or false break end end + if reph then + break + end end - else end end seqsubset[#seqsubset+1]={ kind,coverage,reph } @@ -28499,8 +28508,9 @@ local fonts=fonts local otf=fonts.handlers.otf local registerotffeature=otf.features.register local setmetatableindex=table.setmetatableindex -local mergesteps=fonts.helpers.mergesteps +local checkmerge=fonts.helpers.checkmerge local checkflags=fonts.helpers.checkflags +local checksteps=fonts.helpers.checksteps local normalized={ substitution="substitution", single="substitution", @@ -29076,7 +29086,8 @@ local function addfeature(data,feature,specifications) steps[nofsteps]=register(coverage,featuretype,format,feature,nofsteps,descriptions,resources) end end - setmetatableindex(steps,mergesteps) + checkmerge(specification) + checksteps(specification) s[i]={ [stepkey]=steps, nofsteps=nofsteps, @@ -29135,7 +29146,6 @@ local function addfeature(data,feature,specifications) askedfeatures[k]=tohash(v) end end - setmetatableindex(steps,mergesteps) if featureflags[1] then featureflags[1]="mark" end if featureflags[2] then featureflags[2]="ligature" end if featureflags[3] then featureflags[3]="base" end @@ -29151,6 +29161,8 @@ local function addfeature(data,feature,specifications) type=steptype, } checkflags(sequence,resources) + checkmerge(sequence) + checksteps(sequence) local first,last=getrange(sequences,category) inject(specification,sequences,sequence,first,last,category,feature) local features=fontfeatures[category] -- cgit v1.2.3