diff --git a/build.lua b/build.lua index 2873428b..e1cb1685 100644 --- a/build.lua +++ b/build.lua @@ -1,7 +1,7 @@ -packageversion= "3.22-dev" -packagedate = "2022-03-18" -fontloaderdate= "2022-06-15" +packageversion= "3.23-dev" +packagedate = "2022-10-03" +fontloaderdate= "2022-10-03" packagedesc = "" module = "luaotfload" diff --git a/src/auto/fontloader-2022-06-15.lua b/src/auto/fontloader-2022-10-03.lua similarity index 99% rename from src/auto/fontloader-2022-06-15.lua rename to src/auto/fontloader-2022-10-03.lua index 5e0af8e4..4df88ec4 100644 --- a/src/auto/fontloader-2022-06-15.lua +++ b/src/auto/fontloader-2022-10-03.lua @@ -1,6 +1,6 @@ --[[info----------------------------------------------------------------------- Luaotfload fontloader package - build 2022-06-15 18:33:10 + build 2022-10-03 20:21:57 ------------------------------------------------------------------------------- © 2022 PRAGMA ADE / ConTeXt Development Team @@ -63,7 +63,7 @@ --info]]----------------------------------------------------------------------- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “data-con” 23a0f5386d46a1c157ae82a373e35fa0] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “data-con” 23a0f5386d46a1c157ae82a373e35fa0] --- if not modules then modules={} end modules ['data-con']={ version=1.100, @@ -184,10 +184,10 @@ function containers.cleanname(name) return (gsub(lower(name),"[^%w\128-\255]+","-")) end -end --- [luaotfload, fontloader-2022-06-15.lua scope for “data-con”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “data-con”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “basics-nod” 1750af43148def9e7a75c6900a96f9dc] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “basics-nod” 1750af43148def9e7a75c6900a96f9dc] --- if not modules then modules={} end modules ['luatex-fonts-nod']={ version=1.001, @@ -454,10 +454,10 @@ do end end -end --- [luaotfload, fontloader-2022-06-15.lua scope for “basics-nod”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “basics-nod”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “basics-chr” ce4afac7ba19471f3c8f90800839f315] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “basics-chr” ce4afac7ba19471f3c8f90800839f315] --- characters=characters or {} @@ -4291,10 +4291,10 @@ characters.indicgroups={ }, } -end --- [luaotfload, fontloader-2022-06-15.lua scope for “basics-chr”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “basics-chr”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “font-ini” 5343de60613adb24cdd7a8d2ee1d153c] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “font-ini” 5343de60613adb24cdd7a8d2ee1d153c] --- if not modules then modules={} end modules ['font-ini']={ version=1.001, @@ -4335,10 +4335,10 @@ if node and not tex.getfontoffamily then tex.getfontoffamily=node.family_font end -end --- [luaotfload, fontloader-2022-06-15.lua scope for “font-ini”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “font-ini”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “fonts-mis” 17e967c9ec4d001deefd43ddf25e98f7] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “fonts-mis” 17e967c9ec4d001deefd43ddf25e98f7] --- if not modules then modules={} end modules ['luatex-font-mis']={ version=1.001, @@ -4370,10 +4370,10 @@ function font.each() return table.sortedhash(fonts.hashes.identifiers) end -end --- [luaotfload, fontloader-2022-06-15.lua scope for “fonts-mis”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “fonts-mis”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “font-con” 724e5dd14aec2d4d189f8619898004cf] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “font-con” 724e5dd14aec2d4d189f8619898004cf] --- if not modules then modules={} end modules ['font-con']={ version=1.001, @@ -5741,10 +5741,10 @@ function constructors.addcoreunicodes(unicodes) return unicodes end -end --- [luaotfload, fontloader-2022-06-15.lua scope for “font-con”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “font-con”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “fonts-enc” c24fd6b4f34f87b9c4ff5e6193ce2656] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “fonts-enc” c24fd6b4f34f87b9c4ff5e6193ce2656] --- if not modules then modules={} end modules ['luatex-font-enc']={ version=1.001, @@ -5819,10 +5819,10 @@ function encodings.load(filename) return containers.write(encodings.cache,name,data) end -end --- [luaotfload, fontloader-2022-06-15.lua scope for “fonts-enc”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “fonts-enc”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “font-cid” 22b0367742fb253deef84ef7ccf5e8de] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “font-cid” 22b0367742fb253deef84ef7ccf5e8de] --- if not modules then modules={} end modules ['font-cid']={ version=1.001, @@ -5973,10 +5973,10 @@ function cid.getmap(specification) return found end -end --- [luaotfload, fontloader-2022-06-15.lua scope for “font-cid”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “font-cid”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “font-map” 27ee748150e56f5f0e5f0fefc864f35e] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “font-map” 27ee748150e56f5f0e5f0fefc864f35e] --- if not modules then modules={} end modules ['font-map']={ version=1.001, @@ -6384,10 +6384,10 @@ function mappings.addtounicode(data,filename,checklookups,forceligatures) end end -end --- [luaotfload, fontloader-2022-06-15.lua scope for “font-map”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “font-map”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “font-vfc” a81c29eda98cd62cbebdb6c93544b50d] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “font-vfc” a81c29eda98cd62cbebdb6c93544b50d] --- if not modules then modules={} end modules ['font-vfc']={ version=1.001, @@ -6484,10 +6484,10 @@ helpers.commands=utilities.storage.allocate { dummy=dummy, } -end --- [luaotfload, fontloader-2022-06-15.lua scope for “font-vfc”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “font-vfc”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “font-otr” 1896ac990a961f6d6fec551ca9b52a83] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “font-otr” 1896ac990a961f6d6fec551ca9b52a83] --- if not modules then modules={} end modules ['font-otr']={ version=1.001, @@ -8331,10 +8331,10 @@ function readers.extend(fontdata) end end -end --- [luaotfload, fontloader-2022-06-15.lua scope for “font-otr”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “font-otr”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “font-oti” 309a75f9c14b77d87e94eba827dc4e71] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “font-oti” 309a75f9c14b77d87e94eba827dc4e71] --- if not modules then modules={} end modules ['font-oti']={ version=1.001, @@ -8477,10 +8477,10 @@ function otffeatures.checkeddefaultlanguage(featuretype,autolanguage,languages) end end -end --- [luaotfload, fontloader-2022-06-15.lua scope for “font-oti”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “font-oti”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “font-ott” 3f67b1b1d40bbc222681d8db4aff0f42] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “font-ott” 3f67b1b1d40bbc222681d8db4aff0f42] --- if not modules then modules={} end modules ["font-ott"]={ version=1.001, @@ -9596,10 +9596,10 @@ function otffeatures.normalize(features,wrap) end end -end --- [luaotfload, fontloader-2022-06-15.lua scope for “font-ott”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “font-ott”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “font-cff” e38c1a40e1d1d577cdf7920fa50d0654] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “font-cff” 651c74e4804fbb85d31267210298f466] --- if not modules then modules={} end modules ['font-cff']={ version=1.001, @@ -10149,8 +10149,13 @@ local result={} local justpass=false local seacs={} local procidx=nil - local function showstate(where) - report("%w%-10s : [%s] n=%i",depth*2,where,concat(stack," ",1,top),top) + local function showstate(where,i,n) + if i then + local j=i+n-1 + report("%w%-10s : [%s] step",depth*2+2,where,concat(stack," ",i,j<=top and j or top)) + else + report("%w%-10s : [%s] n=%i",depth*2,where,concat(stack," ",1,top),top) + end end local function showvalue(where,value,showstack) if showstack then @@ -10266,9 +10271,9 @@ local result={} ymin=y end end - local function xycurveto(x1,y1,x2,y2,x3,y3) + local function xycurveto(x1,y1,x2,y2,x3,y3,i,n) if trace_charstrings then - showstate("curveto") + showstate("curveto",i,n) end if keepcurve then r=r+1 @@ -10405,6 +10410,15 @@ local result={} if trace_charstrings then showstate("rrcurveto") end +if top==6 then + local ax=x+stack[1] + local ay=y+stack[2] + local bx=ax+stack[3] + local by=ay+stack[4] + x=bx+stack[5] + y=by+stack[6] + xycurveto(ax,ay,bx,by,x,y,1,6) +else for i=1,top,6 do local ax=x+stack[i] local ay=y+stack[i+1] @@ -10412,8 +10426,9 @@ local result={} local by=ay+stack[i+3] x=bx+stack[i+4] y=by+stack[i+5] - xycurveto(ax,ay,bx,by,x,y) + xycurveto(ax,ay,bx,by,x,y,i,6) end +end top=0 end local function hhcurveto() @@ -10425,6 +10440,15 @@ local result={} y=y+stack[1] s=2 end +if top==4 then + local ax=x+stack[1] + local ay=y + local bx=ax+stack[2] + local by=ay+stack[3] + x=bx+stack[4] + y=by + xycurveto(ax,ay,bx,by,x,y,1,4) +else for i=s,top,4 do local ax=x+stack[i] local ay=y @@ -10432,8 +10456,9 @@ local result={} local by=ay+stack[i+2] x=bx+stack[i+3] y=by - xycurveto(ax,ay,bx,by,x,y) + xycurveto(ax,ay,bx,by,x,y,i,4) end +end top=0 end local function vvcurveto() @@ -10446,6 +10471,16 @@ local result={} d=stack[1] s=2 end +if top==4 then + local ax=x+d + local ay=y+stack[1] + local bx=ax+stack[2] + local by=ay+stack[3] + x=bx + y=by+stack[4] + xycurveto(ax,ay,bx,by,x,y,1,4) + d=0 +else for i=s,top,4 do local ax=x+d local ay=y+stack[i] @@ -10453,9 +10488,10 @@ local result={} local by=ay+stack[i+2] x=bx y=by+stack[i+3] - xycurveto(ax,ay,bx,by,x,y) + xycurveto(ax,ay,bx,by,x,y,i,4) d=0 end +end top=0 end local function xxcurveto(swap) @@ -10463,6 +10499,33 @@ local result={} if last then top=top-1 end +if top==4 then + local ax,ay,bx,by + if swap then + ax=x+stack[1] + ay=y + bx=ax+stack[2] + by=ay+stack[3] + y=by+stack[4] + if last then + x=bx+last + else + x=bx + end + else + ax=x + ay=y+stack[1] + bx=ax+stack[2] + by=ay+stack[3] + x=bx+stack[4] + if last then + y=by+last + else + y=by + end + end + xycurveto(ax,ay,bx,by,x,y,1,4) +else for i=1,top,4 do local ax,ay,bx,by if swap then @@ -10490,8 +10553,9 @@ local result={} end swap=true end - xycurveto(ax,ay,bx,by,x,y) + xycurveto(ax,ay,bx,by,x,y,i,4) end +end top=0 end local function hvcurveto() @@ -10517,7 +10581,7 @@ local result={} local by=ay+stack[i+3] x=bx+stack[i+4] y=by+stack[i+5] - xycurveto(ax,ay,bx,by,x,y) + xycurveto(ax,ay,bx,by,x,y,i,6) end x=x+stack[top-1] y=y+stack[top] @@ -11661,26 +11725,35 @@ local function readfdselect(f,fontdata,data,glyphs,doshapes,version,streams) end end else + report("unsupported fd index format %i",format) end if maxindex>=0 then local cidarray=cid.fdarray if cidarray then setposition(f,header.offset+cidarray) local dictionaries=readlengths(f,version=="cff2") - for i=1,#dictionaries do - dictionaries[i]=readstring(f,dictionaries[i]) - end - parsedictionaries(data,dictionaries) - cid.dictionaries=dictionaries - readcidprivates(f,data) - for i=1,#dictionaries do - readlocals(f,data,dictionaries[i],version) - end - startparsing(fontdata,data,streams) - for i=1,#charstrings do - parsecharstring(fontdata,data,dictionaries[fdindex[i]+1],charstrings[i],glyphs,i,doshapes,version,streams) + if #dictionaries>0 then + for i=1,#dictionaries do + dictionaries[i]=readstring(f,dictionaries[i]) + end + parsedictionaries(data,dictionaries) + cid.dictionaries=dictionaries + readcidprivates(f,data) + for i=1,#dictionaries do + readlocals(f,data,dictionaries[i],version) + end + startparsing(fontdata,data,streams) + for i=1,#charstrings do + local dictionary=dictionaries[fdindex[i]+1] + if dictionary then + parsecharstring(fontdata,data,dictionary,charstrings[i],glyphs,i,doshapes,version,streams) + else + end + end + stopparsing(fontdata,data) + else + report("no cid dictionaries") end - stopparsing(fontdata,data) else report("no cid array") end @@ -11828,10 +11901,10 @@ function readers.cffcheck(filename) end end -end --- [luaotfload, fontloader-2022-06-15.lua scope for “font-cff”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “font-cff”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “font-ttf” a3ff07150b3535fd32f68748d53fcd36] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “font-ttf” a3ff07150b3535fd32f68748d53fcd36] --- if not modules then modules={} end modules ['font-ttf']={ version=1.001, @@ -13091,10 +13164,10 @@ function readers.gvar(f,fontdata,specification,glyphdata,shapedata) end end -end --- [luaotfload, fontloader-2022-06-15.lua scope for “font-ttf”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “font-ttf”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “font-dsp” 4935e6605ffd7bf57e66f0b6c132f883] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “font-dsp” 23a82ec8fdb9f226427e78904402e48a] --- if not modules then modules={} end modules ['font-dsp']={ version=1.001, @@ -16372,10 +16445,10 @@ function readers.mvar(f,fontdata,specification) end end -end --- [luaotfload, fontloader-2022-06-15.lua scope for “font-dsp”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “font-dsp”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “font-oup” 76dc3379061e5650f772909966b5759e] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “font-oup” 76dc3379061e5650f772909966b5759e] --- if not modules then modules={} end modules ['font-oup']={ version=1.001, @@ -19213,10 +19286,10 @@ end expandlookups(sublookups,sequences) end -end --- [luaotfload, fontloader-2022-06-15.lua scope for “font-oup”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “font-oup”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “font-otl” 308b1aab04bc131da7eb8e8c3b0471d4] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “font-otl” 308b1aab04bc131da7eb8e8c3b0471d4] --- if not modules then modules={} end modules ['font-otl']={ version=1.001, @@ -19944,10 +20017,10 @@ otf.coverup={ end } -end --- [luaotfload, fontloader-2022-06-15.lua scope for “font-otl”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “font-otl”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “font-oto” 9febc4d75d17a543cd73fb17918f7307] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “font-oto” 9febc4d75d17a543cd73fb17918f7307] --- if not modules then modules={} end modules ['font-oto']={ version=1.001, @@ -20416,10 +20489,10 @@ registerotffeature { } otf.basemodeinitializer=featuresinitializer -end --- [luaotfload, fontloader-2022-06-15.lua scope for “font-oto”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “font-oto”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “font-otj” b2c165bd6771a57633f992d07384b739] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “font-otj” b2c165bd6771a57633f992d07384b739] --- if not modules then modules={} end modules ['font-otj']={ version=1.001, @@ -21912,10 +21985,10 @@ function injections.handler(head,where) end end -end --- [luaotfload, fontloader-2022-06-15.lua scope for “font-otj”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “font-otj”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “font-ota” 2bb12d708e35bc05443eba791e2554e7] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “font-ota” 2bb12d708e35bc05443eba791e2554e7] --- if not modules then modules={} end modules ['font-ota']={ version=1.001, @@ -22409,10 +22482,10 @@ directives.register("otf.analyze.useunicodemarks",function(v) analyzers.useunicodemarks=v end) -end --- [luaotfload, fontloader-2022-06-15.lua scope for “font-ota”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “font-ota”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “font-ots” 55316a605d11a1d07d38795224c90a63] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “font-ots” 55316a605d11a1d07d38795224c90a63] --- if not modules then modules={} end modules ['font-ots']={ version=1.001, @@ -26072,10 +26145,10 @@ registerotffeature { }, } -end --- [luaotfload, fontloader-2022-06-15.lua scope for “font-ots”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “font-ots”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “font-osd” 9b5337b0051b8e42b6c8329127c59794] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “font-osd” 1716513d8fe5f28e0e88daad2be0e05b] --- if not modules then modules={} end modules ['font-osd']={ version=1.001, @@ -26084,14 +26157,6 @@ if not modules then modules={} end modules ['font-osd']={ copyright="TAT Zetwerk / PRAGMA ADE / ConTeXt Development Team", license="see context related readme files" } -local experiment1=false -local experiment2=false -local experiment2b1=false -local experiment2b2=false -experiments.register("fonts.indic.experiment1",function(v) experiment1=v end) -experiments.register("fonts.indic.experiment2",function(v) experiment2=v end) -experiments.register("fonts.indic.experiment2b1",function(v) experiment2b1=v end) -experiments.register("fonts.indic.experiment2b2",function(v) experiment2b2=v end) local insert,remove,imerge,copy,tohash=table.insert,table.remove,table.imerge,table.copy,table.tohash local next,type,rawget=next,type,rawget local formatters=string.formatters @@ -28716,10 +28781,10 @@ for i=1,nofscripts do methods[scripts_two[i]]=method_two end -end --- [luaotfload, fontloader-2022-06-15.lua scope for “font-osd”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “font-osd”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “font-ocl” 2a377351ae23c339764ec8ce2e8e9164] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “font-ocl” 2a377351ae23c339764ec8ce2e8e9164] --- if not modules then modules={} end modules ['font-ocl']={ version=1.001, @@ -29267,10 +29332,10 @@ if context then } end -end --- [luaotfload, fontloader-2022-06-15.lua scope for “font-ocl”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “font-ocl”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “font-otc” 57f5270b894e40efa93149c7d3fb0209] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “font-otc” 57f5270b894e40efa93149c7d3fb0209] --- if not modules then modules={} end modules ['font-otc']={ version=1.001, @@ -30094,10 +30159,10 @@ end otf.enhancers.enhance=enhance otf.enhancers.register("check extra features",enhance) -end --- [luaotfload, fontloader-2022-06-15.lua scope for “font-otc”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “font-otc”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “font-onr” 6d161533f3437435e12a0ad64866df44] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “font-onr” 6d161533f3437435e12a0ad64866df44] --- if not modules then modules={} end modules ['font-onr']={ version=1.001, @@ -30470,10 +30535,10 @@ function readers.getinfo(filename) end end -end --- [luaotfload, fontloader-2022-06-15.lua scope for “font-onr”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “font-onr”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “font-one” bd39d42055a44ca2002f8ddbbbbf27c3] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “font-one” bd39d42055a44ca2002f8ddbbbbf27c3] --- if not modules then modules={} end modules ['font-one']={ version=1.001, @@ -31188,10 +31253,10 @@ registerafmenhancer("normalize features",enhance_normalize_features) registerafmenhancer("check extra features",otfenhancers.enhance) registerafmenhancer("fix names",enhance_fix_names) -end --- [luaotfload, fontloader-2022-06-15.lua scope for “font-one”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “font-one”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “font-afk” 9da14e0fb22129c053acc599d1312544] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “font-afk” 9da14e0fb22129c053acc599d1312544] --- if not modules then modules={} end modules ['font-afk']={ version=1.001, @@ -31358,10 +31423,10 @@ fonts.handlers.afm.helpdata={ } } -end --- [luaotfload, fontloader-2022-06-15.lua scope for “font-afk”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “font-afk”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “fonts-tfm” f0eb5e2a8068b17ad401bb7efdba1630] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “fonts-tfm” f0eb5e2a8068b17ad401bb7efdba1630] --- if not modules then modules={} end modules ['luatex-fonts-tfm']={ version=1.001, @@ -31876,10 +31941,10 @@ registertfmfeature { } } -end --- [luaotfload, fontloader-2022-06-15.lua scope for “fonts-tfm”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “fonts-tfm”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “font-lua” 1fbfdf7b689b2bdfd0e3bb9bf74ce136] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “font-lua” 1fbfdf7b689b2bdfd0e3bb9bf74ce136] --- if not modules then modules={} end modules ['font-lua']={ version=1.001, @@ -31919,10 +31984,10 @@ function readers.lua(specification) return check_lua(specification,fullname) end -end --- [luaotfload, fontloader-2022-06-15.lua scope for “font-lua”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “font-lua”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “font-def” b9d908c2338b7dc443ce9d1e9fcb7139] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “font-def” b9d908c2338b7dc443ce9d1e9fcb7139] --- if not modules then modules={} end modules ['font-def']={ version=1.001, @@ -32322,10 +32387,10 @@ if not context then callbacks.register('define_font',definers.read,"definition of fonts (tfmdata preparation)") end -end --- [luaotfload, fontloader-2022-06-15.lua scope for “font-def”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “font-def”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “font-shp” a40862fe382d26c1f3753431254bcfdd] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “font-shp” a40862fe382d26c1f3753431254bcfdd] --- if not modules then modules={} end modules ['font-shp']={ version=1.001, @@ -32690,10 +32755,10 @@ callback.register("glyph_stream_provider",function(id,index,mode) return "" end) -end --- [luaotfload, fontloader-2022-06-15.lua scope for “font-shp”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “font-shp”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “fonts-def” f435e0875f203f343157baeff876ec9c] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “fonts-def” f435e0875f203f343157baeff876ec9c] --- if not modules then modules={} end modules ['luatex-fonts-def']={ version=1.001, @@ -32774,10 +32839,10 @@ function fonts.definers.applypostprocessors(tfmdata) return tfmdata end -end --- [luaotfload, fontloader-2022-06-15.lua scope for “fonts-def”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “fonts-def”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “fonts-ext” 32013cbc5d5d336be8b1d1e5879d86c4] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “fonts-ext” 32013cbc5d5d336be8b1d1e5879d86c4] --- if not modules then modules={} end modules ['luatex-fonts-ext']={ version=1.001, @@ -32963,10 +33028,10 @@ registerotffeature { } } -end --- [luaotfload, fontloader-2022-06-15.lua scope for “fonts-ext”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “fonts-ext”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “font-imp-tex” ceb087ef6fa2f89aed7179f60ddf8f35] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “font-imp-tex” ceb087ef6fa2f89aed7179f60ddf8f35] --- if not modules then modules={} end modules ['font-imp-tex']={ version=1.001, @@ -33065,10 +33130,10 @@ registerotffeature { description="arabic digits", } -end --- [luaotfload, fontloader-2022-06-15.lua scope for “font-imp-tex”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “font-imp-tex”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “font-imp-ligatures” 250f6f4488ee770c23177afb2ff75676] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “font-imp-ligatures” 250f6f4488ee770c23177afb2ff75676] --- if not modules then modules={} end modules ['font-imp-ligatures']={ version=1.001, @@ -33182,10 +33247,10 @@ if context then } end -end --- [luaotfload, fontloader-2022-06-15.lua scope for “font-imp-ligatures”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “font-imp-ligatures”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “font-imp-italics” defcb415bc1e0a0999b27773902adc18] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “font-imp-italics” defcb415bc1e0a0999b27773902adc18] --- if not modules then modules={} end modules ['font-imp-italics']={ version=1.001, @@ -33289,10 +33354,10 @@ if context then registerafmfeature(dimensions_specification) end -end --- [luaotfload, fontloader-2022-06-15.lua scope for “font-imp-italics”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “font-imp-italics”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “font-imp-effects” d05997c1826355548ec9aec1346f9f23] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “font-imp-effects” d05997c1826355548ec9aec1346f9f23] --- if not modules then modules={} end modules ['font-imp-effects']={ version=1.001, @@ -33649,10 +33714,10 @@ local specification={ registerotffeature(specification) registerafmfeature(specification) -end --- [luaotfload, fontloader-2022-06-15.lua scope for “font-imp-effects”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “font-imp-effects”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “fonts-lig” fbd251eea3810a43a8d5542319361d68] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “fonts-lig” fbd251eea3810a43a8d5542319361d68] --- fonts.handlers.otf.addfeature { @@ -35721,10 +35786,10 @@ fonts.handlers.otf.addfeature { ["type"]="ligature", } -end --- [luaotfload, fontloader-2022-06-15.lua scope for “fonts-lig”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “fonts-lig”] --- -do --- [luaotfload, fontloader-2022-06-15.lua scope for “fonts-gbn” 34e4543a02f6fbc8c2ade896cb6dc7df] --- +do --- [luaotfload, fontloader-2022-10-03.lua scope for “fonts-gbn” 34e4543a02f6fbc8c2ade896cb6dc7df] --- if not modules then modules={} end modules ['luatex-fonts-gbn']={ version=1.001, @@ -35989,7 +36054,7 @@ function nodes.simple_font_handler(head,groupcode,size,packtype,direction) return head end -end --- [luaotfload, fontloader-2022-06-15.lua scope for “fonts-gbn”] --- +end --- [luaotfload, fontloader-2022-10-03.lua scope for “fonts-gbn”] --- --- vim:ft=lua:sw=2:ts=8:et:tw=79 diff --git a/src/auto/luaotfload-status.lua b/src/auto/luaotfload-status.lua index 38d5cf97..58ba9bbc 100644 --- a/src/auto/luaotfload-status.lua +++ b/src/auto/luaotfload-status.lua @@ -1,10 +1,10 @@ return { ["hashes"]={ - { "fontloader-2022-06-15.lua", "1d9c716b5c1d6ff84bee5e4ba3631eac" }, + { "fontloader-2022-10-03.lua", "f5384fb6e665b4c3af844e55c9890073" }, { "fontloader-util-fil.lua", "d0accf4180201efd567816a25ad5e037" }, { "fontloader-util-str.lua", "f4a9dd15c3e40cd3915749ac13837c95" }, { "fontloader-l-unicode.lua", "f368874f11f3c525de5864fd413e4b24" }, - { "fontloader-l-math.lua", "5a0740b359e2d55d6dca06a23e3c9df6" }, + { "fontloader-l-math.lua", "e19c80b7e700a69df942d4df2e14aa28" }, { "fontloader-l-boolean.lua", "abe28515dd33e8f6c416c09bca351cf8" }, { "fontloader-l-file.lua", "5839d88d4de96b9e9c7e7f8f8eb885b3" }, { "fontloader-l-io.lua", "3396a8644bae37e49b2cfc0c388c78f8" }, @@ -33,7 +33,7 @@ return { { "fontloader-font-one.lua", "bd39d42055a44ca2002f8ddbbbbf27c3" }, { "fontloader-font-onr.lua", "6d161533f3437435e12a0ad64866df44" }, { "fontloader-font-ocl.lua", "2a377351ae23c339764ec8ce2e8e9164" }, - { "fontloader-font-osd.lua", "9b5337b0051b8e42b6c8329127c59794" }, + { "fontloader-font-osd.lua", "1716513d8fe5f28e0e88daad2be0e05b" }, { "fontloader-font-otc.lua", "57f5270b894e40efa93149c7d3fb0209" }, { "fontloader-font-ots.lua", "55316a605d11a1d07d38795224c90a63" }, { "fontloader-font-ota.lua", "2bb12d708e35bc05443eba791e2554e7" }, @@ -43,9 +43,9 @@ return { { "fontloader-font-otl.lua", "308b1aab04bc131da7eb8e8c3b0471d4" }, { "fontloader-font-ott.lua", "3f67b1b1d40bbc222681d8db4aff0f42" }, { "fontloader-font-oti.lua", "309a75f9c14b77d87e94eba827dc4e71" }, - { "fontloader-font-dsp.lua", "4935e6605ffd7bf57e66f0b6c132f883" }, + { "fontloader-font-dsp.lua", "23a82ec8fdb9f226427e78904402e48a" }, { "fontloader-font-ttf.lua", "a3ff07150b3535fd32f68748d53fcd36" }, - { "fontloader-font-cff.lua", "e38c1a40e1d1d577cdf7920fa50d0654" }, + { "fontloader-font-cff.lua", "651c74e4804fbb85d31267210298f466" }, { "fontloader-font-otr.lua", "1896ac990a961f6d6fec551ca9b52a83" }, { "fontloader-font-vfc.lua", "a81c29eda98cd62cbebdb6c93544b50d" }, { "fontloader-font-map.lua", "27ee748150e56f5f0e5f0fefc864f35e" }, @@ -53,7 +53,7 @@ return { { "fontloader-font-con.lua", "724e5dd14aec2d4d189f8619898004cf" }, { "fontloader-font-ini.lua", "5343de60613adb24cdd7a8d2ee1d153c" }, { "fontloader-data-con.lua", "23a0f5386d46a1c157ae82a373e35fa0" }, - { "fontloader-reference.lua", "c256fdcc4661bf9c868002fe0f996d73" }, + { "fontloader-reference.lua", "e4b70de7191ba92ba3b859427eeca91c" }, { "fontloader-basics-gen.lua", "e470c13b1ed41e38932e93518219ad74" }, { "mktests", "918cb50be9ee8bd645ac1a27dc501e8c" }, { "mkstatus", "6487aa14651883312acefcb6fe988598" }, @@ -62,26 +62,26 @@ return { { "mkimport", "7d62f1042e548f8b9368f26b9ba4be5c" }, { "luaotfload-glyphlist.lua", "3653e1b9e2b29a47f1df188494ed3840" }, { "luaotfload-characters.lua", "76415ca3ede312cad6e09038323489ae" }, - { "luaotfload-dvi.lua", "4ae70e6801d9597713901ef8fa02d46f" }, + { "luaotfload-dvi.lua", "68e541a3f0e37eb55e62b04fead5af1a" }, { "luaotfload-tounicode.lua", "f7012c514f4563f8a75daa496579a7a6" }, { "luaotfload-unicode.lua", "f08d1981023dc335af0f09b3655174d3" }, { "luaotfload-resolvers.lua", "fdebf1737c75a5236088f5b8a7e0d36a" }, - { "luaotfload-parsers.lua", "f88898f77e85beb716495449c129bf69" }, + { "luaotfload-parsers.lua", "9e1b8873be92a80ee14d8247bc173367" }, { "luaotfload-fallback.lua", "3ebc4967f8b1a80224cf08968c64767e" }, { "luaotfload-szss.lua", "f6e32007d4131ca3a5ef4d6cda09812a" }, { "luaotfload-scripts.lua", "7bea4bed3c1345cec43c9e25007ed672" }, { "luaotfload-multiscript.lua", "12d97b2faf47478bf26d54539a3a6eae" }, { "luaotfload-loaders.lua", "f1d094c8313b15334d36a1fe81b81b39" }, - { "luaotfload-harf-plug.lua", "c098aeb6502aad3a158e85ebe638e0eb" }, - { "luaotfload-harf-define.lua", "985444f4afeed3da801de9bcc98a388e" }, + { "luaotfload-harf-plug.lua", "0b7dcaa97d00e58fba870e11b5ef9747" }, + { "luaotfload-harf-define.lua", "08c42d6c55f0aaa7714216de90b401be" }, { "luaotfload-notdef.lua", "7066b19487e91803517736881dbe2be1" }, { "luaotfload-embolden.lua", "de2cb4cfb1269013e3b5d078ded29d39" }, { "luaotfload-letterspace.lua", "d89d218e15b3e956df9a3a564ab5523d" }, - { "luaotfload-features.lua", "72bdfd6826a1c2d406a189048d97934a" }, + { "luaotfload-features.lua", "d49c4e28c64e56062c08d666191ef81a" }, { "luaotfload-database.lua", "b58e88cae340c5e47ddf423f307ba27a" }, { "luaotfload-configuration.lua", "87fd6bd96c303652cfe6bcecfbbc2bc2" }, { "luaotfload-colors.lua", "29a29c642d968c4a5a93727398f16258" }, - { "luaotfload-auxiliary.lua", "beceab9a06423d5e74f57980f9aee2e7" }, + { "luaotfload-auxiliary.lua", "d82490e14cf750fa9437b07a7966b38f" }, { "luaotfload-filelist.lua", "d6ebbd2138bc6d419d961842fd827307" }, { "luaotfload-tool.lua", "8688bde3f193428a8c862d83d1d2f385" }, { "luaotfload-diagnostics.lua", "4a8e1a6c90dea50544f636dc4265bb55" }, @@ -92,8 +92,8 @@ return { ["notes"]={ ["committer"]="Marcel Fabian Krüger ", ["description"]="v3.22-dev/2022-03-18", - ["loader"]="fontloader-2022-06-15.lua", - ["revision"]="af58588d7b70c357f0cf9feb766e51a21f12d635", - ["timestamp"]="2022-06-15 18:29:42 +0200", + ["loader"]="fontloader-2022-10-03.lua", + ["revision"]="bddb9f312a59806b3a4ef3b0f6e36134f4b08923", + ["timestamp"]="2022-10-03 20:18:03 +0200", }, } \ No newline at end of file diff --git a/src/fontloader/misc/fontloader-font-cff.lua b/src/fontloader/misc/fontloader-font-cff.lua index 4258991c..114d7dd0 100644 --- a/src/fontloader/misc/fontloader-font-cff.lua +++ b/src/fontloader/misc/fontloader-font-cff.lua @@ -735,8 +735,13 @@ local result = { } local seacs = { } local procidx = nil - local function showstate(where) - report("%w%-10s : [%s] n=%i",depth*2,where,concat(stack," ",1,top),top) + local function showstate(where,i,n) + if i then + local j = i + n - 1 + report("%w%-10s : [%s] step",depth*2+2,where,concat(stack," ",i,j <= top and j or top)) + else + report("%w%-10s : [%s] n=%i",depth*2,where,concat(stack," ",1,top),top) + end end local function showvalue(where,value,showstack) @@ -873,9 +878,9 @@ local result = { } end end - local function xycurveto(x1,y1,x2,y2,x3,y3) -- called local so no blend here + local function xycurveto(x1,y1,x2,y2,x3,y3,i,n) -- called local so no blend here if trace_charstrings then - showstate("curveto") + showstate("curveto",i,n) end if keepcurve then r = r + 1 @@ -1019,6 +1024,16 @@ local result = { } if trace_charstrings then showstate("rrcurveto") end +if top == 6 then + local ax = x + stack[1] -- dxa + local ay = y + stack[2] -- dya + local bx = ax + stack[3] -- dxb + local by = ay + stack[4] -- dyb + x = bx + stack[5] -- dxc + y = by + stack[6] -- dyc + xycurveto(ax,ay,bx,by,x,y,1,6) +else +-- print("rr",top==6,top) for i=1,top,6 do local ax = x + stack[i] -- dxa local ay = y + stack[i+1] -- dya @@ -1026,8 +1041,9 @@ local result = { } local by = ay + stack[i+3] -- dyb x = bx + stack[i+4] -- dxc y = by + stack[i+5] -- dyc - xycurveto(ax,ay,bx,by,x,y) + xycurveto(ax,ay,bx,by,x,y,i,6) end +end top = 0 end @@ -1040,6 +1056,15 @@ local result = { } y = y + stack[1] -- dy1 s = 2 end +if top == 4 then + local ax = x + stack[1] -- dxa + local ay = y + local bx = ax + stack[2] -- dxb + local by = ay + stack[3] -- dyb + x = bx + stack[4] -- dxc + y = by + xycurveto(ax,ay,bx,by,x,y,1,4) +else for i=s,top,4 do local ax = x + stack[i] -- dxa local ay = y @@ -1047,8 +1072,9 @@ local result = { } local by = ay + stack[i+2] -- dyb x = bx + stack[i+3] -- dxc y = by - xycurveto(ax,ay,bx,by,x,y) + xycurveto(ax,ay,bx,by,x,y,i,4) end +end top = 0 end @@ -1062,6 +1088,16 @@ local result = { } d = stack[1] -- dx1 s = 2 end +if top == 4 then + local ax = x + d + local ay = y + stack[1] -- dya + local bx = ax + stack[2] -- dxb + local by = ay + stack[3] -- dyb + x = bx + y = by + stack[4] -- dyc + xycurveto(ax,ay,bx,by,x,y,1,4) + d = 0 +else for i=s,top,4 do local ax = x + d local ay = y + stack[i] -- dya @@ -1069,9 +1105,10 @@ local result = { } local by = ay + stack[i+2] -- dyb x = bx y = by + stack[i+3] -- dyc - xycurveto(ax,ay,bx,by,x,y) + xycurveto(ax,ay,bx,by,x,y,i,4) d = 0 end +end top = 0 end @@ -1080,6 +1117,33 @@ local result = { } if last then top = top - 1 end +if top == 4 then + local ax, ay, bx, by + if swap then + ax = x + stack[1] + ay = y + bx = ax + stack[2] + by = ay + stack[3] + y = by + stack[4] + if last then + x = bx + last + else + x = bx + end + else + ax = x + ay = y + stack[1] + bx = ax + stack[2] + by = ay + stack[3] + x = bx + stack[4] + if last then + y = by + last + else + y = by + end + end + xycurveto(ax,ay,bx,by,x,y,1 ,4) +else for i=1,top,4 do local ax, ay, bx, by if swap then @@ -1107,8 +1171,9 @@ local result = { } end swap = true end - xycurveto(ax,ay,bx,by,x,y) + xycurveto(ax,ay,bx,by,x,y,i,4) end +end top = 0 end @@ -1137,7 +1202,7 @@ local result = { } local by = ay + stack[i+3] -- dyb x = bx + stack[i+4] -- dxc y = by + stack[i+5] -- dyc - xycurveto(ax,ay,bx,by,x,y) + xycurveto(ax,ay,bx,by,x,y,i,6) end x = x + stack[top-1] -- dxc y = y + stack[top] -- dyc @@ -2531,7 +2596,7 @@ local function readfdselect(f,fontdata,data,glyphs,doshapes,version,streams) end end else - -- unsupported format + report("unsupported fd index format %i",format) end -- hm, always if maxindex >= 0 then @@ -2539,21 +2604,30 @@ local function readfdselect(f,fontdata,data,glyphs,doshapes,version,streams) if cidarray then setposition(f,header.offset+cidarray) local dictionaries = readlengths(f,version == "cff2") - for i=1,#dictionaries do - dictionaries[i] = readstring(f,dictionaries[i]) - end - parsedictionaries(data,dictionaries) - cid.dictionaries = dictionaries - readcidprivates(f,data) - for i=1,#dictionaries do - readlocals(f,data,dictionaries[i],version) - end - startparsing(fontdata,data,streams) - for i=1,#charstrings do - parsecharstring(fontdata,data,dictionaries[fdindex[i]+1],charstrings[i],glyphs,i,doshapes,version,streams) --- charstrings[i] = nil + if #dictionaries > 0 then + for i=1,#dictionaries do + dictionaries[i] = readstring(f,dictionaries[i]) + end + parsedictionaries(data,dictionaries) + cid.dictionaries = dictionaries + readcidprivates(f,data) + for i=1,#dictionaries do + readlocals(f,data,dictionaries[i],version) + end + startparsing(fontdata,data,streams) + for i=1,#charstrings do + local dictionary = dictionaries[fdindex[i]+1] + if dictionary then + parsecharstring(fontdata,data,dictionary,charstrings[i],glyphs,i,doshapes,version,streams) + else + -- report("no dictionary for %a : %a => %a",version,i,fdindex[i]+1) + end + -- charstrings[i] = false + end + stopparsing(fontdata,data) + else + report("no cid dictionaries") end - stopparsing(fontdata,data) else report("no cid array") end diff --git a/src/fontloader/misc/fontloader-font-dsp.lua b/src/fontloader/misc/fontloader-font-dsp.lua index d0367832..8f65ed9d 100644 --- a/src/fontloader/misc/fontloader-font-dsp.lua +++ b/src/fontloader/misc/fontloader-font-dsp.lua @@ -2515,6 +2515,8 @@ do local scriptoffset = tableoffset + readushort(f) local featureoffset = tableoffset + readushort(f) local lookupoffset = tableoffset + readushort(f) + -- MFK : Rubik-Regular.ttf : we need to delay adding the offset + -- local variationsoffset = version > 0x00010000 and (tableoffset + readulong(f)) or 0 local variationsoffset = version > 0x00010000 and readulong(f) or 0 if not scriptoffset then return @@ -2541,6 +2543,7 @@ do end -- if variationsoffset > 0 then + -- loadvariations(f,fontdata,variationsoffset,lookuptypes,featurehash,featureorder) loadvariations(f,fontdata,tableoffset + variationsoffset,lookuptypes,featurehash,featureorder) end end diff --git a/src/fontloader/misc/fontloader-font-osd.lua b/src/fontloader/misc/fontloader-font-osd.lua index d169faf6..ecf8009f 100644 --- a/src/fontloader/misc/fontloader-font-osd.lua +++ b/src/fontloader/misc/fontloader-font-osd.lua @@ -6,15 +6,15 @@ if not modules then modules = { } end modules ['font-osd'] = { -- script devanag license = "see context related readme files" } -local experiment1 = false -local experiment2 = false -local experiment2b1 = false -local experiment2b2 = false - -experiments.register("fonts.indic.experiment1", function(v) experiment1 = v end) -experiments.register("fonts.indic.experiment2", function(v) experiment2 = v end) -experiments.register("fonts.indic.experiment2b1", function(v) experiment2b1 = v end) -experiments.register("fonts.indic.experiment2b2", function(v) experiment2b2 = v end) +-- local experiment1 = false +-- local experiment2 = false +-- local experiment2b1 = false +-- local experiment2b2 = false + +-- experiments.register("fonts.indic.experiment1", function(v) experiment1 = v end) +-- experiments.register("fonts.indic.experiment2", function(v) experiment2 = v end) +-- experiments.register("fonts.indic.experiment2b1", function(v) experiment2b1 = v end) +-- experiments.register("fonts.indic.experiment2b2", function(v) experiment2b2 = v end) -- we need to check nbsphash (context only) diff --git a/src/fontloader/misc/fontloader-l-math.lua b/src/fontloader/misc/fontloader-l-math.lua index 69f0a19e..6105bc3c 100644 --- a/src/fontloader/misc/fontloader-l-math.lua +++ b/src/fontloader/misc/fontloader-l-math.lua @@ -14,9 +14,19 @@ end if not math.round then - local floor = math.floor + if xmath then + + math.round = xmath.round + + else - function math.round(x) return floor(x + 0.5) end + local floor = math.floor + + function math.round(x) + return x < 0 and -floor(-x + 0.5) or floor(x + 0.5) + end + + end end diff --git a/src/fontloader/runtime/fontloader-reference.lua b/src/fontloader/runtime/fontloader-reference.lua index 13389b29..c539d886 100644 --- a/src/fontloader/runtime/fontloader-reference.lua +++ b/src/fontloader/runtime/fontloader-reference.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 : 2022-05-11 11:34 +-- merge date : 2022-09-16 14:39 do -- begin closure to overcome local limits and interference @@ -3031,8 +3031,14 @@ if not math.ceiling then math.ceiling=math.ceil end if not math.round then - local floor=math.floor - function math.round(x) return floor(x+0.5) end + if xmath then + math.round=xmath.round + else + local floor=math.floor + function math.round(x) + return x<0 and -floor(-x+0.5) or floor(x+0.5) + end + end end if not math.div then local floor=math.floor @@ -13696,8 +13702,13 @@ local result={} local justpass=false local seacs={} local procidx=nil - local function showstate(where) - report("%w%-10s : [%s] n=%i",depth*2,where,concat(stack," ",1,top),top) + local function showstate(where,i,n) + if i then + local j=i+n-1 + report("%w%-10s : [%s] step",depth*2+2,where,concat(stack," ",i,j<=top and j or top)) + else + report("%w%-10s : [%s] n=%i",depth*2,where,concat(stack," ",1,top),top) + end end local function showvalue(where,value,showstack) if showstack then @@ -13813,9 +13824,9 @@ local result={} ymin=y end end - local function xycurveto(x1,y1,x2,y2,x3,y3) + local function xycurveto(x1,y1,x2,y2,x3,y3,i,n) if trace_charstrings then - showstate("curveto") + showstate("curveto",i,n) end if keepcurve then r=r+1 @@ -13952,6 +13963,15 @@ local result={} if trace_charstrings then showstate("rrcurveto") end +if top==6 then + local ax=x+stack[1] + local ay=y+stack[2] + local bx=ax+stack[3] + local by=ay+stack[4] + x=bx+stack[5] + y=by+stack[6] + xycurveto(ax,ay,bx,by,x,y,1,6) +else for i=1,top,6 do local ax=x+stack[i] local ay=y+stack[i+1] @@ -13959,8 +13979,9 @@ local result={} local by=ay+stack[i+3] x=bx+stack[i+4] y=by+stack[i+5] - xycurveto(ax,ay,bx,by,x,y) + xycurveto(ax,ay,bx,by,x,y,i,6) end +end top=0 end local function hhcurveto() @@ -13972,6 +13993,15 @@ local result={} y=y+stack[1] s=2 end +if top==4 then + local ax=x+stack[1] + local ay=y + local bx=ax+stack[2] + local by=ay+stack[3] + x=bx+stack[4] + y=by + xycurveto(ax,ay,bx,by,x,y,1,4) +else for i=s,top,4 do local ax=x+stack[i] local ay=y @@ -13979,8 +14009,9 @@ local result={} local by=ay+stack[i+2] x=bx+stack[i+3] y=by - xycurveto(ax,ay,bx,by,x,y) + xycurveto(ax,ay,bx,by,x,y,i,4) end +end top=0 end local function vvcurveto() @@ -13993,6 +14024,16 @@ local result={} d=stack[1] s=2 end +if top==4 then + local ax=x+d + local ay=y+stack[1] + local bx=ax+stack[2] + local by=ay+stack[3] + x=bx + y=by+stack[4] + xycurveto(ax,ay,bx,by,x,y,1,4) + d=0 +else for i=s,top,4 do local ax=x+d local ay=y+stack[i] @@ -14000,9 +14041,10 @@ local result={} local by=ay+stack[i+2] x=bx y=by+stack[i+3] - xycurveto(ax,ay,bx,by,x,y) + xycurveto(ax,ay,bx,by,x,y,i,4) d=0 end +end top=0 end local function xxcurveto(swap) @@ -14010,6 +14052,33 @@ local result={} if last then top=top-1 end +if top==4 then + local ax,ay,bx,by + if swap then + ax=x+stack[1] + ay=y + bx=ax+stack[2] + by=ay+stack[3] + y=by+stack[4] + if last then + x=bx+last + else + x=bx + end + else + ax=x + ay=y+stack[1] + bx=ax+stack[2] + by=ay+stack[3] + x=bx+stack[4] + if last then + y=by+last + else + y=by + end + end + xycurveto(ax,ay,bx,by,x,y,1,4) +else for i=1,top,4 do local ax,ay,bx,by if swap then @@ -14037,8 +14106,9 @@ local result={} end swap=true end - xycurveto(ax,ay,bx,by,x,y) + xycurveto(ax,ay,bx,by,x,y,i,4) end +end top=0 end local function hvcurveto() @@ -14064,7 +14134,7 @@ local result={} local by=ay+stack[i+3] x=bx+stack[i+4] y=by+stack[i+5] - xycurveto(ax,ay,bx,by,x,y) + xycurveto(ax,ay,bx,by,x,y,i,6) end x=x+stack[top-1] y=y+stack[top] @@ -15208,26 +15278,35 @@ local function readfdselect(f,fontdata,data,glyphs,doshapes,version,streams) end end else + report("unsupported fd index format %i",format) end if maxindex>=0 then local cidarray=cid.fdarray if cidarray then setposition(f,header.offset+cidarray) local dictionaries=readlengths(f,version=="cff2") - for i=1,#dictionaries do - dictionaries[i]=readstring(f,dictionaries[i]) - end - parsedictionaries(data,dictionaries) - cid.dictionaries=dictionaries - readcidprivates(f,data) - for i=1,#dictionaries do - readlocals(f,data,dictionaries[i],version) - end - startparsing(fontdata,data,streams) - for i=1,#charstrings do - parsecharstring(fontdata,data,dictionaries[fdindex[i]+1],charstrings[i],glyphs,i,doshapes,version,streams) + if #dictionaries>0 then + for i=1,#dictionaries do + dictionaries[i]=readstring(f,dictionaries[i]) + end + parsedictionaries(data,dictionaries) + cid.dictionaries=dictionaries + readcidprivates(f,data) + for i=1,#dictionaries do + readlocals(f,data,dictionaries[i],version) + end + startparsing(fontdata,data,streams) + for i=1,#charstrings do + local dictionary=dictionaries[fdindex[i]+1] + if dictionary then + parsecharstring(fontdata,data,dictionary,charstrings[i],glyphs,i,doshapes,version,streams) + else + end + end + stopparsing(fontdata,data) + else + report("no cid dictionaries") end - stopparsing(fontdata,data) else report("no cid array") end @@ -18685,7 +18764,7 @@ do local scriptoffset=tableoffset+readushort(f) local featureoffset=tableoffset+readushort(f) local lookupoffset=tableoffset+readushort(f) - local variationsoffset=version>0x00010000 and (tableoffset+readulong(f)) or 0 + local variationsoffset=version>0x00010000 and readulong(f) or 0 if not scriptoffset then return end @@ -18705,7 +18784,7 @@ do resolvelookups(f,lookupoffset,fontdata,lookups,lookuptypes,lookuphandlers,what,tableoffset) end if variationsoffset>0 then - loadvariations(f,fontdata,variationsoffset,lookuptypes,featurehash,featureorder) + loadvariations(f,fontdata,tableoffset+variationsoffset,lookuptypes,featurehash,featureorder) end end end @@ -31706,14 +31785,6 @@ if not modules then modules={} end modules ['font-osd']={ copyright="TAT Zetwerk / PRAGMA ADE / ConTeXt Development Team", license="see context related readme files" } -local experiment1=false -local experiment2=false -local experiment2b1=false -local experiment2b2=false -experiments.register("fonts.indic.experiment1",function(v) experiment1=v end) -experiments.register("fonts.indic.experiment2",function(v) experiment2=v end) -experiments.register("fonts.indic.experiment2b1",function(v) experiment2b1=v end) -experiments.register("fonts.indic.experiment2b2",function(v) experiment2b2=v end) local insert,remove,imerge,copy,tohash=table.insert,table.remove,table.imerge,table.copy,table.tohash local next,type,rawget=next,type,rawget local formatters=string.formatters