diff options
author | Karl Berry <karl@freefriends.org> | 2024-02-27 16:48:07 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-02-27 16:48:07 +0000 |
commit | ff3b6d10a05ce9bffa52a27ffa6e11e5ecf22c72 (patch) | |
tree | 35152df3770855d042b005decdfa9d63b686f446 /Master/texmf-dist/tex/generic | |
parent | 4624d267ff83f197bbce4cf296d291465069296c (diff) |
context 2024.02.27 09:18, and luametatex
git-svn-id: svn://tug.org/texlive/trunk@70189 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic')
-rw-r--r-- | Master/texmf-dist/tex/generic/context/luatex/luatex-core.lua | 124 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-merged.lua | 375 |
2 files changed, 276 insertions, 223 deletions
diff --git a/Master/texmf-dist/tex/generic/context/luatex/luatex-core.lua b/Master/texmf-dist/tex/generic/context/luatex/luatex-core.lua index 66207339e17..e7d81549979 100644 --- a/Master/texmf-dist/tex/generic/context/luatex/luatex-core.lua +++ b/Master/texmf-dist/tex/generic/context/luatex/luatex-core.lua @@ -7,7 +7,7 @@ -- copyright = 'LuaTeX Development Team', -- } -LUATEXCOREVERSION = 1.120 -- we reflect the luatex version where changes happened +LUATEXCOREVERSION = 1.161 -- we reflect the luatex version where changes happened -- This file overloads some Lua functions. The readline variants provide the same -- functionality as LuaTeX <= 1.04 and doing it this way permits us to keep the @@ -33,8 +33,11 @@ if kpseused == 1 then local kpse_recordinputfile = kpse.record_input_file local kpse_recordoutputfile = kpse.record_output_file + local kpse_outputnameok = kpse.out_name_ok + local kpse_inputnameok = kpse.in_name_ok + local io_open = io.open - local io_popen = io.popen + local io_popen = kpse.popen or io.popen -- should have been be in the kpse namespace local io_lines = io.lines local fio_readline = fio.readline @@ -44,56 +47,48 @@ if kpseused == 1 then io.saved_lines = io_lines -- always readonly mt.saved_lines = mt_lines -- always readonly - local function luatex_io_open(name,how) - if not how then - how = 'r' - end - local f = io_open(name,how) - if f then - if type(how) == 'string' and find(how,'w') then - kpse_recordoutputfile(name,'w') - else - kpse_recordinputfile(name,'r') - end + -- The version below is different from the luatex one (which is probably made for + -- LaTeX) because read should not be the default (e.g. when how == 'q'). Also in + -- that version record doesn't always work for write. How about append? + + local function validinput(name,how) + if type(how) ~= "string" or how == "" then + how = "r" end - return f + return not find(how,"w") and kpse_inputnameok(name) and io_open(name,how) end - local function luatex_io_open_readonly(name,how) - if not how then - how = 'r' + local function validoutput(name,how) + return type(how) == "string" and find(how,"w") and kpse_outputnameok(name) and io_open(name,how) + end + + local function luatex_io_open(name,how) + local handle = validinput(name,how) + if handle then + kpse_recordinputfile(name,"r") else - how = gsub(how,'[^rb]','') - if how == '' then - how = 'r' + handle = validoutput(name,how) + if handle then + kpse_recordoutputfile(name,"w") end end - local f = io_open(name,how) - if f then - fio_recordfilename(name,'r') - end - return f + return handle end - local function luatex_io_popen(name,...) - local okay, found = kpse_checkpermission(name) - if okay and found then - return io_popen(found,...) + local function luatex_io_open_readonly(name,how) + local handle = validinput(name,how) + if handle then + kpse_recordinputfile(name,"r") end + return handle end - -- local function luatex_io_lines(name,how) - -- if name then - -- local f = io_open(name,how or 'r') - -- if f then - -- return function() - -- return fio_readline(f) - -- end - -- end - -- else - -- return io_lines() - -- end - -- end + -- local function luatex_io_popen(name,...) + -- local okay, found = kpse_checkpermission(name) + -- if okay and found then + -- return io_popen(found,...) + -- end + -- end -- For some reason the gc doesn't kick in so we need to close explicitly -- so that the handle is flushed. @@ -102,8 +97,9 @@ if kpseused == 1 then local function luatex_io_lines(name,how) if type(name) == "string" then - local f = io_open(name,how or 'r') - if f then + local handle = validinput(name,how) + if handle then + kpse_recordinputfile(name,"r") return function() local l = fio_readline(f) if not l then @@ -130,7 +126,8 @@ if kpseused == 1 then mt.lines = luatex_io_readline io.open = luatex_io_open - io.popen = luatex_io_popen + -- io.popen = luatex_io_popen + io.popen = io_popen else @@ -163,28 +160,31 @@ if saferoption == 1 then local reported = false end - os.execute = installdummy("os.execute") - os.spawn = installdummy("os.spawn") - os.exec = installdummy("os.exec") - os.setenv = installdummy("os.setenv") - os.tempdir = installdummy("os.tempdir") + os.execute = installdummy("os.execute") + os.spawn = installdummy("os.spawn") + os.exec = installdummy("os.exec") + os.setenv = installdummy("os.setenv") + os.tempdir = installdummy("os.tempdir") + + io.popen = installdummy("io.popen") + io.open = installdummy("io.open",luatex_io_open_readonly) - io.popen = installdummy("io.popen") - io.open = installdummy("io.open",luatex_io_open_readonly) + os.kpsepopen = io.popen -- because it's in the os namespace ... brr - os.rename = installdummy("os.rename") - os.remove = installdummy("os.remove") + os.rename = installdummy("os.rename") + os.remove = installdummy("os.remove") - io.tmpfile = installdummy("io.tmpfile") - io.output = installdummy("io.output") + io.tmpfile = installdummy("io.tmpfile") + io.output = installdummy("io.output") - lfs.chdir = installdummy("lfs.chdir") - lfs.lock = installdummy("lfs.lock") - lfs.touch = installdummy("lfs.touch") - lfs.rmdir = installdummy("lfs.rmdir") - lfs.mkdir = installdummy("lfs.mkdir") + lfs.chdir = installdummy("lfs.chdir") + lfs.lock = installdummy("lfs.lock") + lfs.touch = installdummy("lfs.touch") + lfs.rmdir = installdummy("lfs.rmdir") + lfs.mkdir = installdummy("lfs.mkdir") debug = nil + package.loaded.debug = nil -- os.[execute|os.spawn|os.exec] already are shellescape aware) @@ -198,6 +198,10 @@ if saferoption == 1 or shellescape ~= 1 then package.searchers[4] = nil package.searchers[3] = nil + if os.setenv then + os.setenv = function(...) end -- Great, this will fail for some usage. + end + ffi = require('ffi') if ffi then diff --git a/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-merged.lua b/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-merged.lua index 5441fa0043b..340be1951a1 100644 --- a/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/Master/texmf-dist/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 : 2023-05-05 18:36 +-- merge date : 2024-02-27 09:18 do -- begin closure to overcome local limits and interference @@ -1341,19 +1341,22 @@ local function copy(t,tables) tables[t]=tcopy end for i,v in next,t do + local k if type(i)=="table" then if tables[i] then - i=tables[i] + k=tables[i] else - i=copy(i,tables) + k=copy(i,tables) end + else + k=i end if type(v)~="table" then - tcopy[i]=v + tcopy[k]=v elseif tables[v] then - tcopy[i]=tables[v] + tcopy[k]=tables[v] else - tcopy[i]=copy(v,tables) + tcopy[k]=copy(v,tables) end end local mt=getmetatable(t) @@ -1550,7 +1553,11 @@ local function do_serialize(root,name,depth,level,indexed) elseif tv=="number" then if tk=="number" then if hexify then - handle(format("%s [0x%X]=0x%X,",depth,k,v)) + if accurate then + handle(format("%s [0x%X]=%q,",depth,k,v)) + else + handle(format("%s [0x%X]=%s,",depth,k,v)) + end elseif accurate then handle(format("%s [%s]=%q,",depth,k,v)) else @@ -1558,7 +1565,11 @@ local function do_serialize(root,name,depth,level,indexed) end elseif tk=="boolean" then if hexify then - handle(format("%s [%s]=0x%X,",depth,k and "true" or "false",v)) + if accurate then + handle(format("%s [%s]=%q,",depth,k and "true" or "false",v)) + else + handle(format("%s [%s]=%s,",depth,k and "true" or "false",v)) + end elseif accurate then handle(format("%s [%s]=%q,",depth,k and "true" or "false",v)) else @@ -1567,7 +1578,11 @@ local function do_serialize(root,name,depth,level,indexed) elseif tk~="string" then elseif noquotes and not reserved[k] and lpegmatch(propername,k) then if hexify then - handle(format("%s %s=0x%X,",depth,k,v)) + if accurate then + handle(format("%s %s=%q,",depth,k,v)) + else + handle(format("%s %s=0x%X,",depth,k,v)) + end elseif accurate then handle(format("%s %s=%q,",depth,k,v)) else @@ -1575,7 +1590,11 @@ local function do_serialize(root,name,depth,level,indexed) end else if hexify then - handle(format("%s [%q]=0x%X,",depth,k,v)) + if accurate then + handle(format("%s [%q]=%q,",depth,k,v)) + else + handle(format("%s [%q]=0x%X,",depth,k,v)) + end elseif accurate then handle(format("%s [%q]=%q,",depth,k,v)) else @@ -3331,6 +3350,7 @@ local p_prune_intospace=Cs (noleading*(notrailing+intospace+1 )^0 ) local p_retain_normal=Cs ((normalline+normalempty )^0 ) local p_retain_collapse=Cs ((normalline+doubleempty )^0 ) local p_retain_noempty=Cs ((normalline+singleempty )^0 ) +local p_collapse_all=Cs (stripstart*(stripend+((whitespace+newline)^1/" ")+1)^0 ) local striplinepatterns={ ["prune"]=p_prune_normal, ["prune and collapse"]=p_prune_collapse, @@ -3339,6 +3359,7 @@ local striplinepatterns={ ["retain"]=p_retain_normal, ["retain and collapse"]=p_retain_collapse, ["retain and no empty"]=p_retain_noempty, + ["collapse all"]=p_collapse_all, ["collapse"]=patterns.collapser, } setmetatable(striplinepatterns,{ __index=function(t,k) return p_prune_collapse end }) @@ -4015,6 +4036,7 @@ end strings.formatters.add=add patterns.xmlescape=Cs((P("<")/"<"+P(">")/">"+P("&")/"&"+P('"')/"""+anything)^0) patterns.texescape=Cs((C(S("#$%\\{}"))/"\\%1"+anything)^0) +patterns.ctxescape=Cs((C(S("#$%\\{}|"))/"\\%1"+anything)^0) patterns.luaescape=Cs(((1-S('"\n'))^1+P('"')/'\\"'+P('\n')/'\\n"')^0) patterns.luaquoted=Cs(Cc('"')*((1-S('"\n'))^1+P('"')/'\\"'+P('\n')/'\\n"')^0*Cc('"')) add(formatters,"xml",[[lpegmatch(xmlescape,%s)]],{ xmlescape=patterns.xmlescape }) @@ -4085,6 +4107,20 @@ do return cache[s] end end +if CONTEXTLMTXMODE and CONTEXTLMTXMODE>0 then + local t={ + ["#"]="#H", + ["\n"]="#L", + ['"']="#Q", + ["\r"]="#R", + [" "]="#S", + ["\t"]="#T", + ["\\"]="#X", + } + function string.texhashed(s) + return (gsub(s,".",t)) + end +end end -- closure @@ -9530,7 +9566,6 @@ function constructors.scale(tfmdata,specification) local stackmath=not properties.nostackmath local haskerns=properties.haskerns or properties.mode=="base" local hasligatures=properties.hasligatures or properties.mode=="base" - local realdimensions=properties.realdimensions local writingmode=properties.writingmode or "horizontal" local identity=properties.identity or "horizontal" local vfonts=target.fonts @@ -9626,6 +9661,13 @@ function constructors.scale(tfmdata,specification) if changed then local c=changed[unicode] if c and c~=unicode then + local cc=changed[c] + if cc then + while cc do + c=cc + cc=changed[c] + end + end if c then description=descriptions[c] or descriptions[unicode] or character character=characters[c] or character @@ -9646,26 +9688,6 @@ function constructors.scale(tfmdata,specification) local height=description.height local depth=description.depth local isunicode=description.unicode - if realdimensions then - if not height or height==0 then - local bb=description.boundingbox - local ht=bb[4] - if ht~=0 then - height=ht - end - if not depth or depth==0 then - local dp=-bb[2] - if dp~=0 then - depth=dp - end - end - elseif not depth or depth==0 then - local dp=-description.boundingbox[2] - if dp~=0 then - depth=dp - end - end - end if width then width=hdelta*width else width=scaledwidth end if height then height=vdelta*height else height=scaledheight end if depth and depth~=0 then @@ -10796,7 +10818,7 @@ local function tounicode16(unicode) return s_unknown else unicode=unicode-0x10000 - return f_double(idiv(k,0x400)+0xD800,unicode%0x400+0xDC00) + return f_double(idiv(unicode,0x400)+0xD800,unicode%0x400+0xDC00) end end local function tounicode16sequence(unicodes) @@ -10815,7 +10837,7 @@ local function tounicode16sequence(unicodes) t[l]=s_unknown else u=u-0x10000 - t[l]=f_double(idiv(k,0x400)+0xD800,u%0x400+0xDC00) + t[l]=f_double(idiv(u,0x400)+0xD800,u%0x400+0xDC00) end end return concat(t) @@ -12666,6 +12688,8 @@ local function getinfo(maindata,sub,platformnames,rawfamilynames,metricstoo,inst capheight=metrics.capheight or fontdata.maxy, ascender=metrics.typoascender, descender=metrics.typodescender, + ascent=metrics.winascent, + descent=metrics.windescent, platformnames=platformnames or nil, instancenames=instancenames or nil, tableoffsets=fontdata.tableoffsets, @@ -17664,21 +17688,25 @@ local function chainedcontext(f,fontdata,lookupid,lookupoffset,offset,glyphs,nof local current=readarray(f) local after=readarray(f) local noflookups=readushort(f) - local lookups=readlookuparray(f,noflookups,#current) - before=readcoveragearray(f,tableoffset,before,true) - current=readcoveragearray(f,tableoffset,current,true) - after=readcoveragearray(f,tableoffset,after,true) - return { - format="coverage", - rules={ - { - before=before, - current=current, - after=after, - lookups=lookups, + local lookups=current and readlookuparray(f,noflookups,#current) + if lookups then + before=readcoveragearray(f,tableoffset,before,true) + current=readcoveragearray(f,tableoffset,current,true) + after=readcoveragearray(f,tableoffset,after,true) + return { + format="coverage", + rules={ + { + before=before, + current=current, + after=after, + lookups=lookups, + } } } - } + else + report("confusing subtype %a in %a %s",subtype,"chainedcontext",what) + end else report("unsupported subtype %a in %a %s",subtype,"chainedcontext",what) end @@ -18407,7 +18435,7 @@ do end return features end - local function readlookups(f,lookupoffset,lookuptypes,featurehash,featureorder) + local function readlookups(f,lookupoffset,lookuptypes,featurehash,featureorder,nofmarkclasses) setposition(f,lookupoffset) local noflookups=readushort(f) local lookups=readcardinaltable(f,noflookups,ushort) @@ -18424,12 +18452,12 @@ do subtables[j]=offset+readushort(f) end local markclass=band(flagbits,0x0010)~=0 + local markset=rshift(flagbits,8) if markclass then markclass=readushort(f) end - local markset=rshift(flagbits,8) if markset>0 then - markclass=markset + markclass=nofmarkclasses+markset end lookups[lookupid]={ type=lookuptype, @@ -18773,7 +18801,10 @@ do if not lookupstoo then return end - local lookups=readlookups(f,lookupoffset,lookuptypes,featurehash,featureorder) + local markclasses=fontdata.markclasses + local marksets=fontdata.marksets + local nofmarkclasses=(markclasses and #markclasses or 0)-(marksets and #marksets or 0) + local lookups=readlookups(f,lookupoffset,lookuptypes,featurehash,featureorder,nofmarkclasses) if lookups then resolvelookups(f,lookupoffset,fontdata,lookups,lookuptypes,lookuphandlers,what,tableoffset) end @@ -18942,6 +18973,7 @@ function readers.gdef(f,fontdata,specification) end end if marksetsoffset~=0 then + local nofmarkclasses=fontdata.markclasses and #fontdata.markclasses or 0 marksetsoffset=tableoffset+marksetsoffset setposition(f,marksetsoffset) local format=readushort(f) @@ -18951,7 +18983,8 @@ function readers.gdef(f,fontdata,specification) for i=1,nofsets do local offset=sets[i] if offset~=0 then - marksets[i]=readcoverage(f,marksetsoffset+offset) + markclasses[nofmarkclasses+i]=readcoverage(f,marksetsoffset+offset) + marksets[i]={} end end end @@ -19997,6 +20030,8 @@ function readers.mvar(f,fontdata,specification) end end end +function readers.dsig(f,fontdata,specification) +end end -- closure @@ -21334,7 +21369,7 @@ local trace_defining=false registertracker("fonts.defining",function(v) trace_d local report_otf=logs.reporter("fonts","otf loading") local fonts=fonts local otf=fonts.handlers.otf -otf.version=3.133 +otf.version=3.140 otf.cache=containers.define("fonts","otl",otf.version,true) otf.svgcache=containers.define("fonts","svg",otf.version,true) otf.pngcache=containers.define("fonts","png",otf.version,true) @@ -22218,7 +22253,7 @@ local function preparesubstitutions(tfmdata,feature,value,validlookups,lookuplis if kind=="gsub_single" then for i=1,#steps do for unicode,data in next,steps[i].coverage do - if unicode~=data then + if unicode~=data and not changed[unicode] then changed[unicode]=data end if trace_singles then @@ -22231,7 +22266,7 @@ local function preparesubstitutions(tfmdata,feature,value,validlookups,lookuplis for unicode,data in next,steps[i].coverage do local replacement=data[alternate] if replacement then - if unicode~=replacement then + if unicode~=replacement and not changed[unicode] then changed[unicode]=replacement end if trace_alternatives then @@ -22239,7 +22274,7 @@ local function preparesubstitutions(tfmdata,feature,value,validlookups,lookuplis end elseif defaultalt=="first" then replacement=data[1] - if unicode~=replacement then + if unicode~=replacement and not changed[unicode] then changed[unicode]=replacement end if trace_alternatives then @@ -22247,7 +22282,7 @@ local function preparesubstitutions(tfmdata,feature,value,validlookups,lookuplis end elseif defaultalt=="last" then replacement=data[#data] - if unicode~=replacement then + if unicode~=replacement and not changed[unicode] then changed[unicode]=replacement end if trace_alternatives then @@ -24657,6 +24692,29 @@ local function checklookups(fontdata,missing,nofmissing) report_unicodes("not unicoded: % t",sortedkeys(done)) end end + for k,v in next,descriptions do + local math=v.math + if math then + local variants=math.variants + local parts=math.parts + local unicode=v.unicode + if variants then + if unicode then + for i=1,#variants do + local v=descriptions[variants[i]] + if not v then + elseif v.unicode then + else + v.unicode=unicode + end + end + end + end + if parts then + parts[#parts//2+1].unicode=unicode + end + end + end end local firstprivate=fonts.privateoffsets and fonts.privateoffsets.textbase or 0xF0000 local puafirst=0xE000 @@ -24852,7 +24910,9 @@ local function unifyglyphs(fontdata,usenames) if colors then for i=1,#colors do local c=colors[i] - c.slot=indices[c.slot] + if c then + c.slot=indices[c.slot] + end end end end @@ -27661,7 +27721,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou if not marks[char] then baseindex=baseindex+componentindex componentindex=countcomponents(start,marks) - elseif not deletemarks then + elseif not deletemarks or (skiphash and skiphash[char]) then setligaindex(start,baseindex+getligaindex(start,componentindex)) if trace_marks then logwarning("%s: keep ligature mark %s, gets index %s",pref(dataset,sequence),gref(char),getligaindex(start)) @@ -29382,17 +29442,17 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s if last then local char,id=ischar(last,currentfont) if char then - if skiphash and skiphash[char] then + if seq[n][char] then + if n<l then + last=getnext(last) + end + n=n+1 + elseif skiphash and skiphash[char] then skipped=true if trace_skips then show_skip(dataset,sequence,char,ck,classes[char]) end last=getnext(last) - elseif seq[n][char] then - if n<l then - last=getnext(last) - end - n=n+1 elseif discfound then notmatchreplace[discfound]=true if notmatchpre[discfound] then @@ -29483,17 +29543,17 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s if prev then local char,id=ischar(prev,currentfont) if char then - if skiphash and skiphash[char] then + if seq[n][char] then + if n>1 then + prev=getprev(prev) + end + n=n-1 + elseif skiphash and skiphash[char] then skipped=true if trace_skips then show_skip(dataset,sequence,char,ck,classes[char]) end prev=getprev(prev) - elseif seq[n][char] then - if n>1 then - prev=getprev(prev) - end - n=n-1 elseif discfound then notmatchreplace[discfound]=true if notmatchpost[discfound] then @@ -29599,17 +29659,17 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s if current then local char,id=ischar(current,currentfont) if char then - if skiphash and skiphash[char] then + if seq[n][char] then + if n<s then + current=getnext(current) + end + n=n+1 + elseif skiphash and skiphash[char] then skipped=true if trace_skips then show_skip(dataset,sequence,char,ck,classes[char]) end - current=getnext(current) - elseif seq[n][char] then - if n<s then - current=getnext(current) - end - n=n+1 + current=getnext(current) elseif discfound then notmatchreplace[discfound]=true if notmatchpre[discfound] then @@ -30554,32 +30614,28 @@ do while start do local char,id=ischar(start,font) if char then - if skiphash and skiphash[char] then - start=getnext(start) - else - local lookupmatch=lookupcache[char] - if lookupmatch then - local a - if attr then - if getglyphdata(start)==attr and (not attribute or getstate(start,attribute)) then - a=true - end - elseif not attribute or getstate(start,attribute) then + local lookupmatch=lookupcache[char] + if lookupmatch then + local a + if attr then + if getglyphdata(start)==attr and (not attribute or getstate(start,attribute)) then a=true end - if a then - local ok,df - head,start,ok,df=handler(head,start,dataset,sequence,lookupmatch,rlmode,skiphash,step) - if df then - elseif start then - start=getnext(start) - end - else + elseif not attribute or getstate(start,attribute) then + a=true + end + if a then + local ok,df + head,start,ok,df=handler(head,start,dataset,sequence,lookupmatch,rlmode,skiphash,step) + if df then + elseif start then start=getnext(start) end else - start=getnext(start) + start=getnext(start) end + else + start=getnext(start) end elseif char==false or id==glue_code then start=getnext(start) @@ -30609,46 +30665,42 @@ do while start do local char,id=ischar(start,font) if char then - if skiphash and skiphash[char] then - start=getnext(start) - else - local m=merged[char] - if m then - local a - if attr then - if getglyphdata(start)==attr and (not attribute or getstate(start,attribute)) then - a=true - end - elseif not attribute or getstate(start,attribute) then + local m=merged[char] + if m then + local a + if attr then + if getglyphdata(start)==attr and (not attribute or getstate(start,attribute)) then a=true end - if a then - local ok,df - for i=m[1],m[2] do - local step=steps[i] - local lookupcache=step.coverage - local lookupmatch=lookupcache[char] - if lookupmatch then - head,start,ok,df=handler(head,start,dataset,sequence,lookupmatch,rlmode,skiphash,step) - if df then - break - elseif ok then - break - elseif not start then - break - end + elseif not attribute or getstate(start,attribute) then + a=true + end + if a then + local ok,df + for i=m[1],m[2] do + local step=steps[i] + local lookupcache=step.coverage + local lookupmatch=lookupcache[char] + if lookupmatch then + head,start,ok,df=handler(head,start,dataset,sequence,lookupmatch,rlmode,skiphash,step) + if df then + break + elseif ok then + break + elseif not start then + break end end - if df then - elseif start then - start=getnext(start) - end - else + end + if df then + elseif start then start=getnext(start) end else start=getnext(start) end + else + start=getnext(start) end elseif char==false or id==glue_code then start=getnext(start) @@ -30716,26 +30768,22 @@ do position=position+1 local m=merged[char] if m then - if skiphash and skiphash[char] then - start=getnext(start) - else - for i=m[1],m[2] do - local step=steps[i] - local lookupcache=step.coverage - local lookupmatch=lookupcache[char] - if lookupmatch then - local ok - head,start,ok=handler(head,start,dataset,sequence,lookupmatch,rlmode,skiphash,step) - if ok then - break - elseif not start then - break - end + for i=m[1],m[2] do + local step=steps[i] + local lookupcache=step.coverage + local lookupmatch=lookupcache[char] + if lookupmatch then + local ok + head,start,ok=handler(head,start,dataset,sequence,lookupmatch,rlmode,skiphash,step) + if ok then + break + elseif not start then + break end end - if start then - start=getnext(start) - end + end + if start then + start=getnext(start) end else start=getnext(start) @@ -33571,6 +33619,12 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) local last=getnext(stop) while current~=last do local next=getnext(current) + if current==subpos then + subnotafterbase=current + end + if current==postpos then + postnotafterbase=current + end if consonant[getchar(current)] then if not (current~=stop and next~=stop and halant[getchar(next)] and getchar(getnext(next))==c_zwj) then if not firstcons then @@ -33579,6 +33633,12 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) local a=getstate(current) if not (a==s_blwf or a==s_pstf or (a~=s_rphf and a~=s_blwf and ra[getchar(current)])) then base=current + if subnotafterbase then + subpos=base + end + if postnotafterbase then + postpos=base + end end end end @@ -33631,7 +33691,7 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) end end if not moved[current] and dependent_vowel[char] then - if pre_mark[char] then + if pre_mark[char] then moved[current]=true local prev,next=getboth(current) setlink(prev,next) @@ -33673,14 +33733,11 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) logprocess("reorder two, handle pre mark") end elseif above_mark[char] then - target=basepos - if subpos==basepos then - subpos=current - end - if postpos==basepos then + target=subpos + if postpos==subpos then postpos=current end - basepos=current + subpos=current elseif below_mark[char] then target=subpos if postpos==subpos then @@ -33900,11 +33957,7 @@ local function analyze_next_chars_one(c,font,variant) if pre_mark[v] and not already_pre_mark then already_pre_mark=true elseif post_mark[v] and not already_post_mark then - if devanagarihash[font].conjuncts=="mixed" then - return c - else already_post_mark=true - end elseif below_mark[v] and not already_below_mark then already_below_mark=true elseif above_mark[v] and not already_above_mark then @@ -34105,11 +34158,7 @@ local function analyze_next_chars_two(c,font) if pre_mark[v] and not already_pre_mark then already_pre_mark=true elseif post_mark[v] and not already_post_mark then - if devanagarihash[font].conjuncts=="mixed" then - return c - else already_post_mark=true - end elseif below_mark[v] and not already_below_mark then already_below_mark=true elseif above_mark[v] and not already_above_mark then @@ -34998,7 +35047,7 @@ local afm=handlers.afm or {} handlers.afm=afm local readers=afm.readers or {} afm.readers=readers -afm.version=1.513 +afm.version=1.540 local get_indexes,get_shapes do local decrypt @@ -35384,7 +35433,7 @@ local afmfeatures=constructors.features.afm local registerafmfeature=afmfeatures.register local afmenhancers=constructors.enhancers.afm local registerafmenhancer=afmenhancers.register -afm.version=1.513 +afm.version=1.540 afm.cache=containers.define("fonts","one",afm.version,true) afm.autoprefixed=true afm.helpdata={} |