diff options
author | Karl Berry <karl@freefriends.org> | 2021-05-21 21:05:05 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-05-21 21:05:05 +0000 |
commit | 18c4b51ca1b98fb507d18afb9dbf02c3f0dd4baf (patch) | |
tree | 40df74fcad10980ff11a5c7a5dd2227af9ff7e2d /Master/texmf-dist/tex/luatex | |
parent | b1faafa7a3280da5554864dc3b75351f780b7c74 (diff) |
luaotfload (21may21)
git-svn-id: svn://tug.org/texlive/trunk@59293 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex')
50 files changed, 2395 insertions, 2607 deletions
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-2021-01-07.lua b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-2021-05-20.lua index e333584b006..f5416680997 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-2021-01-07.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-2021-05-20.lua @@ -1,6 +1,6 @@ --[[info----------------------------------------------------------------------- Luaotfload fontloader package - build 2021-01-07 23:19:37 + build 2021-05-20 19:43:52 ------------------------------------------------------------------------------- © 2021 PRAGMA ADE / ConTeXt Development Team @@ -63,7 +63,7 @@ --info]]----------------------------------------------------------------------- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “data-con” 23a0f5386d46a1c157ae82a373e35fa0] --- +do --- [luaotfload, fontloader-2021-05-20.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-2021-01-07.lua scope for “data-con”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “data-con”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “basics-nod” 4b5c3c63e19df1b3f37fae7f87c25bda] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “basics-nod” b2e0a0e5e1e27349aed464fa738b8db1] --- if not modules then modules={} end modules ['luatex-fonts-nod']={ version=1.001, @@ -241,8 +241,8 @@ nodes.nodecodes=nodecodes nodes.glyphcodes=glyphcodes nodes.disccodes=disccodes nodes.dirvalues={ lefttoright=0,righttoleft=1 } -nodes.handlers.protectglyphs=node.protect_glyphs -nodes.handlers.unprotectglyphs=node.unprotect_glyphs +nodes.handlers.protectglyphs=node.protectglyphs or node.protect_glyphs +nodes.handlers.unprotectglyphs=node.unprotectglyphs or node.unprotect_glyphs local direct=node.direct local nuts={} nodes.nuts=nuts @@ -286,31 +286,33 @@ nuts.setprev=direct.setprev nuts.setsplit=direct.setsplit nuts.setsubtype=direct.setsubtype nuts.setwidth=direct.setwidth -nuts.getglyphdata=nuts.getattr -nuts.setglyphdata=nuts.setattr -nuts.ischar=direct.is_char -nuts.isglyph=direct.is_glyph +nuts.getglyphdata=nuts.getattribute or nuts.getattr +nuts.setglyphdata=nuts.setattribute or nuts.setattr +nuts.ischar=direct.ischar or direct.is_char +nuts.isglyph=direct.isglyph or direct.is_glyph nuts.copy=direct.copy -nuts.copy_list=direct.copy_list -nuts.copy_node=direct.copy -nuts.end_of_math=direct.end_of_math +nuts.copynode=direct.copy +nuts.copylist=direct.copylist or direct.copy_list +nuts.endofmath=direct.endofmath or direct.end_of_math nuts.flush=direct.flush -nuts.flush_list=direct.flush_list -nuts.flush_node=direct.flush_node +nuts.flushlist=direct.flushlist or direct.flush_list +nuts.flushnode=direct.flushnode or direct.flush_node nuts.free=direct.free -nuts.insert_after=direct.insert_after -nuts.insert_before=direct.insert_before -nuts.is_node=direct.is_node +nuts.insertafter=direct.insertafter or direct.insert_after +nuts.insertbefore=direct.insertbefore or direct.insert_before +nuts.isnode=direct.isnode or direct.is_node +nuts.isdirect=direct.isdirect or direct.is_direct +nuts.isnut=direct.isdirect or direct.is_direct nuts.kerning=direct.kerning nuts.ligaturing=direct.ligaturing nuts.new=direct.new nuts.remove=direct.remove nuts.tail=direct.tail nuts.traverse=direct.traverse -nuts.traverse_char=direct.traverse_char -nuts.traverse_glyph=direct.traverse_glyph -nuts.traverse_id=direct.traverse_id -local propertydata=direct.get_properties_table() +nuts.traversechar=direct.traversechar or direct.traverse_char +nuts.traverseglyph=direct.traverseglyph or direct.traverse_glyph +nuts.traverseid=direct.traverseid or direct.traverse_id +local propertydata=(direct.getpropertiestable or direct.get_properties_table)() nodes.properties={ data=propertydata } if direct.set_properties_mode then direct.set_properties_mode(true,true) @@ -343,10 +345,10 @@ local setfield=nuts.setfield local getsubtype=nuts.getsubtype local isglyph=nuts.isglyph local find_tail=nuts.tail -local flush_list=nuts.flush_list -local flush_node=nuts.flush_node -local traverse_id=nuts.traverse_id -local copy_node=nuts.copy_node +local flushlist=nuts.flushlist +local flushnode=nuts.flushnode +local traverseid=nuts.traverseid +local copynode=nuts.copynode local glyph_code=nodes.nodecodes.glyph local ligature_code=nodes.glyphcodes.ligature do @@ -359,31 +361,31 @@ do end end do - local get_components=node.direct.getcomponents - local set_components=node.direct.setcomponents - local function copy_no_components(g,copyinjection) - local components=get_components(g) + local getcomponents=node.direct.getcomponents + local setcomponents=node.direct.setcomponents + local function copynocomponents(g,copyinjection) + local components=getcomponents(g) if components then - set_components(g) - local n=copy_node(g) + setcomponents(g) + local n=copynode(g) if copyinjection then copyinjection(n,g) end - set_components(g,components) + setcomponents(g,components) return n else - local n=copy_node(g) + local n=copynode(g) if copyinjection then copyinjection(n,g) end return n end end - local function copy_only_glyphs(current) + local function copyonlyglyphs(current) local head=nil local previous=nil - for n in traverse_id(glyph_code,current) do - n=copy_node(n) + for n in traverseid(glyph_code,current) do + n=copynode(n) if head then setlink(previous,n) else @@ -393,14 +395,14 @@ do end return head end - local function count_components(start,marks) + local function countcomponents(start,marks) local char=isglyph(start) if char then if getsubtype(start)==ligature_code then local n=0 - local components=get_components(start) + local components=getcomponents(start) while components do - n=n+count_components(components,marks) + n=n+countcomponents(components,marks) components=getnext(components) end return n @@ -410,24 +412,26 @@ do end return 0 end - local function flush_components() + local function flushcomponents() end - nuts.set_components=set_components - nuts.get_components=get_components - nuts.copy_only_glyphs=copy_only_glyphs - nuts.copy_no_components=copy_no_components - nuts.count_components=count_components - nuts.flush_components=flush_components + nuts.components={ + set=setcomponents, + get=getcomponents, + copyonlyglyphs=copyonlyglyphs, + copynocomponents=copynocomponents, + count=countcomponents, + flush=flushcomponents, + } end -nuts.uses_font=direct.uses_font +nuts.usesfont=direct.usesfont or direct.uses_font do local dummy=tonut(node.new("glyph")) nuts.traversers={ - glyph=nuts.traverse_id(nodecodes.glyph,dummy), - glue=nuts.traverse_id(nodecodes.glue,dummy), - disc=nuts.traverse_id(nodecodes.disc,dummy), - boundary=nuts.traverse_id(nodecodes.boundary,dummy), - char=nuts.traverse_char(dummy), + glyph=nuts.traverseid(nodecodes.glyph,dummy), + glue=nuts.traverseid(nodecodes.glue,dummy), + disc=nuts.traverseid(nodecodes.disc,dummy), + boundary=nuts.traverseid(nodecodes.boundary,dummy), + char=nuts.traversechar(dummy), node=nuts.traverse(dummy), } end @@ -444,16 +448,16 @@ if not nuts.setreplace then end do local getsubtype=nuts.getsubtype - function nuts.start_of_par(n) + function nuts.startofpar(n) local s=getsubtype(n) return s==0 or s==2 end end -end --- [luaotfload, fontloader-2021-01-07.lua scope for “basics-nod”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “basics-nod”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “basics-chr” 64fafe4eaf55d64aead6513c1e74a024] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “basics-chr” 64fafe4eaf55d64aead6513c1e74a024] --- characters=characters or {} @@ -4063,10 +4067,10 @@ characters.indicgroups={ }, } -end --- [luaotfload, fontloader-2021-01-07.lua scope for “basics-chr”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “basics-chr”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-ini” 5343de60613adb24cdd7a8d2ee1d153c] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-ini” 5343de60613adb24cdd7a8d2ee1d153c] --- if not modules then modules={} end modules ['font-ini']={ version=1.001, @@ -4107,10 +4111,10 @@ if node and not tex.getfontoffamily then tex.getfontoffamily=node.family_font end -end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-ini”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-ini”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “fonts-mis” 17e967c9ec4d001deefd43ddf25e98f7] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “fonts-mis” 17e967c9ec4d001deefd43ddf25e98f7] --- if not modules then modules={} end modules ['luatex-font-mis']={ version=1.001, @@ -4142,10 +4146,10 @@ function font.each() return table.sortedhash(fonts.hashes.identifiers) end -end --- [luaotfload, fontloader-2021-01-07.lua scope for “fonts-mis”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “fonts-mis”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-con” 724e5dd14aec2d4d189f8619898004cf] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-con” 724e5dd14aec2d4d189f8619898004cf] --- if not modules then modules={} end modules ['font-con']={ version=1.001, @@ -5513,10 +5517,10 @@ function constructors.addcoreunicodes(unicodes) return unicodes end -end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-con”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-con”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “fonts-enc” 5ff4ca50493d7c4ecea0e15c203099f0] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “fonts-enc” 5ff4ca50493d7c4ecea0e15c203099f0] --- if not modules then modules={} end modules ['luatex-font-enc']={ version=1.001, @@ -5585,10 +5589,10 @@ function encodings.load(filename) return containers.write(encodings.cache,name,data) end -end --- [luaotfload, fontloader-2021-01-07.lua scope for “fonts-enc”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “fonts-enc”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-cid” 22b0367742fb253deef84ef7ccf5e8de] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-cid” 22b0367742fb253deef84ef7ccf5e8de] --- if not modules then modules={} end modules ['font-cid']={ version=1.001, @@ -5739,10 +5743,10 @@ function cid.getmap(specification) return found end -end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-cid”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-cid”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-map” c4a39db5ad822b348aa61bca5f4a599a] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-map” c4a39db5ad822b348aa61bca5f4a599a] --- if not modules then modules={} end modules ['font-map']={ version=1.001, @@ -6150,10 +6154,10 @@ function mappings.addtounicode(data,filename,checklookups,forceligatures) end end -end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-map”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-map”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-vfc” a81c29eda98cd62cbebdb6c93544b50d] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-vfc” a81c29eda98cd62cbebdb6c93544b50d] --- if not modules then modules={} end modules ['font-vfc']={ version=1.001, @@ -6250,10 +6254,10 @@ helpers.commands=utilities.storage.allocate { dummy=dummy, } -end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-vfc”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-vfc”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-otr” 64dcbbc7107538723990e1119a80a9f8] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-otr” ad238624c9ebd488d4bbe9af3b620189] --- if not modules then modules={} end modules ['font-otr']={ version=1.001, @@ -7010,8 +7014,6 @@ readers.post=function(f,fontdata,specification) if length>0 then glyphs[mapping].name=readstring(f,length) else - report("quit post name fetching at %a of %a: %s",i,maxnames,"overflow") - break end end end @@ -8097,10 +8099,10 @@ function readers.extend(fontdata) end end -end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-otr”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-otr”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-oti” 309a75f9c14b77d87e94eba827dc4e71] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-oti” 309a75f9c14b77d87e94eba827dc4e71] --- if not modules then modules={} end modules ['font-oti']={ version=1.001, @@ -8243,10 +8245,10 @@ function otffeatures.checkeddefaultlanguage(featuretype,autolanguage,languages) end end -end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-oti”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-oti”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-ott” 673ed11e1d159997f535bfec5fa73808] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-ott” 3f67b1b1d40bbc222681d8db4aff0f42] --- if not modules then modules={} end modules ["font-ott"]={ version=1.001, @@ -9362,10 +9364,10 @@ function otffeatures.normalize(features,wrap) end end -end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-ott”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-ott”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-cff” 2b677fad52d9999d0685e8525271a8cc] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-cff” 01e7c6fbc8961a566f4e4f8cbedb7004] --- if not modules then modules={} end modules ['font-cff']={ version=1.001, @@ -9377,7 +9379,7 @@ if not modules then modules={} end modules ['font-cff']={ } local next,type,tonumber,rawget=next,type,tonumber,rawget local byte,char,gmatch,sub=string.byte,string.char,string.gmatch,string.sub -local concat,remove,unpack=table.concat,table.remove,table.unpack +local concat,insert,remove,unpack=table.concat,table.insert,table.remove,table.unpack local floor,abs,round,ceil,min,max=math.floor,math.abs,math.round,math.ceil,math.min,math.max local P,C,R,S,C,Cs,Ct=lpeg.P,lpeg.C,lpeg.R,lpeg.S,lpeg.C,lpeg.Cs,lpeg.Ct local lpegmatch=lpeg.match @@ -10981,8 +10983,34 @@ do showstate(reverse[t] or "<action>") end if top>0 then - for i=1,top do - r=r+1;result[r]=encode[stack[i]] + if t==8 and top>48 then + local n=0 + for i=1,top do + if n==48 then + local zero=encode[0] + local res3=result[r-3] + local res2=result[r-2] + local res1=result[r-1] + local res0=result[r] + result[r-3]=zero + result[r-2]=zero + r=r+1;result[r]=chars[t] + r=r+1;result[r]=zero + r=r+1;result[r]=zero + r=r+1;result[r]=res3 + r=r+1;result[r]=res2 + r=r+1;result[r]=res1 + r=r+1;result[r]=res0 + n=1 + else + n=n+1 + end + r=r+1;result[r]=encode[stack[i]] + end + else + for i=1,top do + r=r+1;result[r]=encode[stack[i]] + end end top=0 end @@ -11564,10 +11592,10 @@ function readers.cffcheck(filename) end end -end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-cff”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-cff”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-ttf” ffffc827e1bcddc33a2b615340ecff7f] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-ttf” ffffc827e1bcddc33a2b615340ecff7f] --- if not modules then modules={} end modules ['font-ttf']={ version=1.001, @@ -12738,10 +12766,10 @@ function readers.gvar(f,fontdata,specification,glyphdata,shapedata) end end -end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-ttf”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-ttf”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-dsp” 174ce11f3ba0bddf270f48d8d2addd56] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-dsp” 174ce11f3ba0bddf270f48d8d2addd56] --- if not modules then modules={} end modules ['font-dsp']={ version=1.001, @@ -16017,10 +16045,10 @@ function readers.mvar(f,fontdata,specification) end end -end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-dsp”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-dsp”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-oup” 6f46aa00ae1c20c43f8ffaf329dc8695] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-oup” 4eb2f26e51835239e26a8df2ecf04366] --- if not modules then modules={} end modules ['font-oup']={ version=1.001, @@ -18264,6 +18292,28 @@ local function checkkerns(lookup) end return kerned end +local strip_pairs=true +local compact_pairs=true +local compact_singles=true +local merge_pairs=true +local merge_singles=true +local merge_substitutions=true +local merge_alternates=true +local merge_multiples=true +local merge_ligatures=true +local merge_cursives=true +local merge_marks=true +directives.register("otf.strip.pairs",function(v) strip_pairs=v end) +directives.register("otf.compact.pairs",function(v) compact_pairs=v end) +directives.register("otf.compact.singles",function(v) compact_singles=v end) +directives.register("otf.merge.pairs",function(v) merge_pairs=v end) +directives.register("otf.merge.singles",function(v) merge_singles=v end) +directives.register("otf.merge.substitutions",function(v) merge_substitutions=v end) +directives.register("otf.merge.alternates",function(v) merge_alternates=v end) +directives.register("otf.merge.multiples",function(v) merge_multiples=v end) +directives.register("otf.merge.ligatures",function(v) merge_ligatures=v end) +directives.register("otf.merge.cursives",function(v) merge_cursives=v end) +directives.register("otf.merge.marks",function(v) merge_marks=v end) local function checkpairs(lookup) local steps=lookup.steps local nofsteps=lookup.nofsteps @@ -18311,26 +18361,27 @@ local function checkpairs(lookup) end return kerned end -local compact_pairs=true -local compact_singles=true -local merge_pairs=true -local merge_singles=true -local merge_substitutions=true -local merge_alternates=true -local merge_multiples=true -local merge_ligatures=true -local merge_cursives=true -local merge_marks=true -directives.register("otf.compact.pairs",function(v) compact_pairs=v end) -directives.register("otf.compact.singles",function(v) compact_singles=v end) -directives.register("otf.merge.pairs",function(v) merge_pairs=v end) -directives.register("otf.merge.singles",function(v) merge_singles=v end) -directives.register("otf.merge.substitutions",function(v) merge_substitutions=v end) -directives.register("otf.merge.alternates",function(v) merge_alternates=v end) -directives.register("otf.merge.multiples",function(v) merge_multiples=v end) -directives.register("otf.merge.ligatures",function(v) merge_ligatures=v end) -directives.register("otf.merge.cursives",function(v) merge_cursives=v end) -directives.register("otf.merge.marks",function(v) merge_marks=v end) +local function strippairs(lookup) + local steps=lookup.steps + local nofsteps=lookup.nofsteps + local stripped=0 + for i=1,nofsteps do + local step=steps[i] + if step.format=="pair" then + local coverage=step.coverage + for g1,d1 in next,coverage do + for g2,d2 in next,d1 do + if d2[2] then + elseif d2[1]==true then + d1[g2]=nil + stripped=stripped+1 + end + end + end + end + end + return stripped +end function readers.compact(data) if not data or data.compacted then return @@ -18338,6 +18389,7 @@ function readers.compact(data) data.compacted=true end local resources=data.resources + local stripped=0 local merged=0 local kerned=0 local allsteps=0 @@ -18375,6 +18427,9 @@ function readers.compact(data) kerned=kerned+checkkerns(lookup) end elseif kind=="gpos_pair" then + if strip_pairs then + stripped=stripped+strippairs(lookup) + end if merge_pairs then merged=merged+mergesteps_2(lookup) end @@ -18415,6 +18470,9 @@ function readers.compact(data) compact("sequences") compact("sublookups") if trace_optimizations then + if stripped>0 then + report_optimizations("%i zero positions stripped before merging",stripped) + end if merged>0 then report_optimizations("%i steps of %i removed due to merging",merged,allsteps) end @@ -18661,10 +18719,10 @@ function readers.expand(data) expandlookups(sublookups) end -end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-oup”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-oup”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-otl” f4e6652a191003493389de230b14cfb3] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-otl” 6f701653de713e8aa80d82c7cdf32d75] --- if not modules then modules={} end modules ['font-otl']={ version=1.001, @@ -18692,7 +18750,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.113 +otf.version=3.116 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) @@ -19145,6 +19203,7 @@ local function read_from_otf(specification) if tfmdata then tfmdata.properties.name=specification.name tfmdata.properties.sub=specification.sub + tfmdata.properties.id=specification.id tfmdata=constructors.scale(tfmdata,specification) local allfeatures=tfmdata.shared.features or specification.features.normal constructors.applymanipulators("otf",tfmdata,allfeatures,trace_features,report_otf) @@ -19370,10 +19429,10 @@ otf.coverup={ end } -end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-otl”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-otl”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-oto” 2b1d6bc63b2ebf8f2655a15e1cda6541] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-oto” 2b1d6bc63b2ebf8f2655a15e1cda6541] --- if not modules then modules={} end modules ['font-oto']={ version=1.001, @@ -19831,10 +19890,10 @@ registerotffeature { } otf.basemodeinitializer=featuresinitializer -end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-oto”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-oto”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-otj” 8de59cb9b043e5f73c6b9f7cc8f6978e] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-otj” b2c165bd6771a57633f992d07384b739] --- if not modules then modules={} end modules ['font-otj']={ version=1.001, @@ -19884,6 +19943,8 @@ local getoffsets=nuts.getoffsets local getboth=nuts.getboth local getdisc=nuts.getdisc local setdisc=nuts.setdisc +local getreplace=nuts.getreplace +local setreplace=nuts.setreplace local setoffsets=nuts.setoffsets local ischar=nuts.ischar local getkern=nuts.getkern @@ -19893,8 +19954,8 @@ local setwidth=nuts.setwidth local getwidth=nuts.getwidth local nextchar=nuts.traversers.char local nextglue=nuts.traversers.glue -local insert_node_before=nuts.insert_before -local insert_node_after=nuts.insert_after +local insertnodebefore=nuts.insertbefore +local insertnodeafter=nuts.insertafter local properties=nodes.properties.data local fontkern=nuts.pool and nuts.pool.fontkern local italickern=nuts.pool and nuts.pool.italickern @@ -19908,7 +19969,7 @@ end) if not fontkern then local thekern=nuts.new("kern",0) local setkern=nuts.setkern - local copy_node=nuts.copy_node + local copy_node=nuts.copy fontkern=function(k) local n=copy_node(thekern) setkern(n,k) @@ -19918,7 +19979,7 @@ end if not italickern then local thekern=nuts.new("kern",3) local setkern=nuts.setkern - local copy_node=nuts.copy_node + local copy_node=nuts.copy italickern=function(k) local n=copy_node(thekern) setkern(n,k) @@ -20379,12 +20440,12 @@ local function inject_kerns_only(head,where) if leftkern and leftkern~=0 then if prev and getid(prev)==glue_code then if useitalickerns then - head=insert_node_before(head,current,italickern(leftkern)) + head=insertnodebefore(head,current,italickern(leftkern)) else setwidth(prev,getwidth(prev)+leftkern) end else - head=insert_node_before(head,current,fontkern(leftkern)) + head=insertnodebefore(head,current,fontkern(leftkern)) end end end @@ -20438,7 +20499,7 @@ local function inject_kerns_only(head,where) if i then local leftkern=i.leftkern if leftkern and leftkern~=0 then - pre=insert_node_before(pre,n,fontkern(leftkern)) + pre=insertnodebefore(pre,n,fontkern(leftkern)) done=true end end @@ -20453,7 +20514,7 @@ local function inject_kerns_only(head,where) if i then local leftkern=i.leftkern if leftkern and leftkern~=0 then - post=insert_node_before(post,n,fontkern(leftkern)) + post=insertnodebefore(post,n,fontkern(leftkern)) done=true end end @@ -20468,7 +20529,7 @@ local function inject_kerns_only(head,where) if i then local leftkern=i.leftkern if leftkern and leftkern~=0 then - replace=insert_node_before(replace,n,fontkern(leftkern)) + replace=insertnodebefore(replace,n,fontkern(leftkern)) done=true end end @@ -20530,36 +20591,34 @@ local function inject_positions_only(head,where) rightkern=0 elseif prev and getid(prev)==glue_code then if useitalickerns then - head=insert_node_before(head,current,italickern(leftkern)) + head=insertnodebefore(head,current,italickern(leftkern)) else setwidth(prev,getwidth(prev)+leftkern) end else - head=insert_node_before(head,current,fontkern(leftkern)) + head=insertnodebefore(head,current,fontkern(leftkern)) end end if rightkern and rightkern~=0 then if next and getid(next)==glue_code then if useitalickerns then - insert_node_after(head,current,italickern(rightkern)) + insertnodeafter(head,current,italickern(rightkern)) else setwidth(next,getwidth(next)+rightkern) end else - insert_node_after(head,current,fontkern(rightkern)) + insertnodeafter(head,current,fontkern(rightkern)) end end - else + elseif next then local i=p.emptyinjections if i then local rightkern=i.rightkern - if rightkern and rightkern~=0 then - if next and getid(next)==disc_code then - if replace then - else - replace=fontkern(rightkern) - done=true - end + if rightkern and rightkern~=0 and getid(next)==disc_code then + local replace=getreplace(next) + if replace then + else + setreplace(next,fontkern(rightkern)) end end end @@ -20620,12 +20679,12 @@ local function inject_positions_only(head,where) end local leftkern=i.leftkern if leftkern and leftkern~=0 then - pre=insert_node_before(pre,n,fontkern(leftkern)) + pre=insertnodebefore(pre,n,fontkern(leftkern)) done=true end local rightkern=i.rightkern if rightkern and rightkern~=0 then - insert_node_after(pre,n,fontkern(rightkern)) + insertnodeafter(pre,n,fontkern(rightkern)) done=true end end @@ -20644,12 +20703,12 @@ local function inject_positions_only(head,where) end local leftkern=i.leftkern if leftkern and leftkern~=0 then - post=insert_node_before(post,n,fontkern(leftkern)) + post=insertnodebefore(post,n,fontkern(leftkern)) done=true end local rightkern=i.rightkern if rightkern and rightkern~=0 then - insert_node_after(post,n,fontkern(rightkern)) + insertnodeafter(post,n,fontkern(rightkern)) done=true end end @@ -20668,12 +20727,12 @@ local function inject_positions_only(head,where) end local leftkern=i.leftkern if leftkern and leftkern~=0 then - replace=insert_node_before(replace,n,fontkern(leftkern)) + replace=insertnodebefore(replace,n,fontkern(leftkern)) done=true end local rightkern=i.rightkern if rightkern and rightkern~=0 then - insert_node_after(replace,n,fontkern(rightkern)) + insertnodeafter(replace,n,fontkern(rightkern)) done=true end end @@ -20688,7 +20747,7 @@ local function inject_positions_only(head,where) if i then local rightkern=i.rightkern if rightkern and rightkern~=0 then - pre=insert_node_before(pre,pre,fontkern(rightkern)) + pre=insertnodebefore(pre,pre,fontkern(rightkern)) done=true end end @@ -20701,7 +20760,7 @@ local function inject_positions_only(head,where) if i then local rightkern=i.rightkern if rightkern and rightkern~=0 then - replace=insert_node_before(replace,replace,fontkern(rightkern)) + replace=insertnodebefore(replace,replace,fontkern(rightkern)) done=true end end @@ -20804,8 +20863,8 @@ local function inject_everything(head,where) if trace_injections then report_injections("correcting non zero width mark %C",getchar(n)) end - insert_node_before(n,n,fontkern(-wn)) - insert_node_after(n,n,fontkern(-wn)) + insertnodebefore(n,n,fontkern(-wn)) + insertnodeafter(n,n,fontkern(-wn)) end end end @@ -20897,37 +20956,35 @@ local function inject_everything(head,where) rightkern=0 elseif prev and getid(prev)==glue_code then if useitalickerns then - head=insert_node_before(head,current,italickern(leftkern)) + head=insertnodebefore(head,current,italickern(leftkern)) else setwidth(prev,getwidth(prev)+leftkern) end else - head=insert_node_before(head,current,fontkern(leftkern)) + head=insertnodebefore(head,current,fontkern(leftkern)) end end if rightkern and rightkern~=0 then if next and getid(next)==glue_code then if useitalickerns then - insert_node_after(head,current,italickern(rightkern)) + insertnodeafter(head,current,italickern(rightkern)) else setwidth(next,getwidth(next)+rightkern) end else - insert_node_after(head,current,fontkern(rightkern)) + insertnodeafter(head,current,fontkern(rightkern)) end end end - else + elseif next then local i=p.emptyinjections if i then local rightkern=i.rightkern - if rightkern and rightkern~=0 then - if next and getid(next)==disc_code then - if replace then - else - replace=fontkern(rightkern) - done=true - end + if rightkern and rightkern~=0 and getid(next)==disc_code then + local replace=getreplace(next) + if replace then + else + setreplace(next,fontkern(rightkern)) end end end @@ -21002,12 +21059,12 @@ local function inject_everything(head,where) end local leftkern=i.leftkern if leftkern and leftkern~=0 then - pre=insert_node_before(pre,n,fontkern(leftkern)) + pre=insertnodebefore(pre,n,fontkern(leftkern)) done=true end local rightkern=i.rightkern if rightkern and rightkern~=0 then - insert_node_after(pre,n,fontkern(rightkern)) + insertnodeafter(pre,n,fontkern(rightkern)) done=true end if hasmarks then @@ -21032,12 +21089,12 @@ local function inject_everything(head,where) end local leftkern=i.leftkern if leftkern and leftkern~=0 then - post=insert_node_before(post,n,fontkern(leftkern)) + post=insertnodebefore(post,n,fontkern(leftkern)) done=true end local rightkern=i.rightkern if rightkern and rightkern~=0 then - insert_node_after(post,n,fontkern(rightkern)) + insertnodeafter(post,n,fontkern(rightkern)) done=true end if hasmarks then @@ -21062,12 +21119,12 @@ local function inject_everything(head,where) end local leftkern=i.leftkern if leftkern and leftkern~=0 then - replace=insert_node_before(replace,n,fontkern(leftkern)) + replace=insertnodebefore(replace,n,fontkern(leftkern)) done=true end local rightkern=i.rightkern if rightkern and rightkern~=0 then - insert_node_after(replace,n,fontkern(rightkern)) + insertnodeafter(replace,n,fontkern(rightkern)) done=true end if hasmarks then @@ -21088,7 +21145,7 @@ local function inject_everything(head,where) if i then local rightkern=i.rightkern if rightkern and rightkern~=0 then - pre=insert_node_before(pre,pre,fontkern(rightkern)) + pre=insertnodebefore(pre,pre,fontkern(rightkern)) done=true end end @@ -21101,7 +21158,7 @@ local function inject_everything(head,where) if i then local rightkern=i.rightkern if rightkern and rightkern~=0 then - replace=insert_node_before(replace,replace,fontkern(rightkern)) + replace=insertnodebefore(replace,replace,fontkern(rightkern)) done=true end end @@ -21254,8 +21311,8 @@ local function injectspaces(head) if trace_spaces then report_spaces("%C [%p + %p + %p] %C",prevchar,lnew,old,rnew,nextchar) end - head=insert_node_before(head,n,italickern(lnew)) - insert_node_after(head,n,italickern(rnew)) + head=insertnodebefore(head,n,italickern(lnew)) + insertnodeafter(head,n,italickern(rnew)) else local new=old+(leftkern+rightkern)*factor if trace_spaces then @@ -21270,7 +21327,7 @@ local function injectspaces(head) if trace_spaces then report_spaces("%C [%p + %p]",prevchar,old,new) end - insert_node_after(head,n,italickern(new)) + insertnodeafter(head,n,italickern(new)) else local new=old+leftkern*factor if trace_spaces then @@ -21289,7 +21346,7 @@ local function injectspaces(head) if trace_spaces then report_spaces("[%p + %p] %C",old,new,nextchar) end - insert_node_after(head,n,italickern(new)) + insertnodeafter(head,n,italickern(new)) else local new=old+rightkern*factor if trace_spaces then @@ -21329,10 +21386,10 @@ function injections.handler(head,where) end end -end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-otj”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-otj”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-ota” ad1d5de06400f88829509e1f3ff2b473] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-ota” 2bb12d708e35bc05443eba791e2554e7] --- if not modules then modules={} end modules ['font-ota']={ version=1.001, @@ -21362,7 +21419,7 @@ local setprop=nuts.setprop local getsubtype=nuts.getsubtype local getchar=nuts.getchar local ischar=nuts.ischar -local end_of_math=nuts.end_of_math +local endofmath=nuts.endofmath local nodecodes=nodes.nodecodes local disc_code=nodecodes.disc local math_code=nodecodes.math @@ -21468,7 +21525,7 @@ function analyzers.setstate(head,font) end first,last,n=nil,nil,0 if id==math_code then - current=end_of_math(current) + current=endofmath(current) end elseif id==disc_code then setstate(current,s_medi) @@ -21481,7 +21538,7 @@ function analyzers.setstate(head,font) end first,last,n=nil,nil,0 if id==math_code then - current=end_of_math(current) + current=endofmath(current) end end current=getnext(current) @@ -21697,7 +21754,7 @@ function methods.arab(head,font,attr) first=nil end if id==math_code then - current=end_of_math(current) + current=endofmath(current) end end current=getnext(current) @@ -21811,7 +21868,7 @@ do wrapup() end if id==math_code then - current=end_of_math(current) + current=endofmath(current) end end current=getnext(current) @@ -21826,10 +21883,10 @@ directives.register("otf.analyze.useunicodemarks",function(v) analyzers.useunicodemarks=v end) -end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-ota”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-ota”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-ots” c780a471147527f4ddc139e017927ffe] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-ots” cb106ae882e8548051f00aac8b7fa862] --- if not modules then modules={} end modules ['font-ots']={ version=1.001, @@ -21908,23 +21965,24 @@ local setlink=nuts.setlink local getwidth=nuts.getwidth local getattr=nuts.getattr local getglyphdata=nuts.getglyphdata -local copy_no_components=nuts.copy_no_components -local copy_only_glyphs=nuts.copy_only_glyphs -local count_components=nuts.count_components -local set_components=nuts.set_components -local get_components=nuts.get_components -local flush_components=nuts.flush_components +local components=nuts.components +local copynocomponents=components.copynocomponents +local copyonlyglyphs=components.copyonlyglyphs +local countcomponents=components.count +local setcomponents=components.set +local getcomponents=components.get +local flushcomponents=components.flush local ischar=nuts.ischar -local usesfont=nuts.uses_font -local insert_node_after=nuts.insert_after +local usesfont=nuts.usesfont +local insertnodeafter=nuts.insertafter local copy_node=nuts.copy -local copy_node_list=nuts.copy_list +local copy_node_list=nuts.copylist local remove_node=nuts.remove local find_node_tail=nuts.tail -local flush_node_list=nuts.flush_list -local flush_node=nuts.flush_node -local end_of_math=nuts.end_of_math -local start_of_par=nuts.start_of_par +local flushnodelist=nuts.flushlist +local flushnode=nuts.flushnode +local endofmath=nuts.endofmath +local startofpar=nuts.startofpar local setmetatable=setmetatable local setmetatableindex=table.setmetatableindex local nextnode=nuts.traversers.node @@ -22055,12 +22113,12 @@ local function flattendisk(head,disc) local prev,next=getboth(disc) local ishead=head==disc setdisc(disc) - flush_node(disc) + flushnode(disc) if pre then - flush_node_list(pre) + flushnodelist(pre) end if post then - flush_node_list(post) + flushnodelist(post) end if ishead then if replace then @@ -22109,16 +22167,16 @@ local function markstoligature(head,start,stop,char) local next=getnext(stop) setprev(start) setnext(stop) - local base=copy_no_components(start,copyinjection) + local base=copynocomponents(start,copyinjection) if head==start then head=base end resetinjection(base) setchar(base,char) setsubtype(base,ligatureglyph_code) - set_components(base,start) + setcomponents(base,start) setlink(prev,base,next) - flush_components(start) + flushcomponents(start) return head,base end end @@ -22126,7 +22184,7 @@ local no_left_ligature_code=1 local no_right_ligature_code=2 local no_left_kern_code=4 local no_right_kern_code=8 -local has_glyph_option=node.direct.has_glyph_option or function(n,c) +local hasglyphoption=function(n,c) if c==no_left_ligature_code or c==no_right_ligature_code then return getattr(n,a_noligature)==1 else @@ -22134,7 +22192,7 @@ local has_glyph_option=node.direct.has_glyph_option or function(n,c) end end local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfound,hasmarks) - if has_glyph_option(start,no_right_ligature_code) then + if hasglyphoption(start,no_right_ligature_code) then return head,start end if start==stop and getchar(start)==char then @@ -22147,14 +22205,14 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou local comp=start setprev(start) setnext(stop) - local base=copy_no_components(start,copyinjection) + local base=copynocomponents(start,copyinjection) if start==head then head=base end resetinjection(base) setchar(base,char) setsubtype(base,ligatureglyph_code) - set_components(base,comp) + setcomponents(base,comp) setlink(prev,base,next) if not discfound then local deletemarks=not skiphash or hasmarks @@ -22167,7 +22225,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou local char=getchar(start) if not marks[char] then baseindex=baseindex+componentindex - componentindex=count_components(start,marks) + componentindex=countcomponents(start,marks) elseif not deletemarks then setligaindex(start,baseindex+getligaindex(start,componentindex)) if trace_marks then @@ -22175,7 +22233,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou end local n=copy_node(start) copyinjection(n,start) - head,current=insert_node_after(head,current,n) + head,current=insertnodeafter(head,current,n) elseif trace_marks then logwarning("%s: delete ligature mark %s",pref(dataset,sequence),gref(char)) end @@ -22198,14 +22256,14 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou break end end - flush_components(components) + flushcomponents(components) else local discprev,discnext=getboth(discfound) if discprev and discnext then local pre,post,replace,pretail,posttail,replacetail=getdisc(discfound,true) if not replace then local prev=getprev(base) - local copied=copy_only_glyphs(comp) + local copied=copyonlyglyphs(comp) if pre then setlink(discprev,pre) else @@ -22221,7 +22279,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou end setlink(prev,discfound,next) setboth(base) - set_components(base,copied) + setcomponents(base,copied) replace=base if forcediscretionaries then setdisc(discfound,pre,post,replace,discretionarydisc_code) @@ -22245,7 +22303,7 @@ local function multiple_glyphs(head,start,multiple,skiphash,what,stop) local n=copy_node(start) resetinjection(n) setchar(n,multiple[k]) - insert_node_after(head,start,n) + insertnodeafter(head,start,n) start=n end if what==true then @@ -22255,7 +22313,7 @@ local function multiple_glyphs(head,start,multiple,skiphash,what,stop) local n=copy_node(start) resetinjection(n) setchar(n,m) - insert_node_after(head,start,n) + insertnodeafter(head,start,n) start=n end end @@ -22485,7 +22543,7 @@ function handlers.gsub_ligature(head,start,dataset,sequence,ligature,rlmode,skip return head,start,false,false end function handlers.gpos_single(head,start,dataset,sequence,kerns,rlmode,skiphash,step,injection) - if has_glyph_option(start,no_right_kern_code) then + if hasglyphoption(start,no_right_kern_code) then return head,start,false else local startchar=getchar(start) @@ -22505,7 +22563,7 @@ function handlers.gpos_single(head,start,dataset,sequence,kerns,rlmode,skiphash, end end function handlers.gpos_pair(head,start,dataset,sequence,kerns,rlmode,skiphash,step,injection) - if has_glyph_option(start,no_right_kern_code) then + if hasglyphoption(start,no_right_kern_code) then return head,start,false else local snext=getnext(start) @@ -22994,7 +23052,7 @@ function chainprocs.gsub_ligature(head,start,stop,dataset,sequence,currentlookup return head,start,false,0,false end function chainprocs.gpos_single(head,start,stop,dataset,sequence,currentlookup,rlmode,skiphash,chainindex) - if not has_glyph_option(start,no_right_kern_code) then + if not hasglyphoption(start,no_right_kern_code) then local mapping=currentlookup.mapping if mapping==nil then mapping=getmapping(dataset,sequence,currentlookup) @@ -23022,7 +23080,7 @@ function chainprocs.gpos_single(head,start,stop,dataset,sequence,currentlookup,r return head,start,false end function chainprocs.gpos_pair(head,start,stop,dataset,sequence,currentlookup,rlmode,skiphash,chainindex) - if not has_glyph_option(start,no_right_kern_code) then + if not hasglyphoption(start,no_right_kern_code) then local mapping=currentlookup.mapping if mapping==nil then mapping=getmapping(dataset,sequence,currentlookup) @@ -23345,13 +23403,13 @@ local function checked(head) if next then setlink(kern,next) end - flush_node(current) + flushnode(current) head=kern current=next else local prev,next=getboth(current) setlink(prev,kern,next) - flush_node(current) + flushnode(current) current=next end else @@ -23801,105 +23859,225 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s goto next end local s=seq.n - local l=ck[5] - local current=start - local last=start if s==1 then - goto next - end - if l>f then - local discfound - local n=f+1 - last=startnext - while n<=l do - if postreplace and not last then - last=getnext(sweepnode) - sweeptype=nil - end - if last then - local char,id=ischar(last,currentfont) - if char then - if 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 + else + local l=ck[5] + local current=start + local last=start + if l>f then + local discfound + local n=f+1 + last=startnext + while n<=l do + if postreplace and not last then + last=getnext(sweepnode) + sweeptype=nil + end + if last then + local char,id=ischar(last,currentfont) + if char then + if skiphash and skiphash[char] then + skipped=true + if trace_skips then + show_skip(dataset,sequence,char,ck,classes[char]) + end last=getnext(last) - end - n=n+1 - elseif discfound then - notmatchreplace[discfound]=true - if notmatchpre[discfound] then - goto next + 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 + goto next + else + break + end else - break - end - else - goto next - end - elseif char==false then - if discfound then - notmatchreplace[discfound]=true - if notmatchpre[discfound] then goto next + end + elseif char==false then + if discfound then + notmatchreplace[discfound]=true + if notmatchpre[discfound] then + goto next + else + break + end else - break + goto next end - else - goto next - end - elseif id==disc_code then - discseen=true - discfound=last - notmatchpre[last]=nil - notmatchpost[last]=true - notmatchreplace[last]=nil - local pre,post,replace=getdisc(last) - if pre then - local n=n - while pre do - if seq[n][getchar(pre)] then - n=n+1 - if n>l then + elseif id==disc_code then + discseen=true + discfound=last + notmatchpre[last]=nil + notmatchpost[last]=true + notmatchreplace[last]=nil + local pre,post,replace=getdisc(last) + if pre then + local n=n + while pre do + if seq[n][getchar(pre)] then + n=n+1 + if n>l then + break + end + pre=getnext(pre) + else + notmatchpre[last]=true break end - pre=getnext(pre) - else + end + if n<=l then notmatchpre[last]=true - break end - end - if n<=l then + else notmatchpre[last]=true end + if replace then + while replace do + if seq[n][getchar(replace)] then + n=n+1 + if n>l then + break + end + replace=getnext(replace) + else + notmatchreplace[last]=true + if notmatchpre[last] then + goto next + else + break + end + end + end + if notmatchpre[last] then + goto next + end + end + last=getnext(last) else - notmatchpre[last]=true + goto next end - if replace then - while replace do - if seq[n][getchar(replace)] then - n=n+1 - if n>l then - break + else + goto next + end + end + end + if f>1 then + if startprev then + local prev=startprev + if prereplace and prev==checkdisc then + prev=getprev(sweepnode) + end + if prev then + local discfound + local n=f-1 + while n>=1 do + if prev then + local char,id=ischar(prev,currentfont) + if char then + if 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 + goto next + else + break + end + else + goto next end - replace=getnext(replace) - else - notmatchreplace[last]=true - if notmatchpre[last] then + elseif char==false then + if discfound then + notmatchreplace[discfound]=true + if notmatchpost[discfound] then + goto next + end + else goto next + end + break + elseif id==disc_code then + discseen=true + discfound=prev + notmatchpre[prev]=true + notmatchpost[prev]=nil + notmatchreplace[prev]=nil + local pre,post,replace,pretail,posttail,replacetail=getdisc(prev,true) + if pre~=start and post~=start and replace~=start then + if post then + local n=n + while posttail do + if seq[n][getchar(posttail)] then + n=n-1 + if posttail==post or n<1 then + break + else + posttail=getprev(posttail) + end + else + notmatchpost[prev]=true + break + end + end + if n>=1 then + notmatchpost[prev]=true + end + else + notmatchpost[prev]=true + end + if replace then + while replacetail do + if seq[n][getchar(replacetail)] then + n=n-1 + if replacetail==replace or n<1 then + break + else + replacetail=getprev(replacetail) + end + else + notmatchreplace[prev]=true + if notmatchpost[prev] then + goto next + else + break + end + end + end + else + end + end + prev=getprev(prev) + elseif id==glue_code then + local sn=seq[n] + if (sn[32] and spaces[prev]) or sn[0xFFFC] then + n=n-1 + prev=getprev(prev) else - break + goto next end + elseif seq[n][0xFFFC] then + n=n-1 + prev=getprev(prev) + else + goto next end - end - if notmatchpre[last] then + else goto next end end - last=getnext(last) else goto next end @@ -23907,34 +24085,32 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s goto next end end - end - if f>1 then - if startprev then - local prev=startprev - if prereplace and prev==checkdisc then - prev=getprev(sweepnode) + if s>l then + local current=last and getnext(last) + if not current and postreplace then + current=getnext(sweepnode) end - if prev then + if current then local discfound - local n=f-1 - while n>=1 do - if prev then - local char,id=ischar(prev,currentfont) + local n=l+1 + while n<=s do + if current then + local char,id=ischar(current,currentfont) if char then if skiphash and skiphash[char] then skipped=true if trace_skips then show_skip(dataset,sequence,char,ck,classes[char]) end - prev=getprev(prev) + current=getnext(current) elseif seq[n][char] then - if n>1 then - prev=getprev(prev) + if n<s then + current=getnext(current) end - n=n-1 + n=n+1 elseif discfound then notmatchreplace[discfound]=true - if notmatchpost[discfound] then + if notmatchpre[discfound] then goto next else break @@ -23945,202 +24121,84 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s elseif char==false then if discfound then notmatchreplace[discfound]=true - if notmatchpost[discfound] then + if notmatchpre[discfound] then goto next + else + break end else goto next end - break elseif id==disc_code then discseen=true - discfound=prev - notmatchpre[prev]=true - notmatchpost[prev]=nil - notmatchreplace[prev]=nil - local pre,post,replace,pretail,posttail,replacetail=getdisc(prev,true) - if pre~=start and post~=start and replace~=start then - if post then - local n=n - while posttail do - if seq[n][getchar(posttail)] then - n=n-1 - if posttail==post or n<1 then - break - else - posttail=getprev(posttail) - end - else - notmatchpost[prev]=true + discfound=current + notmatchpre[current]=nil + notmatchpost[current]=true + notmatchreplace[current]=nil + local pre,post,replace=getdisc(current) + if pre then + local n=n + while pre do + if seq[n][getchar(pre)] then + n=n+1 + if n>s then break + else + pre=getnext(pre) end + else + notmatchpre[current]=true + break end - if n>=1 then - notmatchpost[prev]=true - end - else - notmatchpost[prev]=true end - if replace then - while replacetail do - if seq[n][getchar(replacetail)] then - n=n-1 - if replacetail==replace or n<1 then - break - else - replacetail=getprev(replacetail) - end + if n<=s then + notmatchpre[current]=true + end + else + notmatchpre[current]=true + end + if replace then + while replace do + if seq[n][getchar(replace)] then + n=n+1 + if n>s then + break else - notmatchreplace[prev]=true - if notmatchpost[prev] then - goto next - else - break - end + replace=getnext(replace) + end + else + notmatchreplace[current]=true + if notmatchpre[current] then + goto next + else + break end end - else end + else end - prev=getprev(prev) + current=getnext(current) elseif id==glue_code then local sn=seq[n] - if (sn[32] and spaces[prev]) or sn[0xFFFC] then - n=n-1 - prev=getprev(prev) + if (sn[32] and spaces[current]) or sn[0xFFFC] then + n=n+1 + current=getnext(current) else goto next end elseif seq[n][0xFFFC] then - n=n-1 - prev=getprev(prev) - else - goto next - end - else - goto next - end - end - else - goto next - end - else - goto next - end - end - if s>l then - local current=last and getnext(last) - if not current and postreplace then - current=getnext(sweepnode) - end - if current then - local discfound - local n=l+1 - while n<=s do - if current then - local char,id=ischar(current,currentfont) - if char then - if 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 - elseif discfound then - notmatchreplace[discfound]=true - if notmatchpre[discfound] then - goto next - else - break - end - else - goto next - end - elseif char==false then - if discfound then - notmatchreplace[discfound]=true - if notmatchpre[discfound] then - goto next - else - break - end - else - goto next - end - elseif id==disc_code then - discseen=true - discfound=current - notmatchpre[current]=nil - notmatchpost[current]=true - notmatchreplace[current]=nil - local pre,post,replace=getdisc(current) - if pre then - local n=n - while pre do - if seq[n][getchar(pre)] then - n=n+1 - if n>s then - break - else - pre=getnext(pre) - end - else - notmatchpre[current]=true - break - end - end - if n<=s then - notmatchpre[current]=true - end - else - notmatchpre[current]=true - end - if replace then - while replace do - if seq[n][getchar(replace)] then - n=n+1 - if n>s then - break - else - replace=getnext(replace) - end - else - notmatchreplace[current]=true - if notmatchpre[current] then - goto next - else - break - end - end - end - else - end - current=getnext(current) - elseif id==glue_code then - local sn=seq[n] - if (sn[32] and spaces[current]) or sn[0xFFFC] then n=n+1 current=getnext(current) else goto next end - elseif seq[n][0xFFFC] then - n=n+1 - current=getnext(current) else goto next end - else - goto next end + else + goto next end - else - goto next end end if trace_contexts then @@ -24902,7 +24960,7 @@ do checkstep(head) end local initialrl=0 - if getid(head)==par_code and start_of_par(head) then + if getid(head)==par_code and startofpar(head) then initialrl=pardirstate(head) elseif direction==righttoleft_code then initialrl=-1 @@ -25019,7 +25077,7 @@ do start=getnext(start) end elseif id==math_code then - start=getnext(end_of_math(start)) + start=getnext(endofmath(start)) elseif id==dir_code then topstack,rlmode=txtdirstate(start,dirstack,topstack,rlparmode) start=getnext(start) @@ -25089,7 +25147,7 @@ do start=getnext(start) end elseif id==math_code then - start=getnext(end_of_math(start)) + start=getnext(endofmath(start)) elseif id==dir_code then topstack,rlmode=txtdirstate(start,dirstack,topstack,rlparmode) start=getnext(start) @@ -25167,7 +25225,7 @@ do elseif char==false or id==glue_code then start=getnext(start) elseif id==math_code then - start=getnext(end_of_math(start)) + start=getnext(endofmath(start)) elseif id==dir_code then topstack,rlmode=txtdirstate(start,dirstack,topstack,rlparmode) start=getnext(start) @@ -25178,44 +25236,52 @@ do return head end end -local plugins={} -otf.plugins=plugins -local report=logs.reporter("fonts") -function otf.registerplugin(name,f) - if type(name)=="string" and type(f)=="function" then - plugins[name]={ name,f } - report() - report("plugin %a has been loaded, please be aware of possible side effects",name) - report() - if logs.pushtarget then - logs.pushtarget("log") - end - report("Plugins are not officially supported unless stated otherwise. This is because") - report("they bypass the regular font handling and therefore some features in ConTeXt") - report("(especially those related to fonts) might not work as expected or might not work") - report("at all. Some plugins are for testing and development only and might change") - report("whenever we feel the need for it.") - report() - if logs.poptarget then - logs.poptarget() +do + local plugins={} + otf.plugins=plugins + local report=logs.reporter("fonts") + local warned=false + local okay={ text=true } + function otf.registerplugin(name,f) + if type(name)=="string" and type(f)=="function" then + plugins[name]={ name,f } + if okay[name] then + else + report("plugin %a has been loaded, please be aware of possible side effects",name) + if not warned then + if logs.pushtarget then + logs.pushtarget("log") + end + report("Plugins are not officially supported unless stated otherwise. This is because") + report("they bypass the regular font handling and therefore some features in ConTeXt") + report("(especially those related to fonts) might not work as expected or might not work") + report("at all. Some plugins are for testing and development only and might change") + report("whenever we feel the need for it.") + report() + if logs.poptarget then + logs.poptarget() + end + warned=true + end + end end end -end -function otf.plugininitializer(tfmdata,value) - if type(value)=="string" then - tfmdata.shared.plugin=plugins[value] + function otf.plugininitializer(tfmdata,value) + if type(value)=="string" then + tfmdata.shared.plugin=plugins[value] + end end -end -function otf.pluginprocessor(head,font,attr,direction) - local s=fontdata[font].shared - local p=s and s.plugin - if p then - if trace_plugins then - report_process("applying plugin %a",p[1]) + function otf.pluginprocessor(head,font,dynamic,direction) + local s=fontdata[font].shared + local p=s and s.plugin + if p then + if trace_plugins then + report_process("applying plugin %a",p[1]) + end + return p[2](head,font,dynamic,direction) + else + return head,false end - return p[2](head,font,attr,direction) - else - return head,false end end function otf.featuresinitializer(tfmdata,value) @@ -25447,10 +25513,10 @@ registerotffeature { }, } -end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-ots”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-ots”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-osd” 73c9531c79df5ada320cb20777f7ed49] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-osd” 0e051ca0d3b1a8e0604ced27e753fde8] --- if not modules then modules={} end modules ['font-osd']={ version=1.001, @@ -25487,11 +25553,11 @@ local setprop=nuts.setprop local getstate=nuts.getstate local setstate=nuts.setstate local ischar=nuts.ischar -local insert_node_after=nuts.insert_after +local insertnodeafter=nuts.insertafter local copy_node=nuts.copy local remove_node=nuts.remove -local flush_list=nuts.flush_list -local flush_node=nuts.flush_node +local flushlist=nuts.flushlist +local flushnode=nuts.flushnode local copyinjection=nodes.injections.copy local unsetvalue=attributes.unsetvalue local fontdata=fonts.hashes.identifiers @@ -26121,7 +26187,7 @@ local function inject_syntax_error(head,current,char) else setchar(current,dotted_circle) end - return insert_node_after(head,current,signal) + return insertnodeafter(head,current,signal) end local function initialize_one(font,attr) local tfmdata=fontdata[font] @@ -26239,7 +26305,7 @@ local function reorder_one(head,start,stop,font,attr,nbspaces) if current==stop then stop=getprev(stop) head=remove_node(head,current) - flush_node(current) + flushnode(current) return head,stop,nbspaces else nbspaces=nbspaces+1 @@ -26269,7 +26335,7 @@ local function reorder_one(head,start,stop,font,attr,nbspaces) tempcurrent=processcharacters(tempcurrent,font) setstate(tempcurrent,unsetvalue) if getchar(next)==getchar(tempcurrent) then - flush_list(tempcurrent) + flushlist(tempcurrent) if show_syntax_errors then head,current=inject_syntax_error(head,current,char) end @@ -26277,8 +26343,8 @@ local function reorder_one(head,start,stop,font,attr,nbspaces) setchar(current,getchar(tempcurrent)) local freenode=getnext(current) setlink(current,tmp) - flush_node(freenode) - flush_list(tempcurrent) + flushnode(freenode) + flushlist(tempcurrent) if changestop then stop=current end @@ -26405,7 +26471,7 @@ local function reorder_one(head,start,stop,font,attr,nbspaces) ch=tpm[1] setchar(n,ch) setchar(extra,tpm[2]) - head=insert_node_after(head,current,extra) + head=insertnodeafter(head,current,extra) tpm=twopart_mark[ch] end while c~=stop and dependent_vowel[ch] do @@ -26579,7 +26645,7 @@ local function reorder_one(head,start,stop,font,attr,nbspaces) stop=getprev(stop) end head=remove_node(head,base) - flush_node(base) + flushnode(base) end return head,stop,nbspaces end @@ -26839,7 +26905,7 @@ function handlers.devanagari_remove_joiners(head,start,kind,lookupname,replaceme if head==start then head=stop end - flush_list(start) + flushlist(start) return head,stop,true end local function initialize_two(font,attr) @@ -26984,7 +27050,7 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) if current==stop then stop=getprev(stop) head=remove_node(head,current) - flush_node(current) + flushnode(current) return head,stop,nbspaces else nbspaces=nbspaces+1 @@ -27081,7 +27147,7 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) char=tpm[1] setchar(current,char) setchar(extra,tpm[2]) - head=insert_node_after(head,current,extra) + head=insertnodeafter(head,current,extra) tpm=twopart_mark[char] end if not moved[current] and dependent_vowel[char] then @@ -27231,7 +27297,7 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) end nbspaces=nbspaces-1 head=remove_node(head,base) - flush_node(base) + flushnode(base) end return head,stop,nbspaces end @@ -27883,10 +27949,10 @@ for i=1,nofscripts do methods[scripts_two[i]]=method_two end -end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-osd”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-osd”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-ocl” 797b5c71bf819c5f4fb314a4d646e9a7] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-ocl” 2a377351ae23c339764ec8ce2e8e9164] --- if not modules then modules={} end modules ['font-ocl']={ version=1.001, @@ -28172,7 +28238,11 @@ if context then local xmlconvert=xml.convert local xmlfirst=xml.first function otfsvg.filterglyph(entry,index) - local svg=xmlconvert(entry.data) + local d=entry.data + if gzip.compressed(d) then + d=gzip.decompress(d) or d + end + local svg=xmlconvert(d) local root=svg and xmlfirst(svg,"/svg[@id='glyph"..index.."']") local data=root and tostring(root) return data @@ -28208,9 +28278,10 @@ end if inkscape then local descriptions=tfmdata.descriptions local nofshapes=#svgshapes + local s_format=inkscapeformat("pdf") local f_svgfile=formatters["temp-otf-svg-shape-%i.svg"] local f_pdffile=formatters["temp-otf-svg-shape-%i.pdf"] - local f_convert=formatters["%s --export-%s=%s\n"] + local f_convert=formatters[new and "file-open:%s; export-%s:%s; export-do\n" or "%s --export-%s=%s\n"] local filterglyph=otfsvg.filterglyph local nofdone=0 local processed={} @@ -28224,7 +28295,7 @@ end local svgfile=f_svgfile(index) local pdffile=f_pdffile(index) savedata(svgfile,data) - inkscape:write(f_convert(svgfile,inkscapeformat("pdf"),pdffile)) + inkscape:write(f_convert(svgfile,s_format,pdffile)) processed[index]=true nofdone=nofdone+1 if nofdone%25==0 then @@ -28429,10 +28500,10 @@ if context then } end -end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-ocl”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-ocl”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-otc” 0f12230ea07b5151f75d52726977e91f] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-otc” 0f12230ea07b5151f75d52726977e91f] --- if not modules then modules={} end modules ['font-otc']={ version=1.001, @@ -29189,10 +29260,10 @@ end otf.enhancers.enhance=enhance otf.enhancers.register("check extra features",enhance) -end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-otc”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-otc”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-onr” 6d161533f3437435e12a0ad64866df44] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-onr” 6d161533f3437435e12a0ad64866df44] --- if not modules then modules={} end modules ['font-onr']={ version=1.001, @@ -29565,10 +29636,10 @@ function readers.getinfo(filename) end end -end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-onr”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-onr”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-one” 53cd565030e919da984b50471cc3be37] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-one” bd39d42055a44ca2002f8ddbbbbf27c3] --- if not modules then modules={} end modules ['font-one']={ version=1.001, @@ -30179,6 +30250,7 @@ local function read_from_afm(specification) local tfmdata=afmtotfm(specification) if tfmdata then tfmdata.properties.name=specification.name + tfmdata.properties.id=specification.id tfmdata=constructors.scale(tfmdata,specification) local allfeatures=tfmdata.shared.features or specification.features.normal constructors.applymanipulators("afm",tfmdata,allfeatures,trace_features,report_afm) @@ -30282,10 +30354,10 @@ registerafmenhancer("normalize features",enhance_normalize_features) registerafmenhancer("check extra features",otfenhancers.enhance) registerafmenhancer("fix names",enhance_fix_names) -end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-one”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-one”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-afk” 9da14e0fb22129c053acc599d1312544] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-afk” 9da14e0fb22129c053acc599d1312544] --- if not modules then modules={} end modules ['font-afk']={ version=1.001, @@ -30452,10 +30524,10 @@ fonts.handlers.afm.helpdata={ } } -end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-afk”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-afk”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “fonts-tfm” f0eb5e2a8068b17ad401bb7efdba1630] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “fonts-tfm” f0eb5e2a8068b17ad401bb7efdba1630] --- if not modules then modules={} end modules ['luatex-fonts-tfm']={ version=1.001, @@ -30970,10 +31042,10 @@ registertfmfeature { } } -end --- [luaotfload, fontloader-2021-01-07.lua scope for “fonts-tfm”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “fonts-tfm”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-lua” 1fbfdf7b689b2bdfd0e3bb9bf74ce136] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-lua” 1fbfdf7b689b2bdfd0e3bb9bf74ce136] --- if not modules then modules={} end modules ['font-lua']={ version=1.001, @@ -31013,10 +31085,10 @@ function readers.lua(specification) return check_lua(specification,fullname) end -end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-lua”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-lua”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-def” b9d908c2338b7dc443ce9d1e9fcb7139] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-def” b9d908c2338b7dc443ce9d1e9fcb7139] --- if not modules then modules={} end modules ['font-def']={ version=1.001, @@ -31416,10 +31488,10 @@ if not context then callbacks.register('define_font',definers.read,"definition of fonts (tfmdata preparation)") end -end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-def”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-def”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-shp” 5ff497c993112d4fef4c148348d964eb] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-shp” 2bb36adb4b264a895a2c4d97e1ac1d1e] --- if not modules then modules={} end modules ['font-shp']={ version=1.001, @@ -31436,7 +31508,7 @@ local afm=fonts.handlers.afm local pfb=fonts.handlers.pfb local hashes=fonts.hashes local identifiers=hashes.identifiers -local version=0.009 +local version=0.010 local shapescache=containers.define("fonts","shapes",version,true) local streamscache=containers.define("fonts","streams",version,true) local compact_streams=false @@ -31784,10 +31856,10 @@ callback.register("glyph_stream_provider",function(id,index,mode) return "" end) -end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-shp”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-shp”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “fonts-def” f435e0875f203f343157baeff876ec9c] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “fonts-def” f435e0875f203f343157baeff876ec9c] --- if not modules then modules={} end modules ['luatex-fonts-def']={ version=1.001, @@ -31868,10 +31940,10 @@ function fonts.definers.applypostprocessors(tfmdata) return tfmdata end -end --- [luaotfload, fontloader-2021-01-07.lua scope for “fonts-def”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “fonts-def”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “fonts-ext” 32013cbc5d5d336be8b1d1e5879d86c4] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “fonts-ext” 32013cbc5d5d336be8b1d1e5879d86c4] --- if not modules then modules={} end modules ['luatex-fonts-ext']={ version=1.001, @@ -32057,10 +32129,10 @@ registerotffeature { } } -end --- [luaotfload, fontloader-2021-01-07.lua scope for “fonts-ext”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “fonts-ext”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-imp-tex” ceb087ef6fa2f89aed7179f60ddf8f35] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-imp-tex” ceb087ef6fa2f89aed7179f60ddf8f35] --- if not modules then modules={} end modules ['font-imp-tex']={ version=1.001, @@ -32159,10 +32231,10 @@ registerotffeature { description="arabic digits", } -end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-imp-tex”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-imp-tex”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-imp-ligatures” 26ffcf089391445f7af59536c8814364] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-imp-ligatures” 26ffcf089391445f7af59536c8814364] --- if not modules then modules={} end modules ['font-imp-ligatures']={ version=1.001, @@ -32276,10 +32348,10 @@ if context then } end -end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-imp-ligatures”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-imp-ligatures”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-imp-italics” defcb415bc1e0a0999b27773902adc18] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-imp-italics” defcb415bc1e0a0999b27773902adc18] --- if not modules then modules={} end modules ['font-imp-italics']={ version=1.001, @@ -32383,10 +32455,10 @@ if context then registerafmfeature(dimensions_specification) end -end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-imp-italics”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-imp-italics”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-imp-effects” a2dde5e071fcb3fc7b90f2bcd5aa4f22] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-imp-effects” d05997c1826355548ec9aec1346f9f23] --- if not modules then modules={} end modules ['font-imp-effects']={ version=1.001, @@ -32570,74 +32642,55 @@ local rules={ "FractionRuleThickness", "UnderbarRuleThickness", } -local setmathparameters -local setmathcharacters -if CONTEXTLMTXMODE and CONTEXTLMTXMODE>0 then - setmathparameters=function(tfmdata,characters,mathparameters,dx,dy,squeeze,multiplier) - if delta~=0 then - for i=1,#rules do - local name=rules[i] - local value=mathparameters[name] - if value then - mathparameters[name]=(squeeze or 1)*(value+dy) - end +local function setmathparameters(tfmdata,characters,mathparameters,dx,dy,squeeze,multiplier) + if dy~=0 then + for i=1,#rules do + local name=rules[i] + local value=mathparameters[name] + if value then + mathparameters[name]=(squeeze or 1)*(value+dy) end end end - setmathcharacters=function() - end -else - setmathparameters=function(tfmdata,characters,mathparameters,dx,dy,squeeze,multiplier) - if delta~=0 then - for i=1,#rules do - local name=rules[i] - local value=mathparameters[name] - if value then - mathparameters[name]=(squeeze or 1)*(value+dy) - end - end +end +local function setmathcharacters(tfmdata,characters,mathparameters,dx,dy,squeeze,wdelta,hdelta,ddelta) + local function wdpatch(char) + if wsnap~=0 then + char.width=char.width+wdelta/2 end end - setmathcharacters=function(tfmdata,characters,mathparameters,dx,dy,squeeze,wdelta,hdelta,ddelta) - local function wdpatch(char) - if wsnap~=0 then - char.width=char.width+wdelta/2 + local function htpatch(char) + if hsnap~=0 then + local height=char.height + if height then + char.height=char.height+2*dy end end - local function htpatch(char) - if hsnap~=0 then - local height=char.height - if height then - char.height=char.height+2*dy - end - end - end - local character=characters[0x221A] - if character and character.next then - local char=character - local next=character.next + end + local character=characters[0x221A] + if character and character.next then + local char=character + local next=character.next + wdpatch(char) + htpatch(char) + while next do + char=characters[next] wdpatch(char) htpatch(char) - while next do - char=characters[next] - wdpatch(char) - htpatch(char) - next=char.next - end - if char then - local v=char.vert_variants - if v then - local top=v[#v] - if top then - local char=characters[top.glyph] - htpatch(char) - end + next=char.next + end + if char then + local v=char.vert_variants + if v then + local top=v[#v] + if top then + local char=characters[top.glyph] + htpatch(char) end end end end end -local shiftmode=CONTEXTLMTXMODE and CONTEXTLMTXMODE>0 local function manipulateeffect(tfmdata) local effect=tfmdata.properties.effect if effect then @@ -32659,45 +32712,38 @@ local function manipulateeffect(tfmdata) local factor=(1+effect.factor)*factor local hfactor=(1+effect.hfactor)*hfactor local vfactor=(1+effect.vfactor)*vfactor - if shiftmode then - parameters.hshift=hshift - parameters.vshift=vshift - else - vshift=vshift~=0 and upcommand[vshift] or false - hshift=rightcommand[hshift] - end + vshift=vshift~=0 and upcommand[vshift] or false + hshift=rightcommand[hshift] for unicode,character in next,characters do local oldwidth=character.width local oldheight=character.height local olddepth=character.depth if oldwidth and oldwidth>0 then character.width=oldwidth+wdelta - if not shiftmode then - local commands=character.commands - if vshift then - if commands then + local commands=character.commands + if vshift then + if commands then + prependcommands (commands, + hshift, + vshift + ) + else + character.commands={ + hshift, + vshift, + charcommand[unicode] + } + end + else + if commands then prependcommands (commands, - hshift, - vshift + hshift ) - else - character.commands={ - hshift, - vshift, - charcommand[unicode] - } - end else - if commands then - prependcommands (commands, - hshift - ) - else - character.commands={ - hshift, - charcommand[unicode] - } - end + character.commands={ + hshift, + charcommand[unicode] + } end end end @@ -32769,10 +32815,10 @@ local specification={ registerotffeature(specification) registerafmfeature(specification) -end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-imp-effects”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-imp-effects”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “fonts-lig” fbd251eea3810a43a8d5542319361d68] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “fonts-lig” fbd251eea3810a43a8d5542319361d68] --- fonts.handlers.otf.addfeature { @@ -34841,10 +34887,10 @@ fonts.handlers.otf.addfeature { ["type"]="ligature", } -end --- [luaotfload, fontloader-2021-01-07.lua scope for “fonts-lig”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “fonts-lig”] --- -do --- [luaotfload, fontloader-2021-01-07.lua scope for “fonts-gbn” 10ecdf01e7c926e5128ad8a9dff4d677] --- +do --- [luaotfload, fontloader-2021-05-20.lua scope for “fonts-gbn” 34e4543a02f6fbc8c2ade896cb6dc7df] --- if not modules then modules={} end modules ['luatex-fonts-gbn']={ version=1.001, @@ -34860,8 +34906,8 @@ local next=next local fonts=fonts local nodes=nodes local nuts=nodes.nuts -local traverse_id=nuts.traverse_id -local flush_node=nuts.flush_node +local traverseid=nuts.traverseid +local flushnode=nuts.flushnode local glyph_code=nodes.nodecodes.glyph local disc_code=nodes.nodecodes.disc local tonode=nuts.tonode @@ -34920,7 +34966,7 @@ local function nodepass(head,groupcode,size,packtype,direction) local variants=nil local redundant=nil local nofused=0 - for n in traverse_id(glyph_code,head) do + for n in traverseid(glyph_code,head) do local font=getfont(n) if font~=prevfont then if basefont then @@ -34998,13 +35044,13 @@ local function nodepass(head,groupcode,size,packtype,direction) end end end - flush_node(r) + flushnode(r) end end - for d in traverse_id(disc_code,head) do + for d in traverseid(disc_code,head) do local _,_,r=getdisc(d) if r then - for n in traverse_id(glyph_code,r) do + for n in traverseid(glyph_code,r) do local font=getfont(n) if font~=prevfont then prevfont=font @@ -35072,7 +35118,7 @@ local function basepass(head) end return head end -local protectpass=node.direct.protect_glyphs +local protectpass=node.direct.protectglyphs or node.direct.protect_glyphs local injectpass=nodes.injections.handler function nodes.handlers.nodepass(head,...) if head then @@ -35109,7 +35155,7 @@ function nodes.simple_font_handler(head,groupcode,size,packtype,direction) return head end -end --- [luaotfload, fontloader-2021-01-07.lua scope for “fonts-gbn”] --- +end --- [luaotfload, fontloader-2021-05-20.lua scope for “fonts-gbn”] --- --- vim:ft=lua:sw=2:ts=8:et:tw=79 diff --git a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-basics-nod.lua b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-basics-nod.lua index 25f5473a5a3..76e36f2aabd 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-basics-nod.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-basics-nod.lua @@ -71,8 +71,8 @@ nodes.glyphcodes = glyphcodes nodes.disccodes = disccodes nodes.dirvalues = { lefttoright = 0, righttoleft = 1 } -nodes.handlers.protectglyphs = node.protect_glyphs -- beware: nodes! -nodes.handlers.unprotectglyphs = node.unprotect_glyphs -- beware: nodes! +nodes.handlers.protectglyphs = node.protectglyphs or node.protect_glyphs -- beware: nodes! +nodes.handlers.unprotectglyphs = node.unprotectglyphs or node.unprotect_glyphs -- beware: nodes! -- in generic code, at least for some time, we stay nodes, while in context -- we can go nuts (e.g. experimental); this split permits us us keep code @@ -81,84 +81,85 @@ nodes.handlers.unprotectglyphs = node.unprotect_glyphs -- beware: nodes! -- much of this will go away .. it's part of the context interface and not -- officially in luatex-*.lua -local direct = node.direct -local nuts = { } -nodes.nuts = nuts - -local tonode = direct.tonode -local tonut = direct.todirect - -nodes.tonode = tonode -nodes.tonut = tonut - -nuts.tonode = tonode -nuts.tonut = tonut - -nuts.getattr = direct.get_attribute -nuts.getboth = direct.getboth -nuts.getchar = direct.getchar -nuts.getdirection = direct.getdirection -nuts.getdisc = direct.getdisc -nuts.getreplace = direct.getreplace -nuts.getfield = direct.getfield -nuts.getfont = direct.getfont -nuts.getid = direct.getid -nuts.getkern = direct.getkern -nuts.getlist = direct.getlist -nuts.getnext = direct.getnext -nuts.getoffsets = direct.getoffsets -nuts.getoptions = direct.getoptions or function() return 0 end -nuts.getprev = direct.getprev -nuts.getsubtype = direct.getsubtype -nuts.getwidth = direct.getwidth -nuts.setattr = direct.setfield -nuts.setboth = direct.setboth -nuts.setchar = direct.setchar -nuts.setcomponents = direct.setcomponents -nuts.setdirection = direct.setdirection -nuts.setdisc = direct.setdisc -nuts.setreplace = direct.setreplace -nuts.setfield = setfield -nuts.setkern = direct.setkern -nuts.setlink = direct.setlink -nuts.setlist = direct.setlist -nuts.setnext = direct.setnext -nuts.setoffsets = direct.setoffsets -nuts.setprev = direct.setprev -nuts.setsplit = direct.setsplit -nuts.setsubtype = direct.setsubtype -nuts.setwidth = direct.setwidth - -nuts.getglyphdata = nuts.getattr -nuts.setglyphdata = nuts.setattr - -nuts.ischar = direct.is_char -nuts.isglyph = direct.is_glyph - -nuts.copy = direct.copy -nuts.copy_list = direct.copy_list -nuts.copy_node = direct.copy -nuts.end_of_math = direct.end_of_math -nuts.flush = direct.flush -nuts.flush_list = direct.flush_list -nuts.flush_node = direct.flush_node -nuts.free = direct.free -nuts.insert_after = direct.insert_after -nuts.insert_before = direct.insert_before -nuts.is_node = direct.is_node -nuts.kerning = direct.kerning -nuts.ligaturing = direct.ligaturing -nuts.new = direct.new -nuts.remove = direct.remove -nuts.tail = direct.tail -nuts.traverse = direct.traverse -nuts.traverse_char = direct.traverse_char -nuts.traverse_glyph = direct.traverse_glyph -nuts.traverse_id = direct.traverse_id +local direct = node.direct +local nuts = { } +nodes.nuts = nuts + +local tonode = direct.tonode +local tonut = direct.todirect + +nodes.tonode = tonode +nodes.tonut = tonut + +nuts.tonode = tonode +nuts.tonut = tonut + +nuts.getattr = direct.get_attribute +nuts.getboth = direct.getboth +nuts.getchar = direct.getchar +nuts.getdirection = direct.getdirection +nuts.getdisc = direct.getdisc +nuts.getreplace = direct.getreplace +nuts.getfield = direct.getfield +nuts.getfont = direct.getfont +nuts.getid = direct.getid +nuts.getkern = direct.getkern +nuts.getlist = direct.getlist +nuts.getnext = direct.getnext +nuts.getoffsets = direct.getoffsets +nuts.getoptions = direct.getoptions or function() return 0 end +nuts.getprev = direct.getprev +nuts.getsubtype = direct.getsubtype +nuts.getwidth = direct.getwidth +nuts.setattr = direct.setfield +nuts.setboth = direct.setboth +nuts.setchar = direct.setchar +nuts.setcomponents = direct.setcomponents +nuts.setdirection = direct.setdirection +nuts.setdisc = direct.setdisc +nuts.setreplace = direct.setreplace +nuts.setfield = setfield +nuts.setkern = direct.setkern +nuts.setlink = direct.setlink +nuts.setlist = direct.setlist +nuts.setnext = direct.setnext +nuts.setoffsets = direct.setoffsets +nuts.setprev = direct.setprev +nuts.setsplit = direct.setsplit +nuts.setsubtype = direct.setsubtype +nuts.setwidth = direct.setwidth + +nuts.getglyphdata = nuts.getattribute or nuts.getattr +nuts.setglyphdata = nuts.setattribute or nuts.setattr + +nuts.ischar = direct.ischar or direct.is_char +nuts.isglyph = direct.isglyph or direct.is_glyph +nuts.copy = direct.copy +nuts.copynode = direct.copy +nuts.copylist = direct.copylist or direct.copy_list +nuts.endofmath = direct.endofmath or direct.end_of_math +nuts.flush = direct.flush +nuts.flushlist = direct.flushlist or direct.flush_list +nuts.flushnode = direct.flushnode or direct.flush_node +nuts.free = direct.free +nuts.insertafter = direct.insertafter or direct.insert_after +nuts.insertbefore = direct.insertbefore or direct.insert_before +nuts.isnode = direct.isnode or direct.is_node +nuts.isdirect = direct.isdirect or direct.is_direct +nuts.isnut = direct.isdirect or direct.is_direct +nuts.kerning = direct.kerning +nuts.ligaturing = direct.ligaturing +nuts.new = direct.new +nuts.remove = direct.remove +nuts.tail = direct.tail +nuts.traverse = direct.traverse +nuts.traversechar = direct.traversechar or direct.traverse_char +nuts.traverseglyph = direct.traverseglyph or direct.traverse_glyph +nuts.traverseid = direct.traverseid or direct.traverse_id -- properties as used in the (new) injector: -local propertydata = direct.get_properties_table() +local propertydata = (direct.getpropertiestable or direct.get_properties_table)() nodes.properties = { data = propertydata } if direct.set_properties_mode then @@ -199,10 +200,10 @@ local setfield = nuts.setfield local getsubtype = nuts.getsubtype local isglyph = nuts.isglyph local find_tail = nuts.tail -local flush_list = nuts.flush_list -local flush_node = nuts.flush_node -local traverse_id = nuts.traverse_id -local copy_node = nuts.copy_node +local flushlist = nuts.flushlist +local flushnode = nuts.flushnode +local traverseid = nuts.traverseid +local copynode = nuts.copynode local glyph_code = nodes.nodecodes.glyph local ligature_code = nodes.glyphcodes.ligature @@ -222,22 +223,22 @@ end do - local get_components = node.direct.getcomponents - local set_components = node.direct.setcomponents + local getcomponents = node.direct.getcomponents + local setcomponents = node.direct.setcomponents - local function copy_no_components(g,copyinjection) - local components = get_components(g) + local function copynocomponents(g,copyinjection) + local components = getcomponents(g) if components then - set_components(g) - local n = copy_node(g) + setcomponents(g) + local n = copynode(g) if copyinjection then copyinjection(n,g) end - set_components(g,components) + setcomponents(g,components) -- maybe also upgrade the subtype but we don't use it anyway return n else - local n = copy_node(g) + local n = copynode(g) if copyinjection then copyinjection(n,g) end @@ -245,11 +246,11 @@ do end end - local function copy_only_glyphs(current) + local function copyonlyglyphs(current) local head = nil local previous = nil - for n in traverse_id(glyph_code,current) do - n = copy_node(n) + for n in traverseid(glyph_code,current) do + n = copynode(n) if head then setlink(previous,n) else @@ -260,14 +261,14 @@ do return head end - local function count_components(start,marks) + local function countcomponents(start,marks) local char = isglyph(start) if char then if getsubtype(start) == ligature_code then local n = 0 - local components = get_components(start) + local components = getcomponents(start) while components do - n = n + count_components(components,marks) + n = n + countcomponents(components,marks) components = getnext(components) end return n @@ -278,20 +279,22 @@ do return 0 end - local function flush_components() + local function flushcomponents() -- this is a no-op in mkiv / generic end - nuts.set_components = set_components - nuts.get_components = get_components - nuts.copy_only_glyphs = copy_only_glyphs - nuts.copy_no_components = copy_no_components - nuts.count_components = count_components - nuts.flush_components = flush_components + nuts.components = { + set = setcomponents, + get = getcomponents, + copyonlyglyphs = copyonlyglyphs, + copynocomponents = copynocomponents, + count = countcomponents, + flush = flushcomponents, + } end -nuts.uses_font = direct.uses_font +nuts.usesfont = direct.usesfont or direct.uses_font do @@ -301,12 +304,12 @@ do local dummy = tonut(node.new("glyph")) nuts.traversers = { - glyph = nuts.traverse_id(nodecodes.glyph,dummy), - glue = nuts.traverse_id(nodecodes.glue,dummy), - disc = nuts.traverse_id(nodecodes.disc,dummy), - boundary = nuts.traverse_id(nodecodes.boundary,dummy), + glyph = nuts.traverseid(nodecodes.glyph,dummy), + glue = nuts.traverseid(nodecodes.glue,dummy), + disc = nuts.traverseid(nodecodes.disc,dummy), + boundary = nuts.traverseid(nodecodes.boundary,dummy), - char = nuts.traverse_char(dummy), + char = nuts.traversechar(dummy), node = nuts.traverse(dummy), } @@ -333,7 +336,7 @@ do local getsubtype = nuts.getsubtype - function nuts.start_of_par(n) + function nuts.startofpar(n) local s = getsubtype(n) return s == 0 or s == 2 -- sorry, hardcoded, won't change anyway end diff --git a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-cff.lua b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-cff.lua index 4e2981011ac..ff87292baf5 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-cff.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-cff.lua @@ -29,7 +29,7 @@ if not modules then modules = { } end modules ['font-cff'] = { local next, type, tonumber, rawget = next, type, tonumber, rawget local byte, char, gmatch, sub = string.byte, string.char, string.gmatch, string.sub -local concat, remove, unpack = table.concat, table.remove, table.unpack +local concat, insert, remove, unpack = table.concat, table.insert, table.remove, table.unpack local floor, abs, round, ceil, min, max = math.floor, math.abs, math.round, math.ceil, math.min, math.max local P, C, R, S, C, Cs, Ct = lpeg.P, lpeg.C, lpeg.R, lpeg.S, lpeg.C, lpeg.Cs, lpeg.Ct local lpegmatch = lpeg.match @@ -745,6 +745,13 @@ do -- some back. I inlined some of then and a bit speed can be gained by more -- inlining but not that much. + -- Maybe have several action tables: + -- + -- keep curve / checked + -- keep curve / not checked + -- checked + -- not checked + local function xymoveto() if keepcurve then r = r + 1 @@ -1968,8 +1975,38 @@ do showstate(reverse[t] or "<action>") end if top > 0 then - for i=1,top do - r = r + 1 ; result[r] = encode[stack[i]] + -- if t == 8 and top > 42 then + if t == 8 and top > 48 then + -- let's assume this only happens for rrcurveto .. the other ones would need some more + -- complex handling (cff2 stuff) + local n = 0 + for i=1,top do + -- if n == 42 then + if n == 48 then + local zero = encode[0] + local res3 = result[r-3] + local res2 = result[r-2] + local res1 = result[r-1] + local res0 = result[r] + result[r-3] = zero + result[r-2] = zero + r = r + 1 ; result[r] = chars[t] + r = r + 1 ; result[r] = zero + r = r + 1 ; result[r] = zero + r = r + 1 ; result[r] = res3 + r = r + 1 ; result[r] = res2 + r = r + 1 ; result[r] = res1 + r = r + 1 ; result[r] = res0 + n = 1 + else + n = n + 1 + end + r = r + 1 ; result[r] = encode[stack[i]] + end + else + for i=1,top do + r = r + 1 ; result[r] = encode[stack[i]] + end end top = 0 end diff --git a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-imp-effects.lua b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-imp-effects.lua index 43ce82b71a6..27a16914b8e 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-imp-effects.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-imp-effects.lua @@ -207,94 +207,63 @@ local rules = { "UnderbarRuleThickness", } --- local commands = char.commands --- if commands then --- local command = commands[1] --- if command and command[1] == "right" then --- commands[1] = rightcommand[command[2]-snap] --- end --- end - -- radicals are not yet ok -local setmathparameters -local setmathcharacters - -if CONTEXTLMTXMODE and CONTEXTLMTXMODE > 0 then - - setmathparameters = function(tfmdata,characters,mathparameters,dx,dy,squeeze,multiplier) - if delta ~= 0 then - for i=1,#rules do - local name = rules[i] - local value = mathparameters[name] - if value then - mathparameters[name] = (squeeze or 1) * (value + dy) - end +local function setmathparameters(tfmdata,characters,mathparameters,dx,dy,squeeze,multiplier) + -- hm, this was "if delta ~= 0 then" but delta was gone + if dy ~= 0 then + for i=1,#rules do + local name = rules[i] + local value = mathparameters[name] + if value then + mathparameters[name] = (squeeze or 1) * (value + dy) end end end +end - setmathcharacters = function() - end +local function setmathcharacters(tfmdata,characters,mathparameters,dx,dy,squeeze,wdelta,hdelta,ddelta) -else + -- still not the perfect rule - setmathparameters = function(tfmdata,characters,mathparameters,dx,dy,squeeze,multiplier) - if delta ~= 0 then - for i=1,#rules do - local name = rules[i] - local value = mathparameters[name] - if value then - mathparameters[name] = (squeeze or 1) * (value + dy) - end - end + local function wdpatch(char) + if wsnap ~= 0 then + char.width = char.width + wdelta/2 end end - setmathcharacters = function(tfmdata,characters,mathparameters,dx,dy,squeeze,wdelta,hdelta,ddelta) - - -- still not the perfect rule - - local function wdpatch(char) - if wsnap ~= 0 then - char.width = char.width + wdelta/2 - end - end - - local function htpatch(char) - if hsnap ~= 0 then - local height = char.height - if height then - char.height = char.height + 2 * dy - end + local function htpatch(char) + if hsnap ~= 0 then + local height = char.height + if height then + char.height = char.height + 2 * dy end end + end - local character = characters[0x221A] + local character = characters[0x221A] - if character and character.next then - local char = character - local next = character.next + if character and character.next then + local char = character + local next = character.next + wdpatch(char) + htpatch(char) + while next do + char = characters[next] wdpatch(char) htpatch(char) - while next do - char = characters[next] - wdpatch(char) - htpatch(char) - next = char.next - end - if char then - local v = char.vert_variants - if v then - local top = v[#v] - if top then - local char = characters[top.glyph] - htpatch(char) - end + next = char.next + end + if char then + local v = char.vert_variants + if v then + local top = v[#v] + if top then + local char = characters[top.glyph] + htpatch(char) end end end - end end @@ -304,8 +273,6 @@ end -- inspect(fonts.hashes.characters[f][c]) -- end } -local shiftmode = CONTEXTLMTXMODE and CONTEXTLMTXMODE > 0 - local function manipulateeffect(tfmdata) local effect = tfmdata.properties.effect if effect then @@ -327,49 +294,42 @@ local function manipulateeffect(tfmdata) local factor = (1 + effect.factor) * factor local hfactor = (1 + effect.hfactor) * hfactor local vfactor = (1 + effect.vfactor) * vfactor - if shiftmode then - parameters.hshift = hshift - parameters.vshift = vshift - else - vshift = vshift ~= 0 and upcommand[vshift] or false - hshift = rightcommand[hshift] - end + vshift = vshift ~= 0 and upcommand[vshift] or false + hshift = rightcommand[hshift] for unicode, character in next, characters do local oldwidth = character.width local oldheight = character.height local olddepth = character.depth if oldwidth and oldwidth > 0 then character.width = oldwidth + wdelta - if not shiftmode then - local commands = character.commands - if vshift then - if commands then - prependcommands ( commands, - -- show_effect, - hshift, - vshift - ) - else - character.commands = { - -- show_effect, - hshift, - vshift, - charcommand[unicode] - } - end + local commands = character.commands + if vshift then + if commands then + prependcommands ( commands, + -- show_effect, + hshift, + vshift + ) + else + character.commands = { + -- show_effect, + hshift, + vshift, + charcommand[unicode] + } + end + else + if commands then + prependcommands ( commands, + -- show_effect, + hshift + ) else - if commands then - prependcommands ( commands, - -- show_effect, - hshift - ) - else - character.commands = { - -- show_effect, - hshift, - charcommand[unicode] - } - end + character.commands = { + -- show_effect, + hshift, + charcommand[unicode] + } end end end diff --git a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ocl.lua b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ocl.lua index e6a38af5c3e..7d960922f47 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ocl.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ocl.lua @@ -370,13 +370,24 @@ if context then local xmlconvert = xml.convert local xmlfirst = xml.first + -- function otfsvg.filterglyph(entry,index) + -- -- we only support decompression in lmtx, so one needs to wipe the + -- -- cache when invalid xml is reported + -- local svg = xmlconvert(entry.data) + -- local root = svg and xmlfirst(svg,"/svg[@id='glyph"..index.."']") + -- local data = root and tostring(root) + -- -- report_svg("data for glyph %04X: %s",index,data) + -- return data + -- end + function otfsvg.filterglyph(entry,index) - -- we only support decompression in lmtx, so one needs to wipe the - -- cache when invalid xml is reported - local svg = xmlconvert(entry.data) + local d = entry.data + if gzip.compressed(d) then + d = gzip.decompress(d) or d + end + local svg = xmlconvert(d) local root = svg and xmlfirst(svg,"/svg[@id='glyph"..index.."']") local data = root and tostring(root) - -- report_svg("data for glyph %04X: %s",index,data) return data end @@ -412,6 +423,9 @@ end -- -- Because a generic setup can be flawed we need to catch bad inkscape runs which add a bit of -- ugly overhead. Bah. + -- + -- In the long run this method is a dead end because we cannot rely on command line arguments + -- etc to be upward compatible (so no real batch tool). local new = nil @@ -430,9 +444,10 @@ end -- local indices = fonts.getindices(tfmdata) local descriptions = tfmdata.descriptions local nofshapes = #svgshapes + local s_format = inkscapeformat("pdf") -- hack, this will go away when is >= 0 is everywhere local f_svgfile = formatters["temp-otf-svg-shape-%i.svg"] local f_pdffile = formatters["temp-otf-svg-shape-%i.pdf"] - local f_convert = formatters["%s --export-%s=%s\n"] + local f_convert = formatters[new and "file-open:%s; export-%s:%s; export-do\n" or "%s --export-%s=%s\n"] local filterglyph = otfsvg.filterglyph local nofdone = 0 local processed = { } @@ -446,7 +461,7 @@ end local svgfile = f_svgfile(index) local pdffile = f_pdffile(index) savedata(svgfile,data) - inkscape:write(f_convert(svgfile,inkscapeformat("pdf"),pdffile)) + inkscape:write(f_convert(svgfile,s_format,pdffile)) processed[index] = true nofdone = nofdone + 1 if nofdone % 25 == 0 then diff --git a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-one.lua b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-one.lua index 5ef6e47497a..829f52ea043 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-one.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-one.lua @@ -727,6 +727,7 @@ local function read_from_afm(specification) local tfmdata = afmtotfm(specification) if tfmdata then tfmdata.properties.name = specification.name + tfmdata.properties.id = specification.id tfmdata = constructors.scale(tfmdata, specification) local allfeatures = tfmdata.shared.features or specification.features.normal constructors.applymanipulators("afm",tfmdata,allfeatures,trace_features,report_afm) diff --git a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-osd.lua b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-osd.lua index 87453d9e2d9..2d0e685c193 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-osd.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-osd.lua @@ -118,11 +118,11 @@ local setstate = nuts.setstate local ischar = nuts.ischar -local insert_node_after = nuts.insert_after +local insertnodeafter = nuts.insertafter local copy_node = nuts.copy local remove_node = nuts.remove -local flush_list = nuts.flush_list -local flush_node = nuts.flush_node +local flushlist = nuts.flushlist +local flushnode = nuts.flushnode local copyinjection = nodes.injections.copy -- KE: is this necessary? HH: probably not as positioning comes later and we rawget/set @@ -826,7 +826,7 @@ local function inject_syntax_error(head,current,char) else setchar(current,dotted_circle) end - return insert_node_after(head,current,signal) + return insertnodeafter(head,current,signal) end -- hm, this is applied to one character: @@ -968,7 +968,7 @@ local function reorder_one(head,start,stop,font,attr,nbspaces) if current == stop then stop = getprev(stop) head = remove_node(head,current) - flush_node(current) + flushnode(current) return head, stop, nbspaces else nbspaces = nbspaces + 1 @@ -998,7 +998,7 @@ local function reorder_one(head,start,stop,font,attr,nbspaces) tempcurrent = processcharacters(tempcurrent,font) setstate(tempcurrent,unsetvalue) if getchar(next) == getchar(tempcurrent) then - flush_list(tempcurrent) + flushlist(tempcurrent) if show_syntax_errors then head, current = inject_syntax_error(head,current,char) end @@ -1006,8 +1006,8 @@ local function reorder_one(head,start,stop,font,attr,nbspaces) setchar(current,getchar(tempcurrent)) -- we assumes that the result of blwf consists of one node local freenode = getnext(current) setlink(current,tmp) - flush_node(freenode) - flush_list(tempcurrent) + flushnode(freenode) + flushlist(tempcurrent) if changestop then stop = current end @@ -1154,7 +1154,7 @@ local function reorder_one(head,start,stop,font,attr,nbspaces) ch = tpm[1] setchar(n,ch) setchar(extra,tpm[2]) - head = insert_node_after(head,current,extra) + head = insertnodeafter(head,current,extra) tpm = twopart_mark[ch] end while c ~= stop and dependent_vowel[ch] do @@ -1335,7 +1335,7 @@ local function reorder_one(head,start,stop,font,attr,nbspaces) stop = getprev(stop) end head = remove_node(head,base) - flush_node(base) + flushnode(base) end return head, stop, nbspaces @@ -1712,7 +1712,7 @@ function handlers.devanagari_remove_joiners(head,start,kind,lookupname,replaceme if head == start then head = stop end - flush_list(start) + flushlist(start) return head, stop, true end @@ -1876,7 +1876,7 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) -- maybe do a pas if current == stop then stop = getprev(stop) head = remove_node(head,current) - flush_node(current) + flushnode(current) return head, stop, nbspaces else nbspaces = nbspaces + 1 @@ -1979,7 +1979,7 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) -- maybe do a pas char = tpm[1] setchar(current,char) setchar(extra,tpm[2]) - head = insert_node_after(head,current,extra) + head = insertnodeafter(head,current,extra) tpm = twopart_mark[char] end -- @@ -2154,7 +2154,7 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) -- maybe do a pas end nbspaces = nbspaces - 1 head = remove_node(head, base) - flush_node(base) + flushnode(base) end return head, stop, nbspaces diff --git a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ota.lua b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ota.lua index ce1b22b50d7..a8f9f0047c2 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ota.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ota.lua @@ -40,7 +40,7 @@ local getsubtype = nuts.getsubtype local getchar = nuts.getchar local ischar = nuts.ischar -local end_of_math = nuts.end_of_math +local endofmath = nuts.endofmath local nodecodes = nodes.nodecodes ----- glyph_code = nodecodes.glyph @@ -173,7 +173,7 @@ function analyzers.setstate(head,font) end first, last, n = nil, nil, 0 if id == math_code then - current = end_of_math(current) + current = endofmath(current) end elseif id == disc_code then -- always in the middle .. it doesn't make much sense to assign a property @@ -189,7 +189,7 @@ function analyzers.setstate(head,font) end first, last, n = nil, nil, 0 if id == math_code then - current = end_of_math(current) + current = endofmath(current) end end current = getnext(current) @@ -435,7 +435,7 @@ function methods.arab(head,font,attr) first = nil end if id == math_code then -- a bit duplicate as we test for glyphs twice - current = end_of_math(current) + current = endofmath(current) end end current = getnext(current) @@ -562,7 +562,7 @@ do wrapup() end if id == math_code then -- a bit duplicate as we test for glyphs twice - current = end_of_math(current) + current = endofmath(current) end end current = getnext(current) diff --git a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-otj.lua b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-otj.lua index bb02044dca6..c4ec9972cd4 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-otj.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-otj.lua @@ -90,6 +90,8 @@ local getoffsets = nuts.getoffsets local getboth = nuts.getboth local getdisc = nuts.getdisc local setdisc = nuts.setdisc +local getreplace = nuts.getreplace +local setreplace = nuts.setreplace local setoffsets = nuts.setoffsets local ischar = nuts.ischar local getkern = nuts.getkern @@ -98,13 +100,11 @@ local setlink = nuts.setlink local setwidth = nuts.setwidth local getwidth = nuts.getwidth ------ traverse_id = nuts.traverse_id ------ traverse_char = nuts.traverse_char local nextchar = nuts.traversers.char local nextglue = nuts.traversers.glue -local insert_node_before = nuts.insert_before -local insert_node_after = nuts.insert_after +local insertnodebefore = nuts.insertbefore +local insertnodeafter = nuts.insertafter local properties = nodes.properties.data @@ -124,7 +124,7 @@ if not fontkern then -- generic local thekern = nuts.new("kern",0) -- fontkern local setkern = nuts.setkern - local copy_node = nuts.copy_node + local copy_node = nuts.copy fontkern = function(k) local n = copy_node(thekern) @@ -138,7 +138,7 @@ if not italickern then -- generic local thekern = nuts.new("kern",3) -- italiccorrection local setkern = nuts.setkern - local copy_node = nuts.copy_node + local copy_node = nuts.copy italickern = function(k) local n = copy_node(thekern) @@ -667,12 +667,12 @@ local function inject_kerns_only(head,where) if leftkern and leftkern ~= 0 then if prev and getid(prev) == glue_code then if useitalickerns then - head = insert_node_before(head,current,italickern(leftkern)) + head = insertnodebefore(head,current,italickern(leftkern)) else setwidth(prev, getwidth(prev) + leftkern) end else - head = insert_node_before(head,current,fontkern(leftkern)) + head = insertnodebefore(head,current,fontkern(leftkern)) end end end @@ -731,7 +731,7 @@ local function inject_kerns_only(head,where) if i then local leftkern = i.leftkern if leftkern and leftkern ~= 0 then - pre = insert_node_before(pre,n,fontkern(leftkern)) + pre = insertnodebefore(pre,n,fontkern(leftkern)) done = true end end @@ -747,7 +747,7 @@ local function inject_kerns_only(head,where) if i then local leftkern = i.leftkern if leftkern and leftkern ~= 0 then - post = insert_node_before(post,n,fontkern(leftkern)) + post = insertnodebefore(post,n,fontkern(leftkern)) done = true end end @@ -763,7 +763,7 @@ local function inject_kerns_only(head,where) if i then local leftkern = i.leftkern if leftkern and leftkern ~= 0 then - replace = insert_node_before(replace,n,fontkern(leftkern)) + replace = insertnodebefore(replace,n,fontkern(leftkern)) done = true end end @@ -830,39 +830,36 @@ local function inject_positions_only(head,where) rightkern = 0 elseif prev and getid(prev) == glue_code then if useitalickerns then - head = insert_node_before(head,current,italickern(leftkern)) + head = insertnodebefore(head,current,italickern(leftkern)) else setwidth(prev, getwidth(prev) + leftkern) end else - head = insert_node_before(head,current,fontkern(leftkern)) + head = insertnodebefore(head,current,fontkern(leftkern)) end end if rightkern and rightkern ~= 0 then if next and getid(next) == glue_code then if useitalickerns then - insert_node_after(head,current,italickern(rightkern)) + insertnodeafter(head,current,italickern(rightkern)) else setwidth(next, getwidth(next) + rightkern) end else - insert_node_after(head,current,fontkern(rightkern)) + insertnodeafter(head,current,fontkern(rightkern)) end end - else + elseif next then local i = p.emptyinjections if i then -- glyph|disc|glyph (special case) local rightkern = i.rightkern - if rightkern and rightkern ~= 0 then - if next and getid(next) == disc_code then - if replace then - -- error, we expect an empty one - else - -- KE setfield(next,"replace",fontkern(rightkern)) -- maybe also leftkern - replace = fontkern(rightkern) -- maybe also leftkern - done = true --KE - end + if rightkern and rightkern ~= 0 and getid(next) == disc_code then + local replace = getreplace(next) + if replace then + -- can't happen + else + setreplace(next,fontkern(rightkern)) end end end @@ -925,12 +922,12 @@ local function inject_positions_only(head,where) end local leftkern = i.leftkern if leftkern and leftkern ~= 0 then - pre = insert_node_before(pre,n,fontkern(leftkern)) + pre = insertnodebefore(pre,n,fontkern(leftkern)) done = true end local rightkern = i.rightkern if rightkern and rightkern ~= 0 then - insert_node_after(pre,n,fontkern(rightkern)) + insertnodeafter(pre,n,fontkern(rightkern)) done = true end end @@ -950,12 +947,12 @@ local function inject_positions_only(head,where) end local leftkern = i.leftkern if leftkern and leftkern ~= 0 then - post = insert_node_before(post,n,fontkern(leftkern)) + post = insertnodebefore(post,n,fontkern(leftkern)) done = true end local rightkern = i.rightkern if rightkern and rightkern ~= 0 then - insert_node_after(post,n,fontkern(rightkern)) + insertnodeafter(post,n,fontkern(rightkern)) done = true end end @@ -975,12 +972,12 @@ local function inject_positions_only(head,where) end local leftkern = i.leftkern if leftkern and leftkern ~= 0 then - replace = insert_node_before(replace,n,fontkern(leftkern)) + replace = insertnodebefore(replace,n,fontkern(leftkern)) done = true end local rightkern = i.rightkern if rightkern and rightkern ~= 0 then - insert_node_after(replace,n,fontkern(rightkern)) + insertnodeafter(replace,n,fontkern(rightkern)) done = true end end @@ -996,7 +993,7 @@ local function inject_positions_only(head,where) -- glyph|pre glyphs local rightkern = i.rightkern if rightkern and rightkern ~= 0 then - pre = insert_node_before(pre,pre,fontkern(rightkern)) + pre = insertnodebefore(pre,pre,fontkern(rightkern)) done = true end end @@ -1010,7 +1007,7 @@ local function inject_positions_only(head,where) -- glyph|replace glyphs local rightkern = i.rightkern if rightkern and rightkern ~= 0 then - replace = insert_node_before(replace,replace,fontkern(rightkern)) + replace = insertnodebefore(replace,replace,fontkern(rightkern)) done = true end end @@ -1144,8 +1141,8 @@ local function inject_everything(head,where) -- -- todo: head and check for prev / next kern -- - insert_node_before(n,n,fontkern(-wn)) - insert_node_after(n,n,fontkern(-wn)) + insertnodebefore(n,n,fontkern(-wn)) + insertnodeafter(n,n,fontkern(-wn)) end end end @@ -1295,39 +1292,37 @@ local function inject_everything(head,where) rightkern = 0 elseif prev and getid(prev) == glue_code then if useitalickerns then - head = insert_node_before(head,current,italickern(leftkern)) + head = insertnodebefore(head,current,italickern(leftkern)) else setwidth(prev, getwidth(prev) + leftkern) end else - head = insert_node_before(head,current,fontkern(leftkern)) + head = insertnodebefore(head,current,fontkern(leftkern)) end end if rightkern and rightkern ~= 0 then if next and getid(next) == glue_code then if useitalickerns then - insert_node_after(head,current,italickern(rightkern)) + insertnodeafter(head,current,italickern(rightkern)) else setwidth(next, getwidth(next) + rightkern) end else - insert_node_after(head,current,fontkern(rightkern)) + insertnodeafter(head,current,fontkern(rightkern)) end end end - else + elseif next then local i = p.emptyinjections if i then -- glyph|disc|glyph (special case) local rightkern = i.rightkern - if rightkern and rightkern ~= 0 then - if next and getid(next) == disc_code then - if replace then - -- error, we expect an empty one - else - replace = fontkern(rightkern) - done = true - end + if rightkern and rightkern ~= 0 and getid(next) == disc_code then + local replace = getreplace(next) + if replace then + -- can't happen + else + setreplace(next,fontkern(rightkern)) end end end @@ -1406,12 +1401,12 @@ local function inject_everything(head,where) end local leftkern = i.leftkern if leftkern and leftkern ~= 0 then - pre = insert_node_before(pre,n,fontkern(leftkern)) + pre = insertnodebefore(pre,n,fontkern(leftkern)) done = true end local rightkern = i.rightkern if rightkern and rightkern ~= 0 then - insert_node_after(pre,n,fontkern(rightkern)) + insertnodeafter(pre,n,fontkern(rightkern)) done = true end if hasmarks then @@ -1437,12 +1432,12 @@ local function inject_everything(head,where) end local leftkern = i.leftkern if leftkern and leftkern ~= 0 then - post = insert_node_before(post,n,fontkern(leftkern)) + post = insertnodebefore(post,n,fontkern(leftkern)) done = true end local rightkern = i.rightkern if rightkern and rightkern ~= 0 then - insert_node_after(post,n,fontkern(rightkern)) + insertnodeafter(post,n,fontkern(rightkern)) done = true end if hasmarks then @@ -1468,12 +1463,12 @@ local function inject_everything(head,where) end local leftkern = i.leftkern if leftkern and leftkern ~= 0 then - replace = insert_node_before(replace,n,fontkern(leftkern)) + replace = insertnodebefore(replace,n,fontkern(leftkern)) done = true end local rightkern = i.rightkern if rightkern and rightkern ~= 0 then - insert_node_after(replace,n,fontkern(rightkern)) + insertnodeafter(replace,n,fontkern(rightkern)) done = true end if hasmarks then @@ -1495,7 +1490,7 @@ local function inject_everything(head,where) -- glyph|pre glyphs local rightkern = i.rightkern if rightkern and rightkern ~= 0 then - pre = insert_node_before(pre,pre,fontkern(rightkern)) + pre = insertnodebefore(pre,pre,fontkern(rightkern)) done = true end end @@ -1509,7 +1504,7 @@ local function inject_everything(head,where) -- glyph|replace glyphs local rightkern = i.rightkern if rightkern and rightkern ~= 0 then - replace = insert_node_before(replace,replace,fontkern(rightkern)) + replace = insertnodebefore(replace,replace,fontkern(rightkern)) done = true end end @@ -1711,8 +1706,8 @@ local function injectspaces(head) if trace_spaces then report_spaces("%C [%p + %p + %p] %C",prevchar,lnew,old,rnew,nextchar) end - head = insert_node_before(head,n,italickern(lnew)) - insert_node_after(head,n,italickern(rnew)) + head = insertnodebefore(head,n,italickern(lnew)) + insertnodeafter(head,n,italickern(rnew)) else local new = old + (leftkern + rightkern) * factor if trace_spaces then @@ -1727,7 +1722,7 @@ local function injectspaces(head) if trace_spaces then report_spaces("%C [%p + %p]",prevchar,old,new) end - insert_node_after(head,n,italickern(new)) -- tricky with traverse but ok + insertnodeafter(head,n,italickern(new)) -- tricky with traverse but ok else local new = old + leftkern * factor if trace_spaces then @@ -1746,7 +1741,7 @@ local function injectspaces(head) if trace_spaces then report_spaces("[%p + %p] %C",old,new,nextchar) end - insert_node_after(head,n,italickern(new)) + insertnodeafter(head,n,italickern(new)) else local new = old + rightkern * factor if trace_spaces then diff --git a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-otl.lua b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-otl.lua index 19de2bb7771..4619e13dcf7 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-otl.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-otl.lua @@ -52,7 +52,7 @@ local report_otf = logs.reporter("fonts","otf loading") local fonts = fonts local otf = fonts.handlers.otf -otf.version = 3.113 -- beware: also sync font-mis.lua and in mtx-fonts +otf.version = 3.116 -- beware: also sync font-mis.lua and in mtx-fonts 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) @@ -608,6 +608,7 @@ local function read_from_otf(specification) -- this late ? .. needs checking tfmdata.properties.name = specification.name tfmdata.properties.sub = specification.sub + tfmdata.properties.id = specification.id -- tfmdata = constructors.scale(tfmdata,specification) local allfeatures = tfmdata.shared.features or specification.features.normal diff --git a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-otr.lua b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-otr.lua index 531f665de72..4b154b2563d 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-otr.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-otr.lua @@ -1292,8 +1292,8 @@ readers.post = function(f,fontdata,specification) if length > 0 then glyphs[mapping].name = readstring(f,length) else - report("quit post name fetching at %a of %a: %s",i,maxnames,"overflow") - break + -- report("quit post name fetching at %a of %a: %s",i,maxnames,"overflow") + -- break end end end diff --git a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ots.lua b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ots.lua index 880bcb6d50a..30d79c4077b 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ots.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ots.lua @@ -213,27 +213,29 @@ local getglyphdata = nuts.getglyphdata -- their positions because some complex ligatures might need that. For the moment we -- use an x_ prefix because for now generic follows the other approach. -local copy_no_components = nuts.copy_no_components -local copy_only_glyphs = nuts.copy_only_glyphs -local count_components = nuts.count_components -local set_components = nuts.set_components -local get_components = nuts.get_components -local flush_components = nuts.flush_components +local components = nuts.components +local copynocomponents = components.copynocomponents +local copyonlyglyphs = components.copyonlyglyphs +local countcomponents = components.count +local setcomponents = components.set +local getcomponents = components.get +local flushcomponents = components.flush --------------------------------------------------------------------------------------- local ischar = nuts.ischar -local usesfont = nuts.uses_font +local usesfont = nuts.usesfont -local insert_node_after = nuts.insert_after +local insertnodeafter = nuts.insertafter local copy_node = nuts.copy -local copy_node_list = nuts.copy_list +local copy_node_list = nuts.copylist local remove_node = nuts.remove local find_node_tail = nuts.tail -local flush_node_list = nuts.flush_list -local flush_node = nuts.flush_node -local end_of_math = nuts.end_of_math -local start_of_par = nuts.start_of_par +local flushnodelist = nuts.flushlist +local flushnode = nuts.flushnode +local endofmath = nuts.endofmath + +local startofpar = nuts.startofpar local setmetatable = setmetatable local setmetatableindex = table.setmetatableindex @@ -317,13 +319,6 @@ local checkstep = (tracers and tracers.steppers.check) or function() local registerstep = (tracers and tracers.steppers.register) or function() end local registermessage = (tracers and tracers.steppers.message) or function() end --- local function checkdisccontent(d) --- local pre, post, replace = getdisc(d) --- if pre then for n in traverse_id(glue_code,pre) do report("pre: %s",nodes.idstostring(pre)) break end end --- if post then for n in traverse_id(glue_code,post) do report("pos: %s",nodes.idstostring(post)) break end end --- if replace then for n in traverse_id(glue_code,replace) do report("rep: %s",nodes.idstostring(replace)) break end end --- end - local function logprocess(...) if trace_steps then registermessage(...) @@ -423,12 +418,12 @@ local function flattendisk(head,disc) local prev, next = getboth(disc) local ishead = head == disc setdisc(disc) - flush_node(disc) + flushnode(disc) if pre then - flush_node_list(pre) + flushnodelist(pre) end if post then - flush_node_list(post) + flushnodelist(post) end if ishead then if replace then @@ -480,16 +475,16 @@ local function markstoligature(head,start,stop,char) local next = getnext(stop) setprev(start) setnext(stop) - local base = copy_no_components(start,copyinjection) + local base = copynocomponents(start,copyinjection) if head == start then head = base end resetinjection(base) setchar(base,char) setsubtype(base,ligatureglyph_code) - set_components(base,start) + setcomponents(base,start) setlink(prev,base,next) - flush_components(start) + flushcomponents(start) return head, base end end @@ -509,7 +504,7 @@ local no_right_ligature_code = 2 local no_left_kern_code = 4 local no_right_kern_code = 8 -local has_glyph_option = node.direct.has_glyph_option or function(n,c) +local hasglyphoption = function(n,c) if c == no_left_ligature_code or c == no_right_ligature_code then return getattr(n,a_noligature) == 1 else @@ -520,7 +515,7 @@ end -- in lmtx we need to check the components and can be slightly more clever local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfound,hasmarks) -- brr head - if has_glyph_option(start,no_right_ligature_code) then + if hasglyphoption(start,no_right_ligature_code) then return head, start end if start == stop and getchar(start) == char then @@ -533,14 +528,14 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou local comp = start setprev(start) setnext(stop) - local base = copy_no_components(start,copyinjection) + local base = copynocomponents(start,copyinjection) if start == head then head = base end resetinjection(base) setchar(base,char) setsubtype(base,ligatureglyph_code) - set_components(base,comp) + setcomponents(base,comp) setlink(prev,base,next) if not discfound then local deletemarks = not skiphash or hasmarks @@ -554,7 +549,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou local char = getchar(start) if not marks[char] then baseindex = baseindex + componentindex - componentindex = count_components(start,marks) + componentindex = countcomponents(start,marks) -- we can be more clever here: "not deletemarks or (skiphash and not skiphash[char])" -- and such: elseif not deletemarks then @@ -565,7 +560,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou end local n = copy_node(start) copyinjection(n,start) -- is this ok ? we position later anyway - head, current = insert_node_after(head,current,n) -- unlikely that mark has components + head, current = insertnodeafter(head,current,n) -- unlikely that mark has components elseif trace_marks then logwarning("%s: delete ligature mark %s",pref(dataset,sequence),gref(char)) end @@ -590,7 +585,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou break end end - flush_components(components) + flushcomponents(components) else -- discfound ... forget about marks .. probably no scripts that hyphenate and have marks local discprev, discnext = getboth(discfound) @@ -602,8 +597,8 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou if not replace then -- looks like we never come here as it's not okay local prev = getprev(base) - -- local comp = get_components(base) -- already set - local copied = copy_only_glyphs(comp) + -- local comp = getcomponents(base) -- already set + local copied = copyonlyglyphs(comp) if pre then setlink(discprev,pre) else @@ -620,7 +615,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou setlink(prev,discfound,next) setboth(base) -- here components have a pointer so we can't free it! - set_components(base,copied) + setcomponents(base,copied) replace = base if forcediscretionaries then setdisc(discfound,pre,post,replace,discretionarydisc_code) @@ -650,7 +645,7 @@ local function multiple_glyphs(head,start,multiple,skiphash,what,stop) -- what t local n = copy_node(start) -- ignore components resetinjection(n) setchar(n,multiple[k]) - insert_node_after(head,start,n) + insertnodeafter(head,start,n) start = n end if what == true then @@ -661,7 +656,7 @@ local function multiple_glyphs(head,start,multiple,skiphash,what,stop) -- what t local n = copy_node(start) -- ignore components resetinjection(n) setchar(n,m) - insert_node_after(head,start,n) + insertnodeafter(head,start,n) start = n end end @@ -924,7 +919,7 @@ function handlers.gsub_ligature(head,start,dataset,sequence,ligature,rlmode,skip end function handlers.gpos_single(head,start,dataset,sequence,kerns,rlmode,skiphash,step,injection) - if has_glyph_option(start,no_right_kern_code) then + if hasglyphoption(start,no_right_kern_code) then return head, start, false else local startchar = getchar(start) @@ -945,7 +940,7 @@ function handlers.gpos_single(head,start,dataset,sequence,kerns,rlmode,skiphash, end function handlers.gpos_pair(head,start,dataset,sequence,kerns,rlmode,skiphash,step,injection) - if has_glyph_option(start,no_right_kern_code) then + if hasglyphoption(start,no_right_kern_code) then return head, start, false else local snext = getnext(start) @@ -1536,7 +1531,7 @@ end function chainprocs.gpos_single(head,start,stop,dataset,sequence,currentlookup,rlmode,skiphash,chainindex) -- we actually should check no_left_kern_code with next - if not has_glyph_option(start,no_right_kern_code) then + if not hasglyphoption(start,no_right_kern_code) then local mapping = currentlookup.mapping if mapping == nil then mapping = getmapping(dataset,sequence,currentlookup) @@ -1566,7 +1561,7 @@ end function chainprocs.gpos_pair(head,start,stop,dataset,sequence,currentlookup,rlmode,skiphash,chainindex) -- todo: injections ? -- we actually should check no_left_kern_code with next - if not has_glyph_option(start,no_right_kern_code) then + if not hasglyphoption(start,no_right_kern_code) then local mapping = currentlookup.mapping if mapping == nil then mapping = getmapping(dataset,sequence,currentlookup) @@ -1934,13 +1929,13 @@ local function checked(head) if next then setlink(kern,next) end - flush_node(current) + flushnode(current) head = kern current = next else local prev, next = getboth(current) setlink(prev,kern,next) - flush_node(current) + flushnode(current) current = next end else @@ -2480,115 +2475,247 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s -- report("no hit in %a at %i of %i contexts",sequence.type,k,nofcontexts) goto next end - local s = seq.n -- or #seq - local l = ck[5] -- last current - local current = start - local last = start - + local s = seq.n -- or #seq if s == 1 then - goto next - end + -- bit weird case: why use a chain, but it is a hit + else + local l = ck[5] -- last current + local current = start + local last = start - -- current match + -- current match - if l > f then - -- before/current/after | before/current | current/after - local discfound -- = nil - local n = f + 1 - last = startnext -- the second in current (first already matched) - while n <= l do - if postreplace and not last then - last = getnext(sweepnode) - sweeptype = nil - end - if last then - local char, id = ischar(last,currentfont) - if char then - if 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 + if l > f then + -- before/current/after | before/current | current/after + local discfound -- = nil + local n = f + 1 + last = startnext -- the second in current (first already matched) + while n <= l do + if postreplace and not last then + last = getnext(sweepnode) + sweeptype = nil + end + if last then + local char, id = ischar(last,currentfont) + if char then + if skiphash and skiphash[char] then + skipped = true + if trace_skips then + show_skip(dataset,sequence,char,ck,classes[char]) + end last = getnext(last) - end - n = n + 1 - elseif discfound then - notmatchreplace[discfound] = true - if notmatchpre[discfound] then - goto next + 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 + goto next + else + break + end else - break - end - else - goto next - end - elseif char == false then - if discfound then - notmatchreplace[discfound] = true - if notmatchpre[discfound] then goto next + end + elseif char == false then + if discfound then + notmatchreplace[discfound] = true + if notmatchpre[discfound] then + goto next + else + break + end else - break + goto next end - else - goto next - end - elseif id == disc_code then - -- elseif id == disc_code and (not discs or discs[last]) then - discseen = true - discfound = last - notmatchpre[last] = nil - notmatchpost[last] = true - notmatchreplace[last] = nil - local pre, post, replace = getdisc(last) - if pre then - local n = n - while pre do - if seq[n][getchar(pre)] then - n = n + 1 - if n > l then + elseif id == disc_code then + -- elseif id == disc_code and (not discs or discs[last]) then + discseen = true + discfound = last + notmatchpre[last] = nil + notmatchpost[last] = true + notmatchreplace[last] = nil + local pre, post, replace = getdisc(last) + if pre then + local n = n + while pre do + if seq[n][getchar(pre)] then + n = n + 1 + if n > l then + break + end + pre = getnext(pre) + else + notmatchpre[last] = true break end - pre = getnext(pre) - else + end + if n <= l then notmatchpre[last] = true - break end - end - if n <= l then + else notmatchpre[last] = true end + if replace then + -- so far we never entered this branch + while replace do + if seq[n][getchar(replace)] then + n = n + 1 + if n > l then + break + end + replace = getnext(replace) + else + notmatchreplace[last] = true + if notmatchpre[last] then + goto next + else + break + end + end + end + -- why here again + if notmatchpre[last] then + goto next + end + end + -- maybe only if match + last = getnext(last) else - notmatchpre[last] = true + goto next end - if replace then - -- so far we never entered this branch - while replace do - if seq[n][getchar(replace)] then - n = n + 1 - if n > l then - break + else + goto next + end + end + end + + -- before + + if f > 1 then + if startprev then + local prev = startprev + if prereplace and prev == checkdisc then + prev = getprev(sweepnode) + end + if prev then + local discfound -- = nil + local n = f - 1 + while n >= 1 do + if prev then + local char, id = ischar(prev,currentfont) + if char then + if 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 + goto next + else + break + end + else + goto next end - replace = getnext(replace) - else - notmatchreplace[last] = true - if notmatchpre[last] then + elseif char == false then + if discfound then + notmatchreplace[discfound] = true + if notmatchpost[discfound] then + goto next + end + else goto next + end + break + elseif id == disc_code then + -- elseif id == disc_code and (not discs or discs[prev]) then + -- the special case: f i where i becomes dottless i .. + discseen = true + discfound = prev + notmatchpre[prev] = true + notmatchpost[prev] = nil + notmatchreplace[prev] = nil + local pre, post, replace, pretail, posttail, replacetail = getdisc(prev,true) + -- weird test: needs checking + if pre ~= start and post ~= start and replace ~= start then + if post then + local n = n + while posttail do + if seq[n][getchar(posttail)] then + n = n - 1 + if posttail == post or n < 1 then + break + else + posttail = getprev(posttail) + end + else + notmatchpost[prev] = true + break + end + end + if n >= 1 then + notmatchpost[prev] = true + end + else + notmatchpost[prev] = true + end + if replace then + -- we seldom enter this branch (e.g. on brill efficient) + while replacetail do + if seq[n][getchar(replacetail)] then + n = n - 1 + if replacetail == replace or n < 1 then + break + else + replacetail = getprev(replacetail) + end + else + notmatchreplace[prev] = true + if notmatchpost[prev] then + goto next + else + break + end + end + end + else + -- notmatchreplace[prev] = true -- not according to Kai + end + end + prev = getprev(prev) + -- elseif id == glue_code and seq[n][32] and isspace(prev,threshold,id) then + -- elseif seq[n][32] and spaces[prev] then + -- n = n - 1 + -- prev = getprev(prev) + elseif id == glue_code then + local sn = seq[n] + if (sn[32] and spaces[prev]) or sn[0xFFFC] then + n = n - 1 + prev = getprev(prev) else - break + goto next end + elseif seq[n][0xFFFC] then + n = n - 1 + prev = getprev(prev) + else + goto next end - end - -- why here again - if notmatchpre[last] then + else goto next end end - -- maybe only if match - last = getnext(last) else goto next end @@ -2596,37 +2723,35 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s goto next end end - end - -- before + -- after - if f > 1 then - if startprev then - local prev = startprev - if prereplace and prev == checkdisc then - prev = getprev(sweepnode) + if s > l then + local current = last and getnext(last) + if not current and postreplace then + current = getnext(sweepnode) end - if prev then + if current then local discfound -- = nil - local n = f - 1 - while n >= 1 do - if prev then - local char, id = ischar(prev,currentfont) + local n = l + 1 + while n <= s do + if current then + local char, id = ischar(current,currentfont) if char then if skiphash and skiphash[char] then skipped = true if trace_skips then show_skip(dataset,sequence,char,ck,classes[char]) end - prev = getprev(prev) + current = getnext(current) -- was absent elseif seq[n][char] then - if n > 1 then - prev = getprev(prev) + if n < s then -- new test + current = getnext(current) -- was absent end - n = n - 1 + n = n + 1 elseif discfound then notmatchreplace[discfound] = true - if notmatchpost[discfound] then + if notmatchpre[discfound] then goto next else break @@ -2637,217 +2762,87 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s elseif char == false then if discfound then notmatchreplace[discfound] = true - if notmatchpost[discfound] then + if notmatchpre[discfound] then goto next + else + break end else goto next end - break elseif id == disc_code then - -- elseif id == disc_code and (not discs or discs[prev]) then - -- the special case: f i where i becomes dottless i .. - discseen = true - discfound = prev - notmatchpre[prev] = true - notmatchpost[prev] = nil - notmatchreplace[prev] = nil - local pre, post, replace, pretail, posttail, replacetail = getdisc(prev,true) - -- weird test: needs checking - if pre ~= start and post ~= start and replace ~= start then - if post then - local n = n - while posttail do - if seq[n][getchar(posttail)] then - n = n - 1 - if posttail == post or n < 1 then - break - else - posttail = getprev(posttail) - end - else - notmatchpost[prev] = true + -- elseif id == disc_code and (not discs or discs[current]) then + discseen = true + discfound = current + notmatchpre[current] = nil + notmatchpost[current] = true + notmatchreplace[current] = nil + local pre, post, replace = getdisc(current) + if pre then + local n = n + while pre do + if seq[n][getchar(pre)] then + n = n + 1 + if n > s then break + else + pre = getnext(pre) end + else + notmatchpre[current] = true + break end - if n >= 1 then - notmatchpost[prev] = true - end - else - notmatchpost[prev] = true end - if replace then - -- we seldom enter this branch (e.g. on brill efficient) - while replacetail do - if seq[n][getchar(replacetail)] then - n = n - 1 - if replacetail == replace or n < 1 then - break - else - replacetail = getprev(replacetail) - end + if n <= s then + notmatchpre[current] = true + end + else + notmatchpre[current] = true + end + if replace then + -- so far we never entered this branch + while replace do + if seq[n][getchar(replace)] then + n = n + 1 + if n > s then + break else - notmatchreplace[prev] = true - if notmatchpost[prev] then - goto next - else - break - end + replace = getnext(replace) + end + else + notmatchreplace[current] = true + if notmatchpre[current] then + goto next + else + break end end - else - -- notmatchreplace[prev] = true -- not according to Kai end + else + -- notmatchreplace[current] = true -- not according to Kai end - prev = getprev(prev) - -- elseif id == glue_code and seq[n][32] and isspace(prev,threshold,id) then - -- elseif seq[n][32] and spaces[prev] then - -- n = n - 1 - -- prev = getprev(prev) + current = getnext(current) elseif id == glue_code then local sn = seq[n] - if (sn[32] and spaces[prev]) or sn[0xFFFC] then - n = n - 1 - prev = getprev(prev) + if (sn[32] and spaces[current]) or sn[0xFFFC] then + n = n + 1 + current = getnext(current) else goto next end elseif seq[n][0xFFFC] then - n = n - 1 - prev = getprev(prev) - else - goto next - end - else - goto next - end - end - else - goto next - end - else - goto next - end - end - - -- after - - if s > l then - local current = last and getnext(last) - if not current and postreplace then - current = getnext(sweepnode) - end - if current then - local discfound -- = nil - local n = l + 1 - while n <= s do - if current then - local char, id = ischar(current,currentfont) - if char then - if skiphash and skiphash[char] then - skipped = true - if trace_skips then - show_skip(dataset,sequence,char,ck,classes[char]) - end - current = getnext(current) -- was absent - elseif seq[n][char] then - if n < s then -- new test - current = getnext(current) -- was absent - end - n = n + 1 - elseif discfound then - notmatchreplace[discfound] = true - if notmatchpre[discfound] then - goto next - else - break - end - else - goto next - end - elseif char == false then - if discfound then - notmatchreplace[discfound] = true - if notmatchpre[discfound] then - goto next - else - break - end - else - goto next - end - elseif id == disc_code then - -- elseif id == disc_code and (not discs or discs[current]) then - discseen = true - discfound = current - notmatchpre[current] = nil - notmatchpost[current] = true - notmatchreplace[current] = nil - local pre, post, replace = getdisc(current) - if pre then - local n = n - while pre do - if seq[n][getchar(pre)] then - n = n + 1 - if n > s then - break - else - pre = getnext(pre) - end - else - notmatchpre[current] = true - break - end - end - if n <= s then - notmatchpre[current] = true - end - else - notmatchpre[current] = true - end - if replace then - -- so far we never entered this branch - while replace do - if seq[n][getchar(replace)] then - n = n + 1 - if n > s then - break - else - replace = getnext(replace) - end - else - notmatchreplace[current] = true - if notmatchpre[current] then - goto next - else - break - end - end - end - else - -- notmatchreplace[current] = true -- not according to Kai - end - current = getnext(current) - elseif id == glue_code then - local sn = seq[n] - if (sn[32] and spaces[current]) or sn[0xFFFC] then n = n + 1 current = getnext(current) else goto next end - elseif seq[n][0xFFFC] then - n = n + 1 - current = getnext(current) else goto next end - else - goto next end + else + goto next end - else - goto next end end @@ -3795,7 +3790,7 @@ do local initialrl = 0 - if getid(head) == par_code and start_of_par(head) then + if getid(head) == par_code and startofpar(head) then initialrl = pardirstate(head) elseif direction == righttoleft_code then initialrl = -1 @@ -3945,11 +3940,11 @@ do start = getnext(start) end elseif id == math_code then - start = getnext(end_of_math(start)) + start = getnext(endofmath(start)) elseif id == dir_code then topstack, rlmode = txtdirstate(start,dirstack,topstack,rlparmode) start = getnext(start) - -- elseif id == par_code and start_of_par(start) then + -- elseif id == par_code and startofpar(start) then -- rlparmode, rlmode = pardirstate(start) -- start = getnext(start) else @@ -4029,11 +4024,11 @@ do start = getnext(start) end elseif id == math_code then - start = getnext(end_of_math(start)) + start = getnext(endofmath(start)) elseif id == dir_code then topstack, rlmode = txtdirstate(start,dirstack,topstack,rlparmode) start = getnext(start) - -- elseif id == par_code and start_of_par(start) then + -- elseif id == par_code and startofpar(start) then -- rlparmode, rlmode = pardirstate(start) -- start = getnext(start) else @@ -4140,11 +4135,11 @@ do -- a different font|state or glue (happens often) start = getnext(start) elseif id == math_code then - start = getnext(end_of_math(start)) + start = getnext(endofmath(start)) elseif id == dir_code then topstack, rlmode = txtdirstate(start,dirstack,topstack,rlparmode) start = getnext(start) - -- elseif id == par_code and start_of_par(start) then + -- elseif id == par_code and startofpar(start) then -- rlparmode, rlmode = pardirstate(start) -- start = getnext(start) else @@ -4161,49 +4156,60 @@ end -- so far -local plugins = { } -otf.plugins = plugins +do -local report = logs.reporter("fonts") + local plugins = { } + otf.plugins = plugins -function otf.registerplugin(name,f) - if type(name) == "string" and type(f) == "function" then - plugins[name] = { name, f } - report() - report("plugin %a has been loaded, please be aware of possible side effects",name) - report() - if logs.pushtarget then - logs.pushtarget("log") - end - report("Plugins are not officially supported unless stated otherwise. This is because") - report("they bypass the regular font handling and therefore some features in ConTeXt") - report("(especially those related to fonts) might not work as expected or might not work") - report("at all. Some plugins are for testing and development only and might change") - report("whenever we feel the need for it.") - report() - if logs.poptarget then - logs.poptarget() + local report = logs.reporter("fonts") + local warned = false + local okay = { text = true } + + function otf.registerplugin(name,f) + if type(name) == "string" and type(f) == "function" then + plugins[name] = { name, f } + if okay[name] then + -- no warning (e.g. the diagnostic text plugin) + else + report("plugin %a has been loaded, please be aware of possible side effects",name) + if not warned then + if logs.pushtarget then + logs.pushtarget("log") + end + report("Plugins are not officially supported unless stated otherwise. This is because") + report("they bypass the regular font handling and therefore some features in ConTeXt") + report("(especially those related to fonts) might not work as expected or might not work") + report("at all. Some plugins are for testing and development only and might change") + report("whenever we feel the need for it.") + report() + if logs.poptarget then + logs.poptarget() + end + warned = true + end + end end end -end -function otf.plugininitializer(tfmdata,value) - if type(value) == "string" then - tfmdata.shared.plugin = plugins[value] + function otf.plugininitializer(tfmdata,value) + if type(value) == "string" then + tfmdata.shared.plugin = plugins[value] + end end -end -function otf.pluginprocessor(head,font,attr,direction) -- n - local s = fontdata[font].shared - local p = s and s.plugin - if p then - if trace_plugins then - report_process("applying plugin %a",p[1]) + function otf.pluginprocessor(head,font,dynamic,direction) -- n + local s = fontdata[font].shared + local p = s and s.plugin + if p then + if trace_plugins then + report_process("applying plugin %a",p[1]) + end + return p[2](head,font,dynamic,direction) + else + return head, false end - return p[2](head,font,attr,direction) - else - return head, false end + end function otf.featuresinitializer(tfmdata,value) diff --git a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ott.lua b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ott.lua index f4d7e05a137..aa1defd6a11 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ott.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ott.lua @@ -821,13 +821,13 @@ local features = allocate { ["dist"] = "distances", ["dlig"] = "discretionary ligatures", ["dnom"] = "denominators", - ["dtls"] = "dotless forms", -- math + ["dtls"] = "dotless forms", -- math ["expt"] = "expert forms", ["falt"] = "final glyph alternates", ["fin2"] = "terminal forms #2", ["fin3"] = "terminal forms #3", ["fina"] = "terminal forms", - ["flac"] = "flattened accents over capitals", -- math + ["flac"] = "flattened accents over capitals", -- math ["frac"] = "fractions", ["fwid"] = "full width", ["half"] = "half forms", @@ -836,7 +836,7 @@ local features = allocate { ["hist"] = "historical forms", ["hkna"] = "horizontal kana alternates", ["hlig"] = "historical ligatures", - ["hngl"] = "hangul", + ["hngl"] = "hangul", -- depricated ["hojo"] = "hojo kanji forms", ["hwid"] = "half width", ["init"] = "initial forms", diff --git a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-oup.lua b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-oup.lua index 2c49bc993f9..c93ad474386 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-oup.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-oup.lua @@ -2564,6 +2564,34 @@ end -- Because we pack we cannot mix tables and numbers so we can only turn a whole set in -- format kern instead of pair. +local strip_pairs = true + +local compact_pairs = true +local compact_singles = true + +local merge_pairs = true +local merge_singles = true +local merge_substitutions = true +local merge_alternates = true +local merge_multiples = true +local merge_ligatures = true +local merge_cursives = true +local merge_marks = true + +directives.register("otf.strip.pairs", function(v) strip_pairs = v end) + +directives.register("otf.compact.pairs", function(v) compact_pairs = v end) +directives.register("otf.compact.singles", function(v) compact_singles = v end) + +directives.register("otf.merge.pairs", function(v) merge_pairs = v end) +directives.register("otf.merge.singles", function(v) merge_singles = v end) +directives.register("otf.merge.substitutions", function(v) merge_substitutions = v end) +directives.register("otf.merge.alternates", function(v) merge_alternates = v end) +directives.register("otf.merge.multiples", function(v) merge_multiples = v end) +directives.register("otf.merge.ligatures", function(v) merge_ligatures = v end) +directives.register("otf.merge.cursives", function(v) merge_cursives = v end) +directives.register("otf.merge.marks", function(v) merge_marks = v end) + local function checkpairs(lookup) local steps = lookup.steps local nofsteps = lookup.nofsteps @@ -2581,6 +2609,7 @@ local function checkpairs(lookup) if v == true then -- all zero elseif v and (v[1] ~= 0 or v[2] ~= 0 or v[4] ~= 0) then + -- complex kerns return false end end @@ -2617,29 +2646,39 @@ local function checkpairs(lookup) return kerned end -local compact_pairs = true -local compact_singles = true - -local merge_pairs = true -local merge_singles = true -local merge_substitutions = true -local merge_alternates = true -local merge_multiples = true -local merge_ligatures = true -local merge_cursives = true -local merge_marks = true - -directives.register("otf.compact.pairs", function(v) compact_pairs = v end) -directives.register("otf.compact.singles", function(v) compact_singles = v end) +local function strippairs(lookup) + local steps = lookup.steps + local nofsteps = lookup.nofsteps + local stripped = 0 -directives.register("otf.merge.pairs", function(v) merge_pairs = v end) -directives.register("otf.merge.singles", function(v) merge_singles = v end) -directives.register("otf.merge.substitutions", function(v) merge_substitutions = v end) -directives.register("otf.merge.alternates", function(v) merge_alternates = v end) -directives.register("otf.merge.multiples", function(v) merge_multiples = v end) -directives.register("otf.merge.ligatures", function(v) merge_ligatures = v end) -directives.register("otf.merge.cursives", function(v) merge_cursives = v end) -directives.register("otf.merge.marks", function(v) merge_marks = v end) + for i=1,nofsteps do + local step = steps[i] + if step.format == "pair" then + local coverage = step.coverage + for g1, d1 in next, coverage do + for g2, d2 in next, d1 do + if d2[2] then + --- true or { a, b, c, d } + -- else + -- local v = d2[1] + -- if v == true then + -- d1[g2] = nil + -- stripped = stripped + 1 + -- elseif v and (v[1] == 0 and v[2] == 0 and v[4] == 0) then -- vkrn can have v[3] ~= 0 + -- d1[g2] = nil + -- stripped = stripped + 1 + -- end + -- end + elseif d2[1] == true then + d1[g2] = nil + stripped = stripped + 1 + end + end + end + end + end + return stripped +end function readers.compact(data) if not data or data.compacted then @@ -2648,6 +2687,7 @@ function readers.compact(data) data.compacted = true end local resources = data.resources + local stripped = 0 local merged = 0 local kerned = 0 local allsteps = 0 @@ -2678,6 +2718,7 @@ function readers.compact(data) merged = merged + mergesteps_4(lookup) end elseif kind == "gpos_single" then + -- maybe also strip zeros here if merge_singles then merged = merged + mergesteps_1(lookup,true) end @@ -2685,6 +2726,9 @@ function readers.compact(data) kerned = kerned + checkkerns(lookup) end elseif kind == "gpos_pair" then + if strip_pairs then + stripped = stripped + strippairs(lookup) -- noto cjk from 24M -> 8 M + end if merge_pairs then merged = merged + mergesteps_2(lookup) end @@ -2726,6 +2770,9 @@ function readers.compact(data) compact("sequences") compact("sublookups") if trace_optimizations then + if stripped > 0 then + report_optimizations("%i zero positions stripped before merging",stripped) + end if merged > 0 then report_optimizations("%i steps of %i removed due to merging",merged,allsteps) end diff --git a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-shp.lua b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-shp.lua index 78e8597b937..ecf0c941802 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-shp.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-shp.lua @@ -17,7 +17,7 @@ local pfb = fonts.handlers.pfb local hashes = fonts.hashes local identifiers = hashes.identifiers -local version = 0.009 +local version = 0.010 local shapescache = containers.define("fonts", "shapes", version, true) local streamscache = containers.define("fonts", "streams", version, true) diff --git a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-fonts-gbn.lua b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-fonts-gbn.lua index 53be41c7ed4..d690ee567d4 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-fonts-gbn.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-fonts-gbn.lua @@ -17,27 +17,27 @@ local next = next local fonts = fonts local nodes = nodes -local nuts = nodes.nuts -- context abstraction of direct nodes +local nuts = nodes.nuts -- context abstraction of direct nodes -local traverse_id = nuts.traverse_id -local flush_node = nuts.flush_node +local traverseid = nuts.traverseid +local flushnode = nuts.flushnode -local glyph_code = nodes.nodecodes.glyph -local disc_code = nodes.nodecodes.disc +local glyph_code = nodes.nodecodes.glyph +local disc_code = nodes.nodecodes.disc -local tonode = nuts.tonode -local tonut = nuts.tonut +local tonode = nuts.tonode +local tonut = nuts.tonut -local getfont = nuts.getfont -local getchar = nuts.getchar -local getid = nuts.getid -local getboth = nuts.getboth -local getprev = nuts.getprev -local getnext = nuts.getnext -local getdisc = nuts.getdisc -local setchar = nuts.setchar -local setlink = nuts.setlink -local setprev = nuts.setprev +local getfont = nuts.getfont +local getchar = nuts.getchar +local getid = nuts.getid +local getboth = nuts.getboth +local getprev = nuts.getprev +local getnext = nuts.getnext +local getdisc = nuts.getdisc +local setchar = nuts.setchar +local setlink = nuts.setlink +local setprev = nuts.setprev -- from now on we apply ligaturing and kerning here because it might interfere with complex -- opentype discretionary handling where the base ligature pass expect some weird extra @@ -99,7 +99,7 @@ local function nodepass(head,groupcode,size,packtype,direction) local variants = nil local redundant = nil local nofused = 0 - for n in traverse_id(glyph_code,head) do + for n in traverseid(glyph_code,head) do local font = getfont(n) if font ~= prevfont then if basefont then @@ -178,13 +178,13 @@ local function nodepass(head,groupcode,size,packtype,direction) end end end - flush_node(r) + flushnode(r) end end - for d in traverse_id(disc_code,head) do + for d in traverseid(disc_code,head) do local _, _, r = getdisc(d) if r then - for n in traverse_id(glyph_code,r) do + for n in traverseid(glyph_code,r) do local font = getfont(n) if font ~= prevfont then prevfont = font @@ -254,7 +254,7 @@ local function basepass(head) return head end -local protectpass = node.direct.protect_glyphs +local protectpass = node.direct.protectglyphs or node.direct.protect_glyphs local injectpass = nodes.injections.handler -- This is the only official public interface and this one can be hooked into a callback (chain) and diff --git a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-l-lpeg.lua b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-l-lpeg.lua index b0868ba4886..50306e4ab69 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-l-lpeg.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-l-lpeg.lua @@ -507,7 +507,7 @@ end -- todo: cache when string -function lpeg.replacer(one,two,makefunction,isutf) -- in principle we should sort the keys +function lpeg.replacer(one,two,makefunction,isutf) -- in principle we should sort the keys but we have a better one anyway local pattern local u = isutf and utf8char or 1 if type(one) == "table" then diff --git a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-reference.lua b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-reference.lua index dde25ac75d1..59cbd9ef8ca 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-reference.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/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 : 2021-01-07 16:56 +-- merge date : 2021-05-20 15:57 do -- begin closure to overcome local limits and interference @@ -3158,25 +3158,59 @@ local function points(n) n=n*ptf if n%1==0 then return format("%ipt",n) + else + return lpegmatch(stripzeros,format("%.5fpt",n)) + end +end +local function nupoints(n) + if n==0 then + return "0" + end + n=tonumber(n) + if not n or n==0 then + return "0" + end + n=n*ptf + if n%1==0 then + return format("%i",n) + else + return format("%.5f",n) end - return lpegmatch(stripzeros,format("%.5fpt",n)) end local function basepoints(n) if n==0 then - return "0pt" + return "0bp" end n=tonumber(n) if not n or n==0 then - return "0pt" + return "0bp" end n=n*bpf if n%1==0 then return format("%ibp",n) + else + return lpegmatch(stripzeros,format("%.5fbp",n)) + end +end +local function nubasepoints(n) + if n==0 then + return "0" + end + n=tonumber(n) + if not n or n==0 then + return "0" + end + n=n*bpf + if n%1==0 then + return format("%i",n) + else + return format("%.5f",n) end - return lpegmatch(stripzeros,format("%.5fbp",n)) end number.points=points +number.nupoints=nupoints number.basepoints=basepoints +number.nubasepoints=nubasepoints local rubish=spaceortab^0*newline local anyrubish=spaceortab+newline local stripped=(spaceortab^1/"")*newline @@ -3454,7 +3488,9 @@ local environment={ concat=table.concat, signed=number.signed, points=number.points, + nupoints=number.nupoints, basepoints=number.basepoints, + nubasepoints=number.nubasepoints, utfchar=utf.char, utfbyte=utf.byte, lpegmatch=lpeg.match, @@ -3649,10 +3685,18 @@ local format_p=function() n=n+1 return format("points(a%s)",n) end +local format_P=function() + n=n+1 + return format("nupoints(a%s)",n) +end local format_b=function() n=n+1 return format("basepoints(a%s)",n) end +local format_B=function() + n=n+1 + return format("nubasepoints(a%s)",n) +end local format_t=function(f) n=n+1 if f and f~="" then @@ -3805,7 +3849,7 @@ local builder=Cs { "start", +V("n") +V("N") +V("k") -+V("r")+V("h")+V("H")+V("u")+V("U")+V("p")+V("b")+V("t")+V("T")+V("l")+V("L")+V("I")+V("w") ++V("r")+V("h")+V("H")+V("u")+V("U")+V("p")+V("P")+V("b")+V("B")+V("t")+V("T")+V("l")+V("L")+V("I")+V("w") +V("W") +V("a") +V("A") @@ -3843,7 +3887,9 @@ local builder=Cs { "start", ["u"]=(prefix_any*P("u"))/format_u, ["U"]=(prefix_any*P("U"))/format_U, ["p"]=(prefix_any*P("p"))/format_p, + ["P"]=(prefix_any*P("P"))/format_P, ["b"]=(prefix_any*P("b"))/format_b, + ["B"]=(prefix_any*P("B"))/format_B, ["t"]=(prefix_tab*P("t"))/format_t, ["T"]=(prefix_tab*P("T"))/format_T, ["l"]=(prefix_any*P("l"))/format_l, @@ -4915,8 +4961,8 @@ nodes.nodecodes=nodecodes nodes.glyphcodes=glyphcodes nodes.disccodes=disccodes nodes.dirvalues={ lefttoright=0,righttoleft=1 } -nodes.handlers.protectglyphs=node.protect_glyphs -nodes.handlers.unprotectglyphs=node.unprotect_glyphs +nodes.handlers.protectglyphs=node.protectglyphs or node.protect_glyphs +nodes.handlers.unprotectglyphs=node.unprotectglyphs or node.unprotect_glyphs local direct=node.direct local nuts={} nodes.nuts=nuts @@ -4960,31 +5006,33 @@ nuts.setprev=direct.setprev nuts.setsplit=direct.setsplit nuts.setsubtype=direct.setsubtype nuts.setwidth=direct.setwidth -nuts.getglyphdata=nuts.getattr -nuts.setglyphdata=nuts.setattr -nuts.ischar=direct.is_char -nuts.isglyph=direct.is_glyph +nuts.getglyphdata=nuts.getattribute or nuts.getattr +nuts.setglyphdata=nuts.setattribute or nuts.setattr +nuts.ischar=direct.ischar or direct.is_char +nuts.isglyph=direct.isglyph or direct.is_glyph nuts.copy=direct.copy -nuts.copy_list=direct.copy_list -nuts.copy_node=direct.copy -nuts.end_of_math=direct.end_of_math +nuts.copynode=direct.copy +nuts.copylist=direct.copylist or direct.copy_list +nuts.endofmath=direct.endofmath or direct.end_of_math nuts.flush=direct.flush -nuts.flush_list=direct.flush_list -nuts.flush_node=direct.flush_node +nuts.flushlist=direct.flushlist or direct.flush_list +nuts.flushnode=direct.flushnode or direct.flush_node nuts.free=direct.free -nuts.insert_after=direct.insert_after -nuts.insert_before=direct.insert_before -nuts.is_node=direct.is_node +nuts.insertafter=direct.insertafter or direct.insert_after +nuts.insertbefore=direct.insertbefore or direct.insert_before +nuts.isnode=direct.isnode or direct.is_node +nuts.isdirect=direct.isdirect or direct.is_direct +nuts.isnut=direct.isdirect or direct.is_direct nuts.kerning=direct.kerning nuts.ligaturing=direct.ligaturing nuts.new=direct.new nuts.remove=direct.remove nuts.tail=direct.tail nuts.traverse=direct.traverse -nuts.traverse_char=direct.traverse_char -nuts.traverse_glyph=direct.traverse_glyph -nuts.traverse_id=direct.traverse_id -local propertydata=direct.get_properties_table() +nuts.traversechar=direct.traversechar or direct.traverse_char +nuts.traverseglyph=direct.traverseglyph or direct.traverse_glyph +nuts.traverseid=direct.traverseid or direct.traverse_id +local propertydata=(direct.getpropertiestable or direct.get_properties_table)() nodes.properties={ data=propertydata } if direct.set_properties_mode then direct.set_properties_mode(true,true) @@ -5017,10 +5065,10 @@ local setfield=nuts.setfield local getsubtype=nuts.getsubtype local isglyph=nuts.isglyph local find_tail=nuts.tail -local flush_list=nuts.flush_list -local flush_node=nuts.flush_node -local traverse_id=nuts.traverse_id -local copy_node=nuts.copy_node +local flushlist=nuts.flushlist +local flushnode=nuts.flushnode +local traverseid=nuts.traverseid +local copynode=nuts.copynode local glyph_code=nodes.nodecodes.glyph local ligature_code=nodes.glyphcodes.ligature do @@ -5033,31 +5081,31 @@ do end end do - local get_components=node.direct.getcomponents - local set_components=node.direct.setcomponents - local function copy_no_components(g,copyinjection) - local components=get_components(g) + local getcomponents=node.direct.getcomponents + local setcomponents=node.direct.setcomponents + local function copynocomponents(g,copyinjection) + local components=getcomponents(g) if components then - set_components(g) - local n=copy_node(g) + setcomponents(g) + local n=copynode(g) if copyinjection then copyinjection(n,g) end - set_components(g,components) + setcomponents(g,components) return n else - local n=copy_node(g) + local n=copynode(g) if copyinjection then copyinjection(n,g) end return n end end - local function copy_only_glyphs(current) + local function copyonlyglyphs(current) local head=nil local previous=nil - for n in traverse_id(glyph_code,current) do - n=copy_node(n) + for n in traverseid(glyph_code,current) do + n=copynode(n) if head then setlink(previous,n) else @@ -5067,14 +5115,14 @@ do end return head end - local function count_components(start,marks) + local function countcomponents(start,marks) local char=isglyph(start) if char then if getsubtype(start)==ligature_code then local n=0 - local components=get_components(start) + local components=getcomponents(start) while components do - n=n+count_components(components,marks) + n=n+countcomponents(components,marks) components=getnext(components) end return n @@ -5084,24 +5132,26 @@ do end return 0 end - local function flush_components() + local function flushcomponents() end - nuts.set_components=set_components - nuts.get_components=get_components - nuts.copy_only_glyphs=copy_only_glyphs - nuts.copy_no_components=copy_no_components - nuts.count_components=count_components - nuts.flush_components=flush_components + nuts.components={ + set=setcomponents, + get=getcomponents, + copyonlyglyphs=copyonlyglyphs, + copynocomponents=copynocomponents, + count=countcomponents, + flush=flushcomponents, + } end -nuts.uses_font=direct.uses_font +nuts.usesfont=direct.usesfont or direct.uses_font do local dummy=tonut(node.new("glyph")) nuts.traversers={ - glyph=nuts.traverse_id(nodecodes.glyph,dummy), - glue=nuts.traverse_id(nodecodes.glue,dummy), - disc=nuts.traverse_id(nodecodes.disc,dummy), - boundary=nuts.traverse_id(nodecodes.boundary,dummy), - char=nuts.traverse_char(dummy), + glyph=nuts.traverseid(nodecodes.glyph,dummy), + glue=nuts.traverseid(nodecodes.glue,dummy), + disc=nuts.traverseid(nodecodes.disc,dummy), + boundary=nuts.traverseid(nodecodes.boundary,dummy), + char=nuts.traversechar(dummy), node=nuts.traverse(dummy), } end @@ -5118,7 +5168,7 @@ if not nuts.setreplace then end do local getsubtype=nuts.getsubtype - function nuts.start_of_par(n) + function nuts.startofpar(n) local s=getsubtype(n) return s==0 or s==2 end @@ -11752,8 +11802,6 @@ readers.post=function(f,fontdata,specification) if length>0 then glyphs[mapping].name=readstring(f,length) else - report("quit post name fetching at %a of %a: %s",i,maxnames,"overflow") - break end end end @@ -12853,7 +12901,7 @@ if not modules then modules={} end modules ['font-cff']={ } local next,type,tonumber,rawget=next,type,tonumber,rawget local byte,char,gmatch,sub=string.byte,string.char,string.gmatch,string.sub -local concat,remove,unpack=table.concat,table.remove,table.unpack +local concat,insert,remove,unpack=table.concat,table.insert,table.remove,table.unpack local floor,abs,round,ceil,min,max=math.floor,math.abs,math.round,math.ceil,math.min,math.max local P,C,R,S,C,Cs,Ct=lpeg.P,lpeg.C,lpeg.R,lpeg.S,lpeg.C,lpeg.Cs,lpeg.Ct local lpegmatch=lpeg.match @@ -14457,8 +14505,34 @@ do showstate(reverse[t] or "<action>") end if top>0 then - for i=1,top do - r=r+1;result[r]=encode[stack[i]] + if t==8 and top>48 then + local n=0 + for i=1,top do + if n==48 then + local zero=encode[0] + local res3=result[r-3] + local res2=result[r-2] + local res1=result[r-1] + local res0=result[r] + result[r-3]=zero + result[r-2]=zero + r=r+1;result[r]=chars[t] + r=r+1;result[r]=zero + r=r+1;result[r]=zero + r=r+1;result[r]=res3 + r=r+1;result[r]=res2 + r=r+1;result[r]=res1 + r=r+1;result[r]=res0 + n=1 + else + n=n+1 + end + r=r+1;result[r]=encode[stack[i]] + end + else + for i=1,top do + r=r+1;result[r]=encode[stack[i]] + end end top=0 end @@ -20784,7 +20858,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.113 +otf.version=3.116 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) @@ -21237,6 +21311,7 @@ local function read_from_otf(specification) if tfmdata then tfmdata.properties.name=specification.name tfmdata.properties.sub=specification.sub + tfmdata.properties.id=specification.id tfmdata=constructors.scale(tfmdata,specification) local allfeatures=tfmdata.shared.features or specification.features.normal constructors.applymanipulators("otf",tfmdata,allfeatures,trace_features,report_otf) @@ -21974,6 +22049,8 @@ local getoffsets=nuts.getoffsets local getboth=nuts.getboth local getdisc=nuts.getdisc local setdisc=nuts.setdisc +local getreplace=nuts.getreplace +local setreplace=nuts.setreplace local setoffsets=nuts.setoffsets local ischar=nuts.ischar local getkern=nuts.getkern @@ -21983,8 +22060,8 @@ local setwidth=nuts.setwidth local getwidth=nuts.getwidth local nextchar=nuts.traversers.char local nextglue=nuts.traversers.glue -local insert_node_before=nuts.insert_before -local insert_node_after=nuts.insert_after +local insertnodebefore=nuts.insertbefore +local insertnodeafter=nuts.insertafter local properties=nodes.properties.data local fontkern=nuts.pool and nuts.pool.fontkern local italickern=nuts.pool and nuts.pool.italickern @@ -21998,7 +22075,7 @@ end) if not fontkern then local thekern=nuts.new("kern",0) local setkern=nuts.setkern - local copy_node=nuts.copy_node + local copy_node=nuts.copy fontkern=function(k) local n=copy_node(thekern) setkern(n,k) @@ -22008,7 +22085,7 @@ end if not italickern then local thekern=nuts.new("kern",3) local setkern=nuts.setkern - local copy_node=nuts.copy_node + local copy_node=nuts.copy italickern=function(k) local n=copy_node(thekern) setkern(n,k) @@ -22469,12 +22546,12 @@ local function inject_kerns_only(head,where) if leftkern and leftkern~=0 then if prev and getid(prev)==glue_code then if useitalickerns then - head=insert_node_before(head,current,italickern(leftkern)) + head=insertnodebefore(head,current,italickern(leftkern)) else setwidth(prev,getwidth(prev)+leftkern) end else - head=insert_node_before(head,current,fontkern(leftkern)) + head=insertnodebefore(head,current,fontkern(leftkern)) end end end @@ -22528,7 +22605,7 @@ local function inject_kerns_only(head,where) if i then local leftkern=i.leftkern if leftkern and leftkern~=0 then - pre=insert_node_before(pre,n,fontkern(leftkern)) + pre=insertnodebefore(pre,n,fontkern(leftkern)) done=true end end @@ -22543,7 +22620,7 @@ local function inject_kerns_only(head,where) if i then local leftkern=i.leftkern if leftkern and leftkern~=0 then - post=insert_node_before(post,n,fontkern(leftkern)) + post=insertnodebefore(post,n,fontkern(leftkern)) done=true end end @@ -22558,7 +22635,7 @@ local function inject_kerns_only(head,where) if i then local leftkern=i.leftkern if leftkern and leftkern~=0 then - replace=insert_node_before(replace,n,fontkern(leftkern)) + replace=insertnodebefore(replace,n,fontkern(leftkern)) done=true end end @@ -22620,36 +22697,34 @@ local function inject_positions_only(head,where) rightkern=0 elseif prev and getid(prev)==glue_code then if useitalickerns then - head=insert_node_before(head,current,italickern(leftkern)) + head=insertnodebefore(head,current,italickern(leftkern)) else setwidth(prev,getwidth(prev)+leftkern) end else - head=insert_node_before(head,current,fontkern(leftkern)) + head=insertnodebefore(head,current,fontkern(leftkern)) end end if rightkern and rightkern~=0 then if next and getid(next)==glue_code then if useitalickerns then - insert_node_after(head,current,italickern(rightkern)) + insertnodeafter(head,current,italickern(rightkern)) else setwidth(next,getwidth(next)+rightkern) end else - insert_node_after(head,current,fontkern(rightkern)) + insertnodeafter(head,current,fontkern(rightkern)) end end - else + elseif next then local i=p.emptyinjections if i then local rightkern=i.rightkern - if rightkern and rightkern~=0 then - if next and getid(next)==disc_code then - if replace then - else - replace=fontkern(rightkern) - done=true - end + if rightkern and rightkern~=0 and getid(next)==disc_code then + local replace=getreplace(next) + if replace then + else + setreplace(next,fontkern(rightkern)) end end end @@ -22710,12 +22785,12 @@ local function inject_positions_only(head,where) end local leftkern=i.leftkern if leftkern and leftkern~=0 then - pre=insert_node_before(pre,n,fontkern(leftkern)) + pre=insertnodebefore(pre,n,fontkern(leftkern)) done=true end local rightkern=i.rightkern if rightkern and rightkern~=0 then - insert_node_after(pre,n,fontkern(rightkern)) + insertnodeafter(pre,n,fontkern(rightkern)) done=true end end @@ -22734,12 +22809,12 @@ local function inject_positions_only(head,where) end local leftkern=i.leftkern if leftkern and leftkern~=0 then - post=insert_node_before(post,n,fontkern(leftkern)) + post=insertnodebefore(post,n,fontkern(leftkern)) done=true end local rightkern=i.rightkern if rightkern and rightkern~=0 then - insert_node_after(post,n,fontkern(rightkern)) + insertnodeafter(post,n,fontkern(rightkern)) done=true end end @@ -22758,12 +22833,12 @@ local function inject_positions_only(head,where) end local leftkern=i.leftkern if leftkern and leftkern~=0 then - replace=insert_node_before(replace,n,fontkern(leftkern)) + replace=insertnodebefore(replace,n,fontkern(leftkern)) done=true end local rightkern=i.rightkern if rightkern and rightkern~=0 then - insert_node_after(replace,n,fontkern(rightkern)) + insertnodeafter(replace,n,fontkern(rightkern)) done=true end end @@ -22778,7 +22853,7 @@ local function inject_positions_only(head,where) if i then local rightkern=i.rightkern if rightkern and rightkern~=0 then - pre=insert_node_before(pre,pre,fontkern(rightkern)) + pre=insertnodebefore(pre,pre,fontkern(rightkern)) done=true end end @@ -22791,7 +22866,7 @@ local function inject_positions_only(head,where) if i then local rightkern=i.rightkern if rightkern and rightkern~=0 then - replace=insert_node_before(replace,replace,fontkern(rightkern)) + replace=insertnodebefore(replace,replace,fontkern(rightkern)) done=true end end @@ -22894,8 +22969,8 @@ local function inject_everything(head,where) if trace_injections then report_injections("correcting non zero width mark %C",getchar(n)) end - insert_node_before(n,n,fontkern(-wn)) - insert_node_after(n,n,fontkern(-wn)) + insertnodebefore(n,n,fontkern(-wn)) + insertnodeafter(n,n,fontkern(-wn)) end end end @@ -22987,37 +23062,35 @@ local function inject_everything(head,where) rightkern=0 elseif prev and getid(prev)==glue_code then if useitalickerns then - head=insert_node_before(head,current,italickern(leftkern)) + head=insertnodebefore(head,current,italickern(leftkern)) else setwidth(prev,getwidth(prev)+leftkern) end else - head=insert_node_before(head,current,fontkern(leftkern)) + head=insertnodebefore(head,current,fontkern(leftkern)) end end if rightkern and rightkern~=0 then if next and getid(next)==glue_code then if useitalickerns then - insert_node_after(head,current,italickern(rightkern)) + insertnodeafter(head,current,italickern(rightkern)) else setwidth(next,getwidth(next)+rightkern) end else - insert_node_after(head,current,fontkern(rightkern)) + insertnodeafter(head,current,fontkern(rightkern)) end end end - else + elseif next then local i=p.emptyinjections if i then local rightkern=i.rightkern - if rightkern and rightkern~=0 then - if next and getid(next)==disc_code then - if replace then - else - replace=fontkern(rightkern) - done=true - end + if rightkern and rightkern~=0 and getid(next)==disc_code then + local replace=getreplace(next) + if replace then + else + setreplace(next,fontkern(rightkern)) end end end @@ -23092,12 +23165,12 @@ local function inject_everything(head,where) end local leftkern=i.leftkern if leftkern and leftkern~=0 then - pre=insert_node_before(pre,n,fontkern(leftkern)) + pre=insertnodebefore(pre,n,fontkern(leftkern)) done=true end local rightkern=i.rightkern if rightkern and rightkern~=0 then - insert_node_after(pre,n,fontkern(rightkern)) + insertnodeafter(pre,n,fontkern(rightkern)) done=true end if hasmarks then @@ -23122,12 +23195,12 @@ local function inject_everything(head,where) end local leftkern=i.leftkern if leftkern and leftkern~=0 then - post=insert_node_before(post,n,fontkern(leftkern)) + post=insertnodebefore(post,n,fontkern(leftkern)) done=true end local rightkern=i.rightkern if rightkern and rightkern~=0 then - insert_node_after(post,n,fontkern(rightkern)) + insertnodeafter(post,n,fontkern(rightkern)) done=true end if hasmarks then @@ -23152,12 +23225,12 @@ local function inject_everything(head,where) end local leftkern=i.leftkern if leftkern and leftkern~=0 then - replace=insert_node_before(replace,n,fontkern(leftkern)) + replace=insertnodebefore(replace,n,fontkern(leftkern)) done=true end local rightkern=i.rightkern if rightkern and rightkern~=0 then - insert_node_after(replace,n,fontkern(rightkern)) + insertnodeafter(replace,n,fontkern(rightkern)) done=true end if hasmarks then @@ -23178,7 +23251,7 @@ local function inject_everything(head,where) if i then local rightkern=i.rightkern if rightkern and rightkern~=0 then - pre=insert_node_before(pre,pre,fontkern(rightkern)) + pre=insertnodebefore(pre,pre,fontkern(rightkern)) done=true end end @@ -23191,7 +23264,7 @@ local function inject_everything(head,where) if i then local rightkern=i.rightkern if rightkern and rightkern~=0 then - replace=insert_node_before(replace,replace,fontkern(rightkern)) + replace=insertnodebefore(replace,replace,fontkern(rightkern)) done=true end end @@ -23337,8 +23410,8 @@ local function injectspaces(head) if trace_spaces then report_spaces("%C [%p + %p + %p] %C",prevchar,lnew,old,rnew,nextchar) end - head=insert_node_before(head,n,italickern(lnew)) - insert_node_after(head,n,italickern(rnew)) + head=insertnodebefore(head,n,italickern(lnew)) + insertnodeafter(head,n,italickern(rnew)) else local new=old+(leftkern+rightkern)*factor if trace_spaces then @@ -23353,7 +23426,7 @@ local function injectspaces(head) if trace_spaces then report_spaces("%C [%p + %p]",prevchar,old,new) end - insert_node_after(head,n,italickern(new)) + insertnodeafter(head,n,italickern(new)) else local new=old+leftkern*factor if trace_spaces then @@ -23372,7 +23445,7 @@ local function injectspaces(head) if trace_spaces then report_spaces("[%p + %p] %C",old,new,nextchar) end - insert_node_after(head,n,italickern(new)) + insertnodeafter(head,n,italickern(new)) else local new=old+rightkern*factor if trace_spaces then @@ -25658,6 +25731,28 @@ local function checkkerns(lookup) end return kerned end +local strip_pairs=true +local compact_pairs=true +local compact_singles=true +local merge_pairs=true +local merge_singles=true +local merge_substitutions=true +local merge_alternates=true +local merge_multiples=true +local merge_ligatures=true +local merge_cursives=true +local merge_marks=true +directives.register("otf.strip.pairs",function(v) strip_pairs=v end) +directives.register("otf.compact.pairs",function(v) compact_pairs=v end) +directives.register("otf.compact.singles",function(v) compact_singles=v end) +directives.register("otf.merge.pairs",function(v) merge_pairs=v end) +directives.register("otf.merge.singles",function(v) merge_singles=v end) +directives.register("otf.merge.substitutions",function(v) merge_substitutions=v end) +directives.register("otf.merge.alternates",function(v) merge_alternates=v end) +directives.register("otf.merge.multiples",function(v) merge_multiples=v end) +directives.register("otf.merge.ligatures",function(v) merge_ligatures=v end) +directives.register("otf.merge.cursives",function(v) merge_cursives=v end) +directives.register("otf.merge.marks",function(v) merge_marks=v end) local function checkpairs(lookup) local steps=lookup.steps local nofsteps=lookup.nofsteps @@ -25705,26 +25800,27 @@ local function checkpairs(lookup) end return kerned end -local compact_pairs=true -local compact_singles=true -local merge_pairs=true -local merge_singles=true -local merge_substitutions=true -local merge_alternates=true -local merge_multiples=true -local merge_ligatures=true -local merge_cursives=true -local merge_marks=true -directives.register("otf.compact.pairs",function(v) compact_pairs=v end) -directives.register("otf.compact.singles",function(v) compact_singles=v end) -directives.register("otf.merge.pairs",function(v) merge_pairs=v end) -directives.register("otf.merge.singles",function(v) merge_singles=v end) -directives.register("otf.merge.substitutions",function(v) merge_substitutions=v end) -directives.register("otf.merge.alternates",function(v) merge_alternates=v end) -directives.register("otf.merge.multiples",function(v) merge_multiples=v end) -directives.register("otf.merge.ligatures",function(v) merge_ligatures=v end) -directives.register("otf.merge.cursives",function(v) merge_cursives=v end) -directives.register("otf.merge.marks",function(v) merge_marks=v end) +local function strippairs(lookup) + local steps=lookup.steps + local nofsteps=lookup.nofsteps + local stripped=0 + for i=1,nofsteps do + local step=steps[i] + if step.format=="pair" then + local coverage=step.coverage + for g1,d1 in next,coverage do + for g2,d2 in next,d1 do + if d2[2] then + elseif d2[1]==true then + d1[g2]=nil + stripped=stripped+1 + end + end + end + end + end + return stripped +end function readers.compact(data) if not data or data.compacted then return @@ -25732,6 +25828,7 @@ function readers.compact(data) data.compacted=true end local resources=data.resources + local stripped=0 local merged=0 local kerned=0 local allsteps=0 @@ -25769,6 +25866,9 @@ function readers.compact(data) kerned=kerned+checkkerns(lookup) end elseif kind=="gpos_pair" then + if strip_pairs then + stripped=stripped+strippairs(lookup) + end if merge_pairs then merged=merged+mergesteps_2(lookup) end @@ -25809,6 +25909,9 @@ function readers.compact(data) compact("sequences") compact("sublookups") if trace_optimizations then + if stripped>0 then + report_optimizations("%i zero positions stripped before merging",stripped) + end if merged>0 then report_optimizations("%i steps of %i removed due to merging",merged,allsteps) end @@ -26087,7 +26190,7 @@ local setprop=nuts.setprop local getsubtype=nuts.getsubtype local getchar=nuts.getchar local ischar=nuts.ischar -local end_of_math=nuts.end_of_math +local endofmath=nuts.endofmath local nodecodes=nodes.nodecodes local disc_code=nodecodes.disc local math_code=nodecodes.math @@ -26193,7 +26296,7 @@ function analyzers.setstate(head,font) end first,last,n=nil,nil,0 if id==math_code then - current=end_of_math(current) + current=endofmath(current) end elseif id==disc_code then setstate(current,s_medi) @@ -26206,7 +26309,7 @@ function analyzers.setstate(head,font) end first,last,n=nil,nil,0 if id==math_code then - current=end_of_math(current) + current=endofmath(current) end end current=getnext(current) @@ -26422,7 +26525,7 @@ function methods.arab(head,font,attr) first=nil end if id==math_code then - current=end_of_math(current) + current=endofmath(current) end end current=getnext(current) @@ -26536,7 +26639,7 @@ do wrapup() end if id==math_code then - current=end_of_math(current) + current=endofmath(current) end end current=getnext(current) @@ -26632,23 +26735,24 @@ local setlink=nuts.setlink local getwidth=nuts.getwidth local getattr=nuts.getattr local getglyphdata=nuts.getglyphdata -local copy_no_components=nuts.copy_no_components -local copy_only_glyphs=nuts.copy_only_glyphs -local count_components=nuts.count_components -local set_components=nuts.set_components -local get_components=nuts.get_components -local flush_components=nuts.flush_components +local components=nuts.components +local copynocomponents=components.copynocomponents +local copyonlyglyphs=components.copyonlyglyphs +local countcomponents=components.count +local setcomponents=components.set +local getcomponents=components.get +local flushcomponents=components.flush local ischar=nuts.ischar -local usesfont=nuts.uses_font -local insert_node_after=nuts.insert_after +local usesfont=nuts.usesfont +local insertnodeafter=nuts.insertafter local copy_node=nuts.copy -local copy_node_list=nuts.copy_list +local copy_node_list=nuts.copylist local remove_node=nuts.remove local find_node_tail=nuts.tail -local flush_node_list=nuts.flush_list -local flush_node=nuts.flush_node -local end_of_math=nuts.end_of_math -local start_of_par=nuts.start_of_par +local flushnodelist=nuts.flushlist +local flushnode=nuts.flushnode +local endofmath=nuts.endofmath +local startofpar=nuts.startofpar local setmetatable=setmetatable local setmetatableindex=table.setmetatableindex local nextnode=nuts.traversers.node @@ -26779,12 +26883,12 @@ local function flattendisk(head,disc) local prev,next=getboth(disc) local ishead=head==disc setdisc(disc) - flush_node(disc) + flushnode(disc) if pre then - flush_node_list(pre) + flushnodelist(pre) end if post then - flush_node_list(post) + flushnodelist(post) end if ishead then if replace then @@ -26833,16 +26937,16 @@ local function markstoligature(head,start,stop,char) local next=getnext(stop) setprev(start) setnext(stop) - local base=copy_no_components(start,copyinjection) + local base=copynocomponents(start,copyinjection) if head==start then head=base end resetinjection(base) setchar(base,char) setsubtype(base,ligatureglyph_code) - set_components(base,start) + setcomponents(base,start) setlink(prev,base,next) - flush_components(start) + flushcomponents(start) return head,base end end @@ -26850,7 +26954,7 @@ local no_left_ligature_code=1 local no_right_ligature_code=2 local no_left_kern_code=4 local no_right_kern_code=8 -local has_glyph_option=node.direct.has_glyph_option or function(n,c) +local hasglyphoption=function(n,c) if c==no_left_ligature_code or c==no_right_ligature_code then return getattr(n,a_noligature)==1 else @@ -26858,7 +26962,7 @@ local has_glyph_option=node.direct.has_glyph_option or function(n,c) end end local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfound,hasmarks) - if has_glyph_option(start,no_right_ligature_code) then + if hasglyphoption(start,no_right_ligature_code) then return head,start end if start==stop and getchar(start)==char then @@ -26871,14 +26975,14 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou local comp=start setprev(start) setnext(stop) - local base=copy_no_components(start,copyinjection) + local base=copynocomponents(start,copyinjection) if start==head then head=base end resetinjection(base) setchar(base,char) setsubtype(base,ligatureglyph_code) - set_components(base,comp) + setcomponents(base,comp) setlink(prev,base,next) if not discfound then local deletemarks=not skiphash or hasmarks @@ -26891,7 +26995,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou local char=getchar(start) if not marks[char] then baseindex=baseindex+componentindex - componentindex=count_components(start,marks) + componentindex=countcomponents(start,marks) elseif not deletemarks then setligaindex(start,baseindex+getligaindex(start,componentindex)) if trace_marks then @@ -26899,7 +27003,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou end local n=copy_node(start) copyinjection(n,start) - head,current=insert_node_after(head,current,n) + head,current=insertnodeafter(head,current,n) elseif trace_marks then logwarning("%s: delete ligature mark %s",pref(dataset,sequence),gref(char)) end @@ -26922,14 +27026,14 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou break end end - flush_components(components) + flushcomponents(components) else local discprev,discnext=getboth(discfound) if discprev and discnext then local pre,post,replace,pretail,posttail,replacetail=getdisc(discfound,true) if not replace then local prev=getprev(base) - local copied=copy_only_glyphs(comp) + local copied=copyonlyglyphs(comp) if pre then setlink(discprev,pre) else @@ -26945,7 +27049,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou end setlink(prev,discfound,next) setboth(base) - set_components(base,copied) + setcomponents(base,copied) replace=base if forcediscretionaries then setdisc(discfound,pre,post,replace,discretionarydisc_code) @@ -26969,7 +27073,7 @@ local function multiple_glyphs(head,start,multiple,skiphash,what,stop) local n=copy_node(start) resetinjection(n) setchar(n,multiple[k]) - insert_node_after(head,start,n) + insertnodeafter(head,start,n) start=n end if what==true then @@ -26979,7 +27083,7 @@ local function multiple_glyphs(head,start,multiple,skiphash,what,stop) local n=copy_node(start) resetinjection(n) setchar(n,m) - insert_node_after(head,start,n) + insertnodeafter(head,start,n) start=n end end @@ -27209,7 +27313,7 @@ function handlers.gsub_ligature(head,start,dataset,sequence,ligature,rlmode,skip return head,start,false,false end function handlers.gpos_single(head,start,dataset,sequence,kerns,rlmode,skiphash,step,injection) - if has_glyph_option(start,no_right_kern_code) then + if hasglyphoption(start,no_right_kern_code) then return head,start,false else local startchar=getchar(start) @@ -27229,7 +27333,7 @@ function handlers.gpos_single(head,start,dataset,sequence,kerns,rlmode,skiphash, end end function handlers.gpos_pair(head,start,dataset,sequence,kerns,rlmode,skiphash,step,injection) - if has_glyph_option(start,no_right_kern_code) then + if hasglyphoption(start,no_right_kern_code) then return head,start,false else local snext=getnext(start) @@ -27718,7 +27822,7 @@ function chainprocs.gsub_ligature(head,start,stop,dataset,sequence,currentlookup return head,start,false,0,false end function chainprocs.gpos_single(head,start,stop,dataset,sequence,currentlookup,rlmode,skiphash,chainindex) - if not has_glyph_option(start,no_right_kern_code) then + if not hasglyphoption(start,no_right_kern_code) then local mapping=currentlookup.mapping if mapping==nil then mapping=getmapping(dataset,sequence,currentlookup) @@ -27746,7 +27850,7 @@ function chainprocs.gpos_single(head,start,stop,dataset,sequence,currentlookup,r return head,start,false end function chainprocs.gpos_pair(head,start,stop,dataset,sequence,currentlookup,rlmode,skiphash,chainindex) - if not has_glyph_option(start,no_right_kern_code) then + if not hasglyphoption(start,no_right_kern_code) then local mapping=currentlookup.mapping if mapping==nil then mapping=getmapping(dataset,sequence,currentlookup) @@ -28069,13 +28173,13 @@ local function checked(head) if next then setlink(kern,next) end - flush_node(current) + flushnode(current) head=kern current=next else local prev,next=getboth(current) setlink(prev,kern,next) - flush_node(current) + flushnode(current) current=next end else @@ -28525,105 +28629,225 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s goto next end local s=seq.n - local l=ck[5] - local current=start - local last=start if s==1 then - goto next - end - if l>f then - local discfound - local n=f+1 - last=startnext - while n<=l do - if postreplace and not last then - last=getnext(sweepnode) - sweeptype=nil - end - if last then - local char,id=ischar(last,currentfont) - if char then - if 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 + else + local l=ck[5] + local current=start + local last=start + if l>f then + local discfound + local n=f+1 + last=startnext + while n<=l do + if postreplace and not last then + last=getnext(sweepnode) + sweeptype=nil + end + if last then + local char,id=ischar(last,currentfont) + if char then + if skiphash and skiphash[char] then + skipped=true + if trace_skips then + show_skip(dataset,sequence,char,ck,classes[char]) + end last=getnext(last) - end - n=n+1 - elseif discfound then - notmatchreplace[discfound]=true - if notmatchpre[discfound] then - goto next + 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 + goto next + else + break + end else - break - end - else - goto next - end - elseif char==false then - if discfound then - notmatchreplace[discfound]=true - if notmatchpre[discfound] then goto next + end + elseif char==false then + if discfound then + notmatchreplace[discfound]=true + if notmatchpre[discfound] then + goto next + else + break + end else - break + goto next end - else - goto next - end - elseif id==disc_code then - discseen=true - discfound=last - notmatchpre[last]=nil - notmatchpost[last]=true - notmatchreplace[last]=nil - local pre,post,replace=getdisc(last) - if pre then - local n=n - while pre do - if seq[n][getchar(pre)] then - n=n+1 - if n>l then + elseif id==disc_code then + discseen=true + discfound=last + notmatchpre[last]=nil + notmatchpost[last]=true + notmatchreplace[last]=nil + local pre,post,replace=getdisc(last) + if pre then + local n=n + while pre do + if seq[n][getchar(pre)] then + n=n+1 + if n>l then + break + end + pre=getnext(pre) + else + notmatchpre[last]=true break end - pre=getnext(pre) - else + end + if n<=l then notmatchpre[last]=true - break end - end - if n<=l then + else notmatchpre[last]=true end + if replace then + while replace do + if seq[n][getchar(replace)] then + n=n+1 + if n>l then + break + end + replace=getnext(replace) + else + notmatchreplace[last]=true + if notmatchpre[last] then + goto next + else + break + end + end + end + if notmatchpre[last] then + goto next + end + end + last=getnext(last) else - notmatchpre[last]=true + goto next end - if replace then - while replace do - if seq[n][getchar(replace)] then - n=n+1 - if n>l then - break + else + goto next + end + end + end + if f>1 then + if startprev then + local prev=startprev + if prereplace and prev==checkdisc then + prev=getprev(sweepnode) + end + if prev then + local discfound + local n=f-1 + while n>=1 do + if prev then + local char,id=ischar(prev,currentfont) + if char then + if 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 + goto next + else + break + end + else + goto next end - replace=getnext(replace) - else - notmatchreplace[last]=true - if notmatchpre[last] then + elseif char==false then + if discfound then + notmatchreplace[discfound]=true + if notmatchpost[discfound] then + goto next + end + else goto next + end + break + elseif id==disc_code then + discseen=true + discfound=prev + notmatchpre[prev]=true + notmatchpost[prev]=nil + notmatchreplace[prev]=nil + local pre,post,replace,pretail,posttail,replacetail=getdisc(prev,true) + if pre~=start and post~=start and replace~=start then + if post then + local n=n + while posttail do + if seq[n][getchar(posttail)] then + n=n-1 + if posttail==post or n<1 then + break + else + posttail=getprev(posttail) + end + else + notmatchpost[prev]=true + break + end + end + if n>=1 then + notmatchpost[prev]=true + end + else + notmatchpost[prev]=true + end + if replace then + while replacetail do + if seq[n][getchar(replacetail)] then + n=n-1 + if replacetail==replace or n<1 then + break + else + replacetail=getprev(replacetail) + end + else + notmatchreplace[prev]=true + if notmatchpost[prev] then + goto next + else + break + end + end + end + else + end + end + prev=getprev(prev) + elseif id==glue_code then + local sn=seq[n] + if (sn[32] and spaces[prev]) or sn[0xFFFC] then + n=n-1 + prev=getprev(prev) else - break + goto next end + elseif seq[n][0xFFFC] then + n=n-1 + prev=getprev(prev) + else + goto next end - end - if notmatchpre[last] then + else goto next end end - last=getnext(last) else goto next end @@ -28631,34 +28855,32 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s goto next end end - end - if f>1 then - if startprev then - local prev=startprev - if prereplace and prev==checkdisc then - prev=getprev(sweepnode) + if s>l then + local current=last and getnext(last) + if not current and postreplace then + current=getnext(sweepnode) end - if prev then + if current then local discfound - local n=f-1 - while n>=1 do - if prev then - local char,id=ischar(prev,currentfont) + local n=l+1 + while n<=s do + if current then + local char,id=ischar(current,currentfont) if char then if skiphash and skiphash[char] then skipped=true if trace_skips then show_skip(dataset,sequence,char,ck,classes[char]) end - prev=getprev(prev) + current=getnext(current) elseif seq[n][char] then - if n>1 then - prev=getprev(prev) + if n<s then + current=getnext(current) end - n=n-1 + n=n+1 elseif discfound then notmatchreplace[discfound]=true - if notmatchpost[discfound] then + if notmatchpre[discfound] then goto next else break @@ -28669,202 +28891,84 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s elseif char==false then if discfound then notmatchreplace[discfound]=true - if notmatchpost[discfound] then + if notmatchpre[discfound] then goto next + else + break end else goto next end - break elseif id==disc_code then discseen=true - discfound=prev - notmatchpre[prev]=true - notmatchpost[prev]=nil - notmatchreplace[prev]=nil - local pre,post,replace,pretail,posttail,replacetail=getdisc(prev,true) - if pre~=start and post~=start and replace~=start then - if post then - local n=n - while posttail do - if seq[n][getchar(posttail)] then - n=n-1 - if posttail==post or n<1 then - break - else - posttail=getprev(posttail) - end - else - notmatchpost[prev]=true + discfound=current + notmatchpre[current]=nil + notmatchpost[current]=true + notmatchreplace[current]=nil + local pre,post,replace=getdisc(current) + if pre then + local n=n + while pre do + if seq[n][getchar(pre)] then + n=n+1 + if n>s then break + else + pre=getnext(pre) end + else + notmatchpre[current]=true + break end - if n>=1 then - notmatchpost[prev]=true - end - else - notmatchpost[prev]=true end - if replace then - while replacetail do - if seq[n][getchar(replacetail)] then - n=n-1 - if replacetail==replace or n<1 then - break - else - replacetail=getprev(replacetail) - end + if n<=s then + notmatchpre[current]=true + end + else + notmatchpre[current]=true + end + if replace then + while replace do + if seq[n][getchar(replace)] then + n=n+1 + if n>s then + break else - notmatchreplace[prev]=true - if notmatchpost[prev] then - goto next - else - break - end + replace=getnext(replace) + end + else + notmatchreplace[current]=true + if notmatchpre[current] then + goto next + else + break end end - else end + else end - prev=getprev(prev) + current=getnext(current) elseif id==glue_code then local sn=seq[n] - if (sn[32] and spaces[prev]) or sn[0xFFFC] then - n=n-1 - prev=getprev(prev) + if (sn[32] and spaces[current]) or sn[0xFFFC] then + n=n+1 + current=getnext(current) else goto next end elseif seq[n][0xFFFC] then - n=n-1 - prev=getprev(prev) - else - goto next - end - else - goto next - end - end - else - goto next - end - else - goto next - end - end - if s>l then - local current=last and getnext(last) - if not current and postreplace then - current=getnext(sweepnode) - end - if current then - local discfound - local n=l+1 - while n<=s do - if current then - local char,id=ischar(current,currentfont) - if char then - if 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 - elseif discfound then - notmatchreplace[discfound]=true - if notmatchpre[discfound] then - goto next - else - break - end - else - goto next - end - elseif char==false then - if discfound then - notmatchreplace[discfound]=true - if notmatchpre[discfound] then - goto next - else - break - end - else - goto next - end - elseif id==disc_code then - discseen=true - discfound=current - notmatchpre[current]=nil - notmatchpost[current]=true - notmatchreplace[current]=nil - local pre,post,replace=getdisc(current) - if pre then - local n=n - while pre do - if seq[n][getchar(pre)] then - n=n+1 - if n>s then - break - else - pre=getnext(pre) - end - else - notmatchpre[current]=true - break - end - end - if n<=s then - notmatchpre[current]=true - end - else - notmatchpre[current]=true - end - if replace then - while replace do - if seq[n][getchar(replace)] then - n=n+1 - if n>s then - break - else - replace=getnext(replace) - end - else - notmatchreplace[current]=true - if notmatchpre[current] then - goto next - else - break - end - end - end - else - end - current=getnext(current) - elseif id==glue_code then - local sn=seq[n] - if (sn[32] and spaces[current]) or sn[0xFFFC] then n=n+1 current=getnext(current) else goto next end - elseif seq[n][0xFFFC] then - n=n+1 - current=getnext(current) else goto next end - else - goto next end + else + goto next end - else - goto next end end if trace_contexts then @@ -29626,7 +29730,7 @@ do checkstep(head) end local initialrl=0 - if getid(head)==par_code and start_of_par(head) then + if getid(head)==par_code and startofpar(head) then initialrl=pardirstate(head) elseif direction==righttoleft_code then initialrl=-1 @@ -29743,7 +29847,7 @@ do start=getnext(start) end elseif id==math_code then - start=getnext(end_of_math(start)) + start=getnext(endofmath(start)) elseif id==dir_code then topstack,rlmode=txtdirstate(start,dirstack,topstack,rlparmode) start=getnext(start) @@ -29813,7 +29917,7 @@ do start=getnext(start) end elseif id==math_code then - start=getnext(end_of_math(start)) + start=getnext(endofmath(start)) elseif id==dir_code then topstack,rlmode=txtdirstate(start,dirstack,topstack,rlparmode) start=getnext(start) @@ -29891,7 +29995,7 @@ do elseif char==false or id==glue_code then start=getnext(start) elseif id==math_code then - start=getnext(end_of_math(start)) + start=getnext(endofmath(start)) elseif id==dir_code then topstack,rlmode=txtdirstate(start,dirstack,topstack,rlparmode) start=getnext(start) @@ -29902,44 +30006,52 @@ do return head end end -local plugins={} -otf.plugins=plugins -local report=logs.reporter("fonts") -function otf.registerplugin(name,f) - if type(name)=="string" and type(f)=="function" then - plugins[name]={ name,f } - report() - report("plugin %a has been loaded, please be aware of possible side effects",name) - report() - if logs.pushtarget then - logs.pushtarget("log") - end - report("Plugins are not officially supported unless stated otherwise. This is because") - report("they bypass the regular font handling and therefore some features in ConTeXt") - report("(especially those related to fonts) might not work as expected or might not work") - report("at all. Some plugins are for testing and development only and might change") - report("whenever we feel the need for it.") - report() - if logs.poptarget then - logs.poptarget() +do + local plugins={} + otf.plugins=plugins + local report=logs.reporter("fonts") + local warned=false + local okay={ text=true } + function otf.registerplugin(name,f) + if type(name)=="string" and type(f)=="function" then + plugins[name]={ name,f } + if okay[name] then + else + report("plugin %a has been loaded, please be aware of possible side effects",name) + if not warned then + if logs.pushtarget then + logs.pushtarget("log") + end + report("Plugins are not officially supported unless stated otherwise. This is because") + report("they bypass the regular font handling and therefore some features in ConTeXt") + report("(especially those related to fonts) might not work as expected or might not work") + report("at all. Some plugins are for testing and development only and might change") + report("whenever we feel the need for it.") + report() + if logs.poptarget then + logs.poptarget() + end + warned=true + end + end end end -end -function otf.plugininitializer(tfmdata,value) - if type(value)=="string" then - tfmdata.shared.plugin=plugins[value] + function otf.plugininitializer(tfmdata,value) + if type(value)=="string" then + tfmdata.shared.plugin=plugins[value] + end end -end -function otf.pluginprocessor(head,font,attr,direction) - local s=fontdata[font].shared - local p=s and s.plugin - if p then - if trace_plugins then - report_process("applying plugin %a",p[1]) + function otf.pluginprocessor(head,font,dynamic,direction) + local s=fontdata[font].shared + local p=s and s.plugin + if p then + if trace_plugins then + report_process("applying plugin %a",p[1]) + end + return p[2](head,font,dynamic,direction) + else + return head,false end - return p[2](head,font,attr,direction) - else - return head,false end end function otf.featuresinitializer(tfmdata,value) @@ -30971,11 +31083,11 @@ local setprop=nuts.setprop local getstate=nuts.getstate local setstate=nuts.setstate local ischar=nuts.ischar -local insert_node_after=nuts.insert_after +local insertnodeafter=nuts.insertafter local copy_node=nuts.copy local remove_node=nuts.remove -local flush_list=nuts.flush_list -local flush_node=nuts.flush_node +local flushlist=nuts.flushlist +local flushnode=nuts.flushnode local copyinjection=nodes.injections.copy local unsetvalue=attributes.unsetvalue local fontdata=fonts.hashes.identifiers @@ -31600,7 +31712,7 @@ local function inject_syntax_error(head,current,char) else setchar(current,dotted_circle) end - return insert_node_after(head,current,signal) + return insertnodeafter(head,current,signal) end local function initialize_one(font,attr) local tfmdata=fontdata[font] @@ -31718,7 +31830,7 @@ local function reorder_one(head,start,stop,font,attr,nbspaces) if current==stop then stop=getprev(stop) head=remove_node(head,current) - flush_node(current) + flushnode(current) return head,stop,nbspaces else nbspaces=nbspaces+1 @@ -31748,7 +31860,7 @@ local function reorder_one(head,start,stop,font,attr,nbspaces) tempcurrent=processcharacters(tempcurrent,font) setstate(tempcurrent,unsetvalue) if getchar(next)==getchar(tempcurrent) then - flush_list(tempcurrent) + flushlist(tempcurrent) if show_syntax_errors then head,current=inject_syntax_error(head,current,char) end @@ -31756,8 +31868,8 @@ local function reorder_one(head,start,stop,font,attr,nbspaces) setchar(current,getchar(tempcurrent)) local freenode=getnext(current) setlink(current,tmp) - flush_node(freenode) - flush_list(tempcurrent) + flushnode(freenode) + flushlist(tempcurrent) if changestop then stop=current end @@ -31884,7 +31996,7 @@ local function reorder_one(head,start,stop,font,attr,nbspaces) ch=tpm[1] setchar(n,ch) setchar(extra,tpm[2]) - head=insert_node_after(head,current,extra) + head=insertnodeafter(head,current,extra) tpm=twopart_mark[ch] end while c~=stop and dependent_vowel[ch] do @@ -32058,7 +32170,7 @@ local function reorder_one(head,start,stop,font,attr,nbspaces) stop=getprev(stop) end head=remove_node(head,base) - flush_node(base) + flushnode(base) end return head,stop,nbspaces end @@ -32318,7 +32430,7 @@ function handlers.devanagari_remove_joiners(head,start,kind,lookupname,replaceme if head==start then head=stop end - flush_list(start) + flushlist(start) return head,stop,true end local function initialize_two(font,attr) @@ -32463,7 +32575,7 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) if current==stop then stop=getprev(stop) head=remove_node(head,current) - flush_node(current) + flushnode(current) return head,stop,nbspaces else nbspaces=nbspaces+1 @@ -32560,7 +32672,7 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) char=tpm[1] setchar(current,char) setchar(extra,tpm[2]) - head=insert_node_after(head,current,extra) + head=insertnodeafter(head,current,extra) tpm=twopart_mark[char] end if not moved[current] and dependent_vowel[char] then @@ -32710,7 +32822,7 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) end nbspaces=nbspaces-1 head=remove_node(head,base) - flush_node(base) + flushnode(base) end return head,stop,nbspaces end @@ -33644,9 +33756,10 @@ end if inkscape then local descriptions=tfmdata.descriptions local nofshapes=#svgshapes + local s_format=inkscapeformat("pdf") local f_svgfile=formatters["temp-otf-svg-shape-%i.svg"] local f_pdffile=formatters["temp-otf-svg-shape-%i.pdf"] - local f_convert=formatters["%s --export-%s=%s\n"] + local f_convert=formatters[new and "file-open:%s; export-%s:%s; export-do\n" or "%s --export-%s=%s\n"] local filterglyph=otfsvg.filterglyph local nofdone=0 local processed={} @@ -33660,7 +33773,7 @@ end local svgfile=f_svgfile(index) local pdffile=f_pdffile(index) savedata(svgfile,data) - inkscape:write(f_convert(svgfile,inkscapeformat("pdf"),pdffile)) + inkscape:write(f_convert(svgfile,s_format,pdffile)) processed[index]=true nofdone=nofdone+1 if nofdone%25==0 then @@ -34833,6 +34946,7 @@ local function read_from_afm(specification) local tfmdata=afmtotfm(specification) if tfmdata then tfmdata.properties.name=specification.name + tfmdata.properties.id=specification.id tfmdata=constructors.scale(tfmdata,specification) local allfeatures=tfmdata.shared.features or specification.features.normal constructors.applymanipulators("afm",tfmdata,allfeatures,trace_features,report_afm) @@ -36047,7 +36161,7 @@ local afm=fonts.handlers.afm local pfb=fonts.handlers.pfb local hashes=fonts.hashes local identifiers=hashes.identifiers -local version=0.009 +local version=0.010 local shapescache=containers.define("fonts","shapes",version,true) local streamscache=containers.define("fonts","streams",version,true) local compact_streams=false @@ -37132,74 +37246,55 @@ local rules={ "FractionRuleThickness", "UnderbarRuleThickness", } -local setmathparameters -local setmathcharacters -if CONTEXTLMTXMODE and CONTEXTLMTXMODE>0 then - setmathparameters=function(tfmdata,characters,mathparameters,dx,dy,squeeze,multiplier) - if delta~=0 then - for i=1,#rules do - local name=rules[i] - local value=mathparameters[name] - if value then - mathparameters[name]=(squeeze or 1)*(value+dy) - end +local function setmathparameters(tfmdata,characters,mathparameters,dx,dy,squeeze,multiplier) + if dy~=0 then + for i=1,#rules do + local name=rules[i] + local value=mathparameters[name] + if value then + mathparameters[name]=(squeeze or 1)*(value+dy) end end end - setmathcharacters=function() - end -else - setmathparameters=function(tfmdata,characters,mathparameters,dx,dy,squeeze,multiplier) - if delta~=0 then - for i=1,#rules do - local name=rules[i] - local value=mathparameters[name] - if value then - mathparameters[name]=(squeeze or 1)*(value+dy) - end - end +end +local function setmathcharacters(tfmdata,characters,mathparameters,dx,dy,squeeze,wdelta,hdelta,ddelta) + local function wdpatch(char) + if wsnap~=0 then + char.width=char.width+wdelta/2 end end - setmathcharacters=function(tfmdata,characters,mathparameters,dx,dy,squeeze,wdelta,hdelta,ddelta) - local function wdpatch(char) - if wsnap~=0 then - char.width=char.width+wdelta/2 - end - end - local function htpatch(char) - if hsnap~=0 then - local height=char.height - if height then - char.height=char.height+2*dy - end + local function htpatch(char) + if hsnap~=0 then + local height=char.height + if height then + char.height=char.height+2*dy end end - local character=characters[0x221A] - if character and character.next then - local char=character - local next=character.next + end + local character=characters[0x221A] + if character and character.next then + local char=character + local next=character.next + wdpatch(char) + htpatch(char) + while next do + char=characters[next] wdpatch(char) htpatch(char) - while next do - char=characters[next] - wdpatch(char) - htpatch(char) - next=char.next - end - if char then - local v=char.vert_variants - if v then - local top=v[#v] - if top then - local char=characters[top.glyph] - htpatch(char) - end + next=char.next + end + if char then + local v=char.vert_variants + if v then + local top=v[#v] + if top then + local char=characters[top.glyph] + htpatch(char) end end end end end -local shiftmode=CONTEXTLMTXMODE and CONTEXTLMTXMODE>0 local function manipulateeffect(tfmdata) local effect=tfmdata.properties.effect if effect then @@ -37221,45 +37316,38 @@ local function manipulateeffect(tfmdata) local factor=(1+effect.factor)*factor local hfactor=(1+effect.hfactor)*hfactor local vfactor=(1+effect.vfactor)*vfactor - if shiftmode then - parameters.hshift=hshift - parameters.vshift=vshift - else - vshift=vshift~=0 and upcommand[vshift] or false - hshift=rightcommand[hshift] - end + vshift=vshift~=0 and upcommand[vshift] or false + hshift=rightcommand[hshift] for unicode,character in next,characters do local oldwidth=character.width local oldheight=character.height local olddepth=character.depth if oldwidth and oldwidth>0 then character.width=oldwidth+wdelta - if not shiftmode then - local commands=character.commands - if vshift then - if commands then + local commands=character.commands + if vshift then + if commands then + prependcommands (commands, + hshift, + vshift + ) + else + character.commands={ + hshift, + vshift, + charcommand[unicode] + } + end + else + if commands then prependcommands (commands, - hshift, - vshift + hshift ) - else - character.commands={ - hshift, - vshift, - charcommand[unicode] - } - end else - if commands then - prependcommands (commands, - hshift - ) - else - character.commands={ - hshift, - charcommand[unicode] - } - end + character.commands={ + hshift, + charcommand[unicode] + } end end end @@ -39421,8 +39509,8 @@ local next=next local fonts=fonts local nodes=nodes local nuts=nodes.nuts -local traverse_id=nuts.traverse_id -local flush_node=nuts.flush_node +local traverseid=nuts.traverseid +local flushnode=nuts.flushnode local glyph_code=nodes.nodecodes.glyph local disc_code=nodes.nodecodes.disc local tonode=nuts.tonode @@ -39481,7 +39569,7 @@ local function nodepass(head,groupcode,size,packtype,direction) local variants=nil local redundant=nil local nofused=0 - for n in traverse_id(glyph_code,head) do + for n in traverseid(glyph_code,head) do local font=getfont(n) if font~=prevfont then if basefont then @@ -39559,13 +39647,13 @@ local function nodepass(head,groupcode,size,packtype,direction) end end end - flush_node(r) + flushnode(r) end end - for d in traverse_id(disc_code,head) do + for d in traverseid(disc_code,head) do local _,_,r=getdisc(d) if r then - for n in traverse_id(glyph_code,r) do + for n in traverseid(glyph_code,r) do local font=getfont(n) if font~=prevfont then prevfont=font @@ -39633,7 +39721,7 @@ local function basepass(head) end return head end -local protectpass=node.direct.protect_glyphs +local protectpass=node.direct.protectglyphs or node.direct.protect_glyphs local injectpass=nodes.injections.handler function nodes.handlers.nodepass(head,...) if head then diff --git a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-util-str.lua b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-util-str.lua index 2d3f4d669f1..0d1f39de9d7 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-util-str.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-util-str.lua @@ -70,27 +70,63 @@ local function points(n) n = n * ptf if n % 1 == 0 then return format("%ipt",n) + else + return lpegmatch(stripzeros,format("%.5fpt",n)) -- plural as we need to keep the pt + end +end + +local function nupoints(n) + if n == 0 then + return "0" + end + n = tonumber(n) + if not n or n == 0 then + return "0" + end + n = n * ptf + if n % 1 == 0 then + return format("%i",n) + else + return format("%.5f",n) -- no strip end - return lpegmatch(stripzeros,format("%.5fpt",n)) -- plural as we need to keep the pt end local function basepoints(n) if n == 0 then - return "0pt" + return "0bp" end n = tonumber(n) if not n or n == 0 then - return "0pt" + return "0bp" end n = n * bpf if n % 1 == 0 then return format("%ibp",n) + else + return lpegmatch(stripzeros,format("%.5fbp",n)) -- plural as we need to keep the pt + end +end + +local function nubasepoints(n) + if n == 0 then + return "0" + end + n = tonumber(n) + if not n or n == 0 then + return "0" + end + n = n * bpf + if n % 1 == 0 then + return format("%i",n) + else + return format("%.5f",n) -- no strip end - return lpegmatch(stripzeros,format("%.5fbp",n)) -- plural as we need to keep the pt end -number.points = points -number.basepoints = basepoints +number.points = points +number.nupoints = nupoints +number.basepoints = basepoints +number.nubasepoints = nubasepoints -- str = " \n \ntest \n test\ntest " -- print("["..string.gsub(string.collapsecrlf(str),"\n","+").."]") @@ -357,7 +393,9 @@ end -- U+hexadecimal %...u character number -- U+HEXADECIMAL %...U character number -- points %p number (scaled points) +-- nupoints %P number (scaled points) / without unit / always 5 decimals -- basepoints %b number (scaled points) +-- nubasepoints %B number (scaled points) / without unit / always 5 decimals -- table concat %...t table -- table concat %{.}t table -- serialize %...T sequenced (no nested tables) @@ -616,7 +654,9 @@ local environment = { concat = table.concat, signed = number.signed, points = number.points, + nupoints = number.nupoints, basepoints = number.basepoints, + nubasepoints = number.nubasepoints, utfchar = utf.char, utfbyte = utf.byte, lpegmatch = lpeg.match, @@ -879,11 +919,21 @@ local format_p = function() return format("points(a%s)",n) end +local format_P = function() + n = n + 1 + return format("nupoints(a%s)",n) +end + local format_b = function() n = n + 1 return format("basepoints(a%s)",n) end +local format_B = function() + n = n + 1 + return format("nubasepoints(a%s)",n) +end + local format_t = function(f) n = n + 1 if f and f ~= "" then @@ -1125,7 +1175,7 @@ local builder = Cs { "start", -- + V("r") + V("h") + V("H") + V("u") + V("U") - + V("p") + V("b") + + V("p") + V("P") + V("b") + V("B") + V("t") + V("T") + V("l") + V("L") + V("I") @@ -1174,8 +1224,10 @@ local builder = Cs { "start", ["H"] = (prefix_any * P("H")) / format_H, -- %H => 0x0A1B2 (when - no 0x) was V ["u"] = (prefix_any * P("u")) / format_u, -- %u => u+0a1b2 (when - no u+) ["U"] = (prefix_any * P("U")) / format_U, -- %U => U+0A1B2 (when - no U+) - ["p"] = (prefix_any * P("p")) / format_p, -- %p => 12.345pt / maybe: P (and more units) - ["b"] = (prefix_any * P("b")) / format_b, -- %b => 12.342bp / maybe: B (and more units) + ["p"] = (prefix_any * P("p")) / format_p, -- %p => 12.345pt + ["P"] = (prefix_any * P("P")) / format_P, -- %p => 12.345 + ["b"] = (prefix_any * P("b")) / format_b, -- %b => 12.342bp + ["B"] = (prefix_any * P("B")) / format_B, -- %b => 12.342 ["t"] = (prefix_tab * P("t")) / format_t, -- %t => concat ["T"] = (prefix_tab * P("T")) / format_T, -- %t => sequenced ["l"] = (prefix_any * P("l")) / format_l, -- %l => boolean diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-auxiliary.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-auxiliary.lua index fcbd644158e..9c2d204aaab 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-auxiliary.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-auxiliary.lua @@ -6,8 +6,8 @@ assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") { name = "luaotfload-auxiliary", - version = "3.17", --TAGVERSION - date = "2021-01-08", --TAGDATE + version = "3.18", --TAGVERSION + date = "2021-05-21", --TAGDATE description = "luaotfload submodule / auxiliary functions", license = "GPL v2.0" } diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-case-el.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-case-el.lua deleted file mode 100644 index 1b329c4a65b..00000000000 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-case-el.lua +++ /dev/null @@ -1,294 +0,0 @@ -local unicode_data = require'luaotfload-unicode' - -local has_accent = 1 -local has_combining_dialytika = 2 -local has_ypogegrammeni = 4 -local has_other_diacritic = 8 -local has_vowel = 16 -local vowels = { - [0x03B1] = true, - [0x0391] = true, - [0x03B5] = true, - [0x0395] = true, - [0x03B7] = true, - [0x0397] = true, - [0x03B9] = true, - [0x0399] = true, - [0x03BF] = true, - [0x039F] = true, - [0x03C9] = true, - [0x03A9] = true, - [0x03C5] = true, - [0x03A5] = true, - [0x03F5] = true, -} -local diacritic_data = { - [0x0300] = has_accent, - [0x0301] = has_accent, - [0x0302] = has_accent, - [0x0303] = has_accent, - [0x0311] = has_accent, - [0x0342] = has_accent, - [0x0308] = has_combining_dialytika, - [0x0344] = has_accent | has_combining_dialytika, - [0x0345] = has_ypogegrammeni, - [0x0304] = has_other_diacritic, - [0x0306] = has_other_diacritic, - [0x0313] = has_other_diacritic, - [0x0314] = has_other_diacritic, - [0x0343] = has_other_diacritic, -} - -local mapping_tables = unicode_data.casemapping -local soft_dotted = unicode_data.soft_dotted -local ccc = unicode_data.ccc - -local uppercase = mapping_tables.uppercase -local lowercase = mapping_tables.lowercase -local cased = mapping_tables.cased -local case_ignorable = mapping_tables.case_ignorable - -local otfregister = fonts.constructors.features.otf.register - -local direct = node.direct -local is_char = direct.is_char -local has_glyph = direct.has_glyph -local uses_font = direct.uses_font -local getnext = direct.getnext -local setchar = direct.setchar -local setdisc = direct.setdisc -local getdisc = direct.getdisc -local getfield = direct.getfield -local remove = direct.remove -local copy = direct.copy -local insert_after = direct.insert_after -local traverse = direct.traverse - -local disc = node.id'disc' - -local nfd = {} -- FIXME: Data - -local data do - for cp = 1, 0xFF, 1 do -- FIXME: Correct limits - local decomposed = nfd[cp] - local first = decomposed and decomposed[1] or cp - local upper = uppercase[first] - local data = vowels[first] and has_vowel or 0 - if decomposed then - for i=1, #decomposed do - data = data | (diacritic_data[decomposed[i]] or 0) - end - end - end -end - ---[[ We make some implicit assumptions about contexts in SpecialCasing.txt here which happened to be true when I wrote the code: --- --- * Before_Dot only appears as Not_Before_Dot --- * No other context appears with Not_ --- * Final_Sigma is never language dependent --- * Other contexts are always language dependent --- * The only languages with special mappings are Lithuanian (lt/"LTH "/lit), Turkish (tr/"TRK "/tur), and Azeri/Azerbaijani (az/"AZE "/aze) -]] - -local font_lang = setmetatable({}, {__index = function(t, fid) - local f = font.getfont(fid) - local lang = f.specification.features.normal.language - lang = lang == 'lth' and 'lt' or lang == 'trk' and 'tr' or lang == 'aze' and 'az' or false - t[fid] = lang - return lang -end}) - -local function is_Final_Sigma(font, mapping, n, after) - mapping = mapping.Final_Sigma - if not mapping then return false end - mapping = mapping._ - if not mapping then return false end - n = getnext(n) - repeat - while n do - local char, id = is_char(n, font) - if id == disc then - after = getnext(n) - n = getfield(n, 'replace') - char, id = is_char(n, font) - elseif char then - if not case_ignorable[char] then - return not cased[char] and mapping - end - n = getnext(n) - else - return mapping - end - end - n, after = after - until not n - return mapping -end - -local function is_More_Above(font, mapping, n, after) - mapping = mapping.More_Above - if not mapping then return false end - mapping = mapping._ - if not mapping then return false end - n = getnext(n) - repeat - while n do - local char, id = is_char(n, font) - if id == disc then - after = getnext(n) - n = getfield(n, 'replace') - char, id = is_char(n, font) - elseif char then - local char_ccc = ccc[char] - if not char_ccc then - return false - elseif char_ccc == 230 then - return mapping - end - n = getnext(n) - else - return false - end - end - n, after = after - until not n - return false -end - -local function is_Not_Before_Dot(font, mapping, n, after) - mapping = mapping.Not_Before_Dot - if not mapping then return false end - mapping = mapping._ - if not mapping then return false end - n = getnext(n) - repeat - while n do - local char, id = is_char(n, font) - if id == disc then - after = getnext(n) - n = getfield(n, 'replace') - char, id = is_char(n, font) - elseif char then - local char_ccc = ccc[char] - if not char_ccc then - return mapping - elseif char_ccc == 230 then - return char ~= 0x0307 and mapping - end - n = getnext(n) - else - return mapping - end - end - n, after = after - until not n - return mapping -end - -local function is_Language_Mapping(font, mapping, n, after, seen_soft_dotted, seen_I) - if not mapping then return false end - if seen_soft_dotted then - local mapping = mapping.After_Soft_Dotted - mapping = mapping and mapping._ - if mapping then - return mapping - end - end - if seen_I then - local mapping = mapping.After_I - mapping = mapping and mapping._ - if mapping then - return mapping - end - end - return is_More_Above(font, mapping, n, after) or is_Not_Before_Dot(font, mapping, n, after) or mapping._ -- Might be nil -end - -local function process(table) - local function processor(head, font, after, seen_cased, seen_soft_dotted, seen_I) - local lang = font_lang[font] - local n = head - while n do - do - local new = has_glyph(n) - if n ~= new then - seen_cased, seen_soft_dotted, seen_I = nil - end - n = new - end - if not n then break end - local char, id = is_char(n, font) - if char then - local mapping = table[char] - if mapping then - if tonumber(mapping) then - setchar(n, mapping) - else - mapping = seen_cased and is_Final_Sigma(font, mapping, n, after) - or lang and is_Language_Mapping(font, mapping[lang], n, after, seen_soft_dotted, seen_I) - or mapping._ - if #mapping == 0 then - head, n = remove(head, n) - goto continue - else - setchar(n, mapping[1]) - for i=2, #mapping do - head, n = insert_after(head, n, copy(n)) - setchar(n, mapping[i]) - end - end - end - end - if not case_ignorable[char] then - seen_cased = cased[char] or nil - end - local char_ccc = ccc[char] - if not char_ccc or char_ccc == 230 then - seen_I = char == 0x49 or nil - seen_soft_dotted = soft_dotted[char] - end - elseif id == disc and uses_font(n, font) then - local pre, post, rep = getdisc(n) - local after = getnext(n) - pre, post, rep, seen_cased, seen_soft_dotted, seen_I = - processor(pre, font, nil, seen_cased, seen_soft_dotted, seen_I), - processor(post, font, after), - processor(rep, font, after, seen_cased, seen_soft_dotted, seen_I) - setdisc(n, pre, post, rep) - else - seen_cased, seen_soft_dotted, seen_I = nil - end - n = getnext(n) - ::continue:: - end - return head, seen_cased, seen_soft_dotted, seen_I - end - return function(head, font) return (processor(head, font)) end -end - -local upper_process = process(uppercase) -otfregister { - name = 'upper', - description = 'Map to uppercase', - default = false, - processors = { - position = 1, - plug = upper_process, - node = upper_process, - base = upper_process, - }, -} - -local lower_process = process(lowercase) -otfregister { - name = 'lower', - description = 'Map to lowercase', - default = false, - processors = { - position = 1, - plug = lower_process, - node = lower_process, - base = lower_process, - }, -} diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-colors.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-colors.lua index fb1cbd34877..c6a437c92a3 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-colors.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-colors.lua @@ -5,8 +5,8 @@ assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") { name = "luaotfload-colors", - version = "3.17", --TAGVERSION - date = "2021-01-08", --TAGDATE + version = "3.18", --TAGVERSION + date = "2021-05-21", --TAGDATE description = "luaotfload submodule / color", license = "GPL v2.0", author = "Khaled Hosny, Elie Roux, Philipp Gesang, Dohyun Kim, David Carlisle", diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-configuration.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-configuration.lua index 07ac92096dc..76a8d687546 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-configuration.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-configuration.lua @@ -7,8 +7,8 @@ assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") { name = "luaotfload-configuration", - version = "3.17", --TAGVERSION - date = "2021-01-08", --TAGDATE + version = "3.18", --TAGVERSION + date = "2021-05-21", --TAGDATE description = "luaotfload submodule / config file reader", license = "GPL v2.0" } @@ -994,7 +994,7 @@ local function dump () end if next(confdata) then iowrite (stringformat (conf_header, - osdate ("%Y-%m-d %H:%M:%S", os.time ()))) + osdate ("%Y-%m-%d %H:%M:%S", os.time ()))) iowrite (tableconcat (confdata, "\n")) iowrite (conf_footer) end diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-database.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-database.lua index 288f4a21b2c..b1d264f9b78 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-database.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-database.lua @@ -5,8 +5,8 @@ do -- block to avoid to many local variables error assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") { name = "luaotfload-database", - version = "3.17", --TAGVERSION - date = "2021-01-08", --TAGDATE + version = "3.18", --TAGVERSION + date = "2021-05-21", --TAGDATE description = "luaotfload submodule / database", license = "GPL v2.0", author = "Khaled Hosny, Elie Roux, Philipp Gesang, Marcel Krüger", diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-diagnostics.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-diagnostics.lua index 67970dc4c55..fe959a50dea 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-diagnostics.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-diagnostics.lua @@ -7,8 +7,8 @@ assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") { name = "luaotfload-diagnostics", - version = "3.17", --TAGVERSION - date = "2021-01-08", --TAGDATE + version = "3.18", --TAGVERSION + date = "2021-05-21", --TAGDATE description = "luaotfload-tool submodule / diagnostics", license = "GPL v2.0" } @@ -376,7 +376,7 @@ else out ("Try again later at %s.", osdate ("%F %T", reset)) else --- windows doesn’t C99 out ("Try again later at %s.", - osdate ("%Y-%m-d %H:%M:%S", reset)) + osdate ("%Y-%m-%d %H:%M:%S", reset)) end end return true diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-dvi.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-dvi.lua index 12ca5d7d562..f368c3ae5a7 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-dvi.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-dvi.lua @@ -6,8 +6,8 @@ assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") { name = "luaotfload-dvi", - version = "3.17", --TAGVERSION - date = "2021-01-08", --TAGDATE + version = "3.18", --TAGVERSION + date = "2021-05-21", --TAGDATE description = "luaotfload submodule / DVI", license = "GPL v2.0", author = "Marcel Krüger", diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-embolden.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-embolden.lua index d9f68f4d4d8..ca035bc4cd0 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-embolden.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-embolden.lua @@ -5,8 +5,8 @@ assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") { name = "luaotfload-embolden", - version = "3.17", --TAGVERSION - date = "2021-01-08", --TAGDATE + version = "3.18", --TAGVERSION + date = "2021-05-21", --TAGDATE description = "luaotfload submodule / embolden", license = "GPL v2.0", author = "Marcel Krüger" diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-fakesc.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-fakesc.lua deleted file mode 100644 index 421f6fd24d2..00000000000 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-fakesc.lua +++ /dev/null @@ -1,204 +0,0 @@ ------------------------------------------------------------------------ --- FILE: luaotfload-fakesc.lua --- DESCRIPTION: part of luaotfload / fakesc ------------------------------------------------------------------------ - -assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") { - name = "luaotfload-fakesc", - version = "3.17", --TAGVERSION - date = "2021-01-08", --TAGDATE - description = "luaotfload submodule / fakesc", - license = "GPL v2.0", - author = "Marcel Krüger" -} - -local nodenew = node.direct.new -local getfont = font.getfont -local setfont = node.direct.setfont -local getwhd = node.direct.getwhd -local insert_after = node.direct.insert_after -local traverse_char = node.direct.traverse_char -local protect_glyph = node.direct.protect_glyph -local otffeatures = fonts.constructors.newfeatures "otf" - -local sep = lpeg.P' '^0 * ';' * lpeg.P' '^0 -local codepoint = lpeg.S'0123456789ABCDEF'^4/function(c)return tonumber(c, 16)end -local codepoint_range = codepoint * ('..' * codepoint + lpeg.Cc(false)) -local function multirawset(table, key1, key2, value) - for key = key1,(key2 or key1) do - rawset(table, key, value) - end - return table -end -local script_extensions do - local entry = lpeg.Cg(codepoint_range * sep * lpeg.Ct((lpeg.C(lpeg.R'AZ' * lpeg.R'az'^1))^1 * ' ') * '#')^-1 * (1-lpeg.P'\n')^0 * '\n' - local file = lpeg.Cf( - lpeg.Ct'' - * entry^0 - , multirawset) - - local f = io.open(kpse.find_file"ScriptExtensions.txt") - script_extensions = file:match(f:read'*a') - f:close() - for cp,t in next, script_extensions do - for i=1,#t do - t[t[i]] = true - end - end -end -local script_mapping do - -- We could extract these from PropertyValueAliases.txt... - local script_aliases = { - Adlam = "Adlm", Caucasian_Albanian = "Aghb", Ahom = "Ahom", Arabic = "Arab", - Imperial_Aramaic = "Armi", Armenian = "Armn", Avestan = "Avst", - Balinese = "Bali", Bamum = "Bamu", Bassa_Vah = "Bass", Batak = "Batk", - Bengali = "Beng", Bhaiksuki = "Bhks", Bopomofo = "Bopo", Brahmi = "Brah", - Braille = "Brai", Buginese = "Bugi", Buhid = "Buhd", Chakma = "Cakm", - Canadian_Aboriginal = "Cans", Carian = "Cari", Cham = "Cham", - Cherokee = "Cher", Coptic = "Copt", Cypriot = "Cprt", Cyrillic = "Cyrl", - Devanagari = "Deva", Dogra = "Dogr", Deseret = "Dsrt", Duployan = "Dupl", - Egyptian_Hieroglyphs = "Egyp", Elbasan = "Elba", Elymaic = "Elym", - Ethiopic = "Ethi", Georgian = "Geor", Glagolitic = "Glag", - Gunjala_Gondi = "Gong", Masaram_Gondi = "Gonm", Gothic = "Goth", - Grantha = "Gran", Greek = "Grek", Gujarati = "Gujr", Gurmukhi = "Guru", - Hangul = "Hang", Han = "Hani", Hanunoo = "Hano", Hatran = "Hatr", - Hebrew = "Hebr", Hiragana = "Hira", Anatolian_Hieroglyphs = "Hluw", - Pahawh_Hmong = "Hmng", Nyiakeng_Puachue_Hmong = "Hmnp", - Katakana_Or_Hiragana = "Hrkt", Old_Hungarian = "Hung", Old_Italic = "Ital", - Javanese = "Java", Kayah_Li = "Kali", Katakana = "Kana", - Kharoshthi = "Khar", Khmer = "Khmr", Khojki = "Khoj", Kannada = "Knda", - Kaithi = "Kthi", Tai_Tham = "Lana", Lao = "Laoo", Latin = "Latn", - Lepcha = "Lepc", Limbu = "Limb", Linear_A = "Lina", Linear_B = "Linb", - Lisu = "Lisu", Lycian = "Lyci", Lydian = "Lydi", Mahajani = "Mahj", - Makasar = "Maka", Mandaic = "Mand", Manichaean = "Mani", Marchen = "Marc", - Medefaidrin = "Medf", Mende_Kikakui = "Mend", Meroitic_Cursive = "Merc", - Meroitic_Hieroglyphs = "Mero", Malayalam = "Mlym", Modi = "Modi", - Mongolian = "Mong", Mro = "Mroo", Meetei_Mayek = "Mtei", Multani = "Mult", - Myanmar = "Mymr", Nandinagari = "Nand", Old_North_Arabian = "Narb", - Nabataean = "Nbat", Newa = "Newa", Nko = "Nkoo", Nushu = "Nshu", - Ogham = "Ogam", Ol_Chiki = "Olck", Old_Turkic = "Orkh", Oriya = "Orya", - Osage = "Osge", Osmanya = "Osma", Palmyrene = "Palm", Pau_Cin_Hau = "Pauc", - Old_Permic = "Perm", Phags_Pa = "Phag", Inscriptional_Pahlavi = "Phli", - Psalter_Pahlavi = "Phlp", Phoenician = "Phnx", Miao = "Plrd", - Inscriptional_Parthian = "Prti", Rejang = "Rjng", Hanifi_Rohingya = "Rohg", - Runic = "Runr", Samaritan = "Samr", Old_South_Arabian = "Sarb", - Saurashtra = "Saur", SignWriting = "Sgnw", Shavian = "Shaw", - Sharada = "Shrd", Siddham = "Sidd", Khudawadi = "Sind", Sinhala = "Sinh", - Sogdian = "Sogd", Old_Sogdian = "Sogo", Sora_Sompeng = "Sora", - Soyombo = "Soyo", Sundanese = "Sund", Syloti_Nagri = "Sylo", - Syriac = "Syrc", Tagbanwa = "Tagb", Takri = "Takr", Tai_Le = "Tale", - New_Tai_Lue = "Talu", Tamil = "Taml", Tangut = "Tang", Tai_Viet = "Tavt", - Telugu = "Telu", Tifinagh = "Tfng", Tagalog = "Tglg", Thaana = "Thaa", - Thai = "Thai", Tibetan = "Tibt", Tirhuta = "Tirh", Ugaritic = "Ugar", - Vai = "Vaii", Warang_Citi = "Wara", Wancho = "Wcho", Old_Persian = "Xpeo", - Cuneiform = "Xsux", Yi = "Yiii", Zanabazar_Square = "Zanb", - Inherited = "Zinh", Common = "Zyyy", Unknown = "Zzzz", - } - local entry = lpeg.Cg(codepoint_range * sep * ((lpeg.R'AZ' + lpeg.R'az' + '_')^1/script_aliases))^-1 * (1-lpeg.P'\n')^0 * '\n' - -- local entry = lpeg.Cg(codepoint_range * sep * lpeg.Cc(true))^-1 * (1-lpeg.P'\n')^0 * '\n' - local file = lpeg.Cf( - lpeg.Ct'' - * entry^0 - , multirawset) - - local f = io.open(kpse.find_file"Scripts.txt") - script_mapping = file:match(f:read'*a') - f:close() -end - -local additional_scripts_tables = { } - -local additional_scripts_fonts = setmetatable({}, { - __index = function(t, fid) - local f = font.getfont(fid) - -- table.tofile('myfont2', f) - local res = f and f.additional_scripts or false - t[fid] = res - return res - end, -}) - -local function makecombifont(tfmdata, _, additional_scripts) - local basescript = tfmdata.properties.script - local scripts = {basescript = false} - additional_scripts = additional_scripts_tables[additional_scripts] - for script, fontname in pairs(additional_scripts) do - if script ~= basescript then - local f = fonts.definers.read(fontname, tfmdata.size) - local fid - if type(f) == 'table' then - fid = font.define(f) - else - error[[FIXME???]] - end - scripts[script] = { - fid = fid, - font = f, - characters = f.characters, - } - end - end - tfmdata.additional_scripts = scripts -end - -local glyph_id = node.id'glyph' --- TODO: unset last_script, matching parentheses etc -function domultiscript(head, _, _, _, direction) - head = node.direct.todirect(head) - local last_fid, last_fonts, last_script - for cur, cid, fid in traverse_char(head) do - if fid ~= last_fid then - last_fid, last_fonts, last_script = fid, additional_scripts_fonts[fid] - end - if last_fonts then - local mapped_scr = script_mapping[cid] - if mapped_scr == "Zinh" then - mapped_scr = last_script - else - local additional_scr = script_extensions[cid] - if additional_scripts then - if additional_scripts[last_script] then - mapped_scr = last_script - elseif not last_fonts[mapped_scr] then - for i = 1, #additional_scripts do - if last_fonts[additional_scripts[i]] then - mapped_scr = additional_scripts[i] - break - end - end - end - elseif mapped_scr == "Zyyy" then - mapped_scr = last_script - end - end - last_script = mapped_scr - local mapped_font = last_fonts[mapped_scr] - if mapped_font then - setfont(cur, mapped_font.fid) - end - end - end -end - -function luaotfload.add_multiscript(name, fonts) - if fonts == nil then - fonts = name - name = #additional_scripts_fonts + 1 - end - additional_scripts_tables[name] = fonts - return name -end - -otffeatures.register { - name = "multiscript", - description = "Combine fonts for multiple scripts", - manipulators = { - node = makecombifont, - }, - -- processors = { -- processors would be nice, but they are applied - -- -- too late for our purposes - -- node = donotdef, - -- } -} - ---- vim:sw=2:ts=2:expandtab:tw=71 diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-fallback.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-fallback.lua index 0caef93589c..3e5d65eacaa 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-fallback.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-fallback.lua @@ -5,8 +5,8 @@ assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") { name = "luaotfload-fallback", - version = "3.17", --TAGVERSION - date = "2021-01-08", --TAGDATE + version = "3.18", --TAGVERSION + date = "2021-05-21", --TAGDATE description = "luaotfload submodule / fallback", license = "GPL v2.0", author = "Marcel Krüger" diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-features.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-features.lua index adce910c4e1..bedcd59d764 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-features.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-features.lua @@ -5,8 +5,8 @@ assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") { name = "luaotfload-features", - version = "3.17", --TAGVERSION - date = "2021-01-08", --TAGDATE + version = "3.18", --TAGVERSION + date = "2021-05-21", --TAGDATE description = "luaotfload submodule / features", license = "GPL v2.0", author = "Hans Hagen, Khaled Hosny, Elie Roux, Philipp Gesang, Marcel Krüger", @@ -509,6 +509,17 @@ do end return factors end + + -- Additionally we patch trytosharefont to ensure that variable fonts work + -- with default values whenever no explicit values are passed. + local original_trytosharefont = fonts.constructors.trytosharefont + function fonts.constructors.trytosharefont(target, tfmdata) + original_trytosharefont(target, tfmdata) + if not target.streamprovider and tfmdata.resources.variabledata then + local format = tfmdata.properties.format + target.streamprovider = format == 'opentype' and 1 or format == 'truetype' and 2 or 0 + end + end end -- MK: Added diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-filelist.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-filelist.lua index 10421ee372f..e3fc38acd3c 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-filelist.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-filelist.lua @@ -6,8 +6,8 @@ if luaotfload_module then luaotfload_module { name = "luaotfload-filelist", - version = "3.17", --TAGVERSION - date = "2021-01-08", --TAGDATE + version = "3.18", --TAGVERSION + date = "2021-05-21", --TAGDATE description = "luaotfload submodule / filelist", license = "GPL v2.0" } end diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-glyphlist.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-glyphlist.lua index 7a34f29ca18..93a2eaeffd0 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-glyphlist.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-glyphlist.lua @@ -1,8 +1,8 @@ if luaotfload_module then luaotfload_module { name = "luaotfload-glyphlist", - version = "3.17", --TAGVERSION - date = "2021-01-08", --TAGDATE + version = "3.18", --TAGVERSION + date = "2021-05-21", --TAGDATE description = "luaotfload submodule / autogenerated glyphlist", copyright = "derived from https://raw.githubusercontent.com/adobe-type-tools/agl-aglfn/master/glyphlist.txt", original = "Adobe Glyph List, version 2.0, September 20, 2002", diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-harf-define.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-harf-define.lua index f470b13772f..f128adbaaea 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-harf-define.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-harf-define.lua @@ -5,8 +5,8 @@ do -- block to avoid to many local variables error assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") { name = "luaotfload-harf-define", - version = "3.17", --TAGVERSION - date = "2021-01-08", --TAGDATE + version = "3.18", --TAGVERSION + date = "2021-05-21", --TAGDATE description = "luaotfload submodule / HarfBuzz font loading", license = "GPL v2.0", author = "Khaled Hosny, Marcel Krüger", @@ -71,7 +71,7 @@ local get_designsize do end local containers = luaotfload.fontloader.containers -local hbcacheversion = 1.1 +local hbcacheversion = 1.2 local facecache = containers.define("fonts", "hb", hbcacheversion, true) local function loadfont(spec) @@ -119,7 +119,8 @@ local function loadfont(spec) local descender = fontextents and fontextents.descender or upem * .2 local gid = hbfont:get_nominal_glyph(0x0020) - local space = gid and hbfont:get_glyph_h_advance(gid) or upem / 2 + local real_space = hbfont:get_glyph_h_advance(gid or 0) + local tex_space = gid and real_space or upem / 2 local slant = 0 if haspost then @@ -214,7 +215,8 @@ local function loadfont(spec) gid_offset = 0x120000, upem = upem, fonttype = fonttype, - space = space, + real_space = real_space, + tex_space = tex_space, xheight = xheight, capheight = capheight, slant = slant, @@ -260,7 +262,8 @@ local function scalefont(data, spec) local hbface = data.face local hbfont = data.font local upem = data.upem - local space = data.space + local tex_space = data.tex_space + local real_space = data.real_space local gid_offset = data.gid_offset if size < 0 then @@ -321,15 +324,16 @@ local function scalefont(data, spec) characters = characters, parameters = { slant = data.slant, - space = space * scale, - space_stretch = space * scale / 2, - space_shrink = space * scale / 3, + space = tex_space * scale, + space_stretch = tex_space * scale / 2, + space_shrink = tex_space * scale / 3, x_height = data.xheight * scale, quad = size, - extra_space = space * scale / 3, + extra_space = tex_space * scale / 3, [8] = data.capheight * scale, -- for XeTeX compatibility. }, hb = { + space = (real_space * scale + .5) // 1, scale = scale, palette = palette, shared = data, diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-harf-plug.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-harf-plug.lua index bf7028c54de..1577aa7004b 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-harf-plug.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-harf-plug.lua @@ -2,17 +2,15 @@ -- FILE: luaotfload-harf-plug.lua -- DESCRIPTION: part of luaotfload / HarfBuzz / fontloader plugin ----------------------------------------------------------------------- -do -- block to avoid to many local variables error - assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") { - name = "luaotfload-harf-plug", - version = "3.17", --TAGVERSION - date = "2021-01-08", --TAGDATE - description = "luaotfload submodule / HarfBuzz shaping", - license = "GPL v2.0", - author = "Khaled Hosny, Marcel Krüger", - copyright = "Luaotfload Development Team", - } -end +assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") { + name = "luaotfload-harf-plug", + version = "3.18", --TAGVERSION + date = "2021-05-21", --TAGDATE + description = "luaotfload submodule / HarfBuzz shaping", + license = "GPL v2.0", + author = "Khaled Hosny, Marcel Krüger", + copyright = "Luaotfload Development Team", +} local hb = luaotfload.harfbuzz local logreport = luaotfload.log.report @@ -181,7 +179,8 @@ local function itemize(head, fontid, direction) local dirstack = {} local currdir = direction or 0 local lastskip, lastdir = true - local lastrun = {} + local dummyrun = { start = 0, len = 0 } + local lastrun = dummyrun local lastdisc local in_disc @@ -226,9 +225,6 @@ local function itemize(head, fontid, direction) setlink(prev, n) code = nil skip = false - if not prev then - head = n - end else skip = true end @@ -272,6 +268,9 @@ local function itemize(head, fontid, direction) lastrun.len = lastrun.len + 1 elseif disc then if lastdisc then + if lastrun.len == 0 then + runs[#runs - 1].after = n + end lastdisc.next = disc lastdisc = disc else @@ -280,7 +279,7 @@ local function itemize(head, fontid, direction) end end - return head, runs + return dummyrun.after, runs end @@ -439,6 +438,7 @@ function shape(head, firstnode, run) while disc_cluster and after_cluster <= cluster or not disc_cluster and anchor_cluster <= cluster do if disc_cluster then + if false then -- The saved_... are for nested (aka first/second or init/select) discretionary nodes. The code is currently disabled because the linebreaking for these is broken on the engine level. if not saved_after and saved_anchor < cluster then saved_after = discs.next.after_cluster + offset if saved_after > cluster then @@ -448,11 +448,14 @@ function shape(head, firstnode, run) elseif saved_after then saved_after, after_cluster = after_cluster, saved_after end + end local rep_glyphs = table.move(glyphs, disc_glyph, i - 1, 1, {}) for j = 1, #rep_glyphs do local glyph = rep_glyphs[j] glyph.cluster = glyph.cluster - disc_cluster - glyph.nextcluster = glyph.nextcluster - disc_cluster + if glyph.nextcluster then + glyph.nextcluster = glyph.nextcluster - disc_cluster + end end do local cluster_offset = disc_cluster - cluster + (saved_after and 2 or 1) -- The offset the glyph indices will move @@ -637,7 +640,6 @@ function shape(head, firstnode, run) ::NEXTCLUSTERFOUND:: -- end glyph.nextcluster = nextcluster - local disc, discindex -- Calculate the Unicode code points of this glyph. If cluster did not -- change then this is a glyph inside a complex cluster and will be -- handled with the start of its cluster. @@ -651,19 +653,12 @@ function shape(head, firstnode, run) -- assert(char == codes[j]) hex = hex .. to_utf16_hex(char) str = str .. utf8.char(char) - elseif not discindex and id == disc_t then - local props = properties[disc] - if not (props and props.zwnj) then - disc, discindex = node, j - end end node = getnext(node) end glyph.tounicode = hex glyph.string = str end - if not fordisc and discindex then - end end return head, firstnode, glyphs, run.len - len else @@ -743,7 +738,6 @@ local function tonodes(head, node, run, glyphs) local dir = run.dir local fontid = run.font local fontdata = font.getfont(fontid) - local space = fontdata.parameters.space local characters = fontdata.characters local hbdata = fontdata.hb local hfactor = (fontdata.extend or 1000) / 1000 @@ -758,6 +752,7 @@ local function tonodes(head, node, run, glyphs) local lastprops local scale = hbdata.scale + local space = hbdata.space local haspng = hbshared.haspng local fonttype = hbshared.fonttype diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-init.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-init.lua index c0ec8cd84b4..9ce1d2494d2 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-init.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-init.lua @@ -7,8 +7,8 @@ assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") { name = "luaotfload-init", - version = "3.17", --TAGVERSION - date = "2021-01-08", --TAGDATE + version = "3.18", --TAGVERSION + date = "2021-05-21", --TAGDATE description = "luaotfload submodule / initialization", license = "GPL v2.0" } @@ -394,7 +394,7 @@ local function init_main(early_hook) ---load_fontloader_module "font-odv.lua" --- <= Devanagari support from Context logreport ("log", 0, "init", - "Context OpenType loader version %q", + "Context OpenType loader version %.3f", fonts.handlers.otf.version) callback.register = trapped_register nodes = context_environment.nodes diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-letterspace.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-letterspace.lua index bbdaa729e2a..7963a839b9b 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-letterspace.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-letterspace.lua @@ -5,8 +5,8 @@ assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") { name = "luaotfload-letterspace", - version = "3.17", --TAGVERSION - date = "2021-01-08", --TAGDATE + version = "3.18", --TAGVERSION + date = "2021-05-21", --TAGDATE description = "luaotfload submodule / letterspacing", license = "GPL v2.0", copyright = "PRAGMA ADE / ConTeXt Development Team", @@ -59,6 +59,12 @@ local setkern = nodedirect.setkern local getglue = nodedirect.getglue local setglue = nodedirect.setglue +local hasattribute = nodedirect.has_attribute +local setattribute = nodedirect.set_attribute + +local getattributelist = nodedirect.getattributelist +local setattributelist = nodedirect.setattributelist + local find_node_tail = nodedirect.tail local todirect = nodedirect.todirect local tonode = nodedirect.tonode @@ -80,6 +86,9 @@ local chardata = fonthashes.characters local otffeatures = fonts.constructors.newfeatures "otf" local markdata +local attribute_table = {} +local attr = luatexbase.new_attribute("luaotfload.letterspace_done") + local function getprevreal(n) repeat n = getprev(n) @@ -243,6 +252,10 @@ kerncharacters = function (head) local id = getid(start) if id == glyph_code then --- 1) look up kern factor (slow, but cached rudimentarily) + if hasattribute(start, attr, 1) then -- We already kerned this node + firstkern = false -- TODO: I'm not sure about this one yet + goto nextnode + end local fontid = getfont(start) local krn, fillup = unpack(kernamounts[fontid]) if not krn or krn == 0 then @@ -426,6 +439,14 @@ kerncharacters = function (head) setfield(disc, "replace", kern_injector(false, krn)) end --[[if replace and prv and nxt]] end --[[if not pid]] + local attr_list = getattributelist(start) + local new_attr_list = attribute_table[attr_list] + if new_attr_list then + setattributelist(start, new_attr_list) + else + setattribute(start, attr, 1) + attribute_table[attr_list] = getattributelist(start) + end end --[[if prev]] end --[[if id == glyph_code]] @@ -478,6 +499,9 @@ local function enablefontkerning ( ) logreport ("both", 0, "letterspace", "kerncharacters() failed to return a valid new head") end + + for k in next, attribute_table do attribute_table[k] = nil end + return tonode (direct_hd) end diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-loaders.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-loaders.lua index e58f2429fef..1ed66aebea2 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-loaders.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-loaders.lua @@ -8,8 +8,8 @@ assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") { name = "luaotfload-loaders", - version = "3.17", --TAGVERSION - date = "2021-01-08", --TAGDATE + version = "3.18", --TAGVERSION + date = "2021-05-21", --TAGDATE description = "luaotfload submodule / callback handling", license = "GPL v2.0" } diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-log.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-log.lua index 38208241f76..74c5fd69299 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-log.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-log.lua @@ -6,8 +6,8 @@ assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") { name = "luaotfload-log", - version = "3.17", --TAGVERSION - date = "2021-01-08", --TAGDATE + version = "3.18", --TAGVERSION + date = "2021-05-21", --TAGDATE description = "luaotfload submodule / logging", license = "GPL v2.0", author = "Khaled Hosny, Elie Roux, Philipp Gesang", diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-multiscript.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-multiscript.lua index 7caae3a2221..e3cf9a0cbf8 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-multiscript.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-multiscript.lua @@ -5,8 +5,8 @@ assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") { name = "luaotfload-multiscript", - version = "3.17", --TAGVERSION - date = "2021-01-08", --TAGDATE + version = "3.18", --TAGVERSION + date = "2021-05-21", --TAGDATE description = "luaotfload submodule / multiscript", license = "GPL v2.0", author = "Marcel Krüger" diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-notdef.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-notdef.lua index aa4ce3076e9..d8cc6777234 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-notdef.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-notdef.lua @@ -5,8 +5,8 @@ assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") { name = "luaotfload-notdef", - version = "3.17", --TAGVERSION - date = "2021-01-08", --TAGDATE + version = "3.18", --TAGVERSION + date = "2021-05-21", --TAGDATE description = "luaotfload submodule / notdef", license = "GPL v2.0", author = "Marcel Krüger" diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-parsers.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-parsers.lua index 40973db8824..cd452b40c29 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-parsers.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-parsers.lua @@ -7,8 +7,8 @@ assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") { name = "luaotfload-parsers", - version = "3.17", --TAGVERSION - date = "2021-01-08", --TAGDATE + version = "3.18", --TAGVERSION + date = "2021-05-21", --TAGDATE description = "luaotfload submodule / parsers", license = "GPL v2.0" } diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-resolvers.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-resolvers.lua index 4aa27a513bb..a24757777e5 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-resolvers.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-resolvers.lua @@ -11,8 +11,8 @@ assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") { name = "luaotfload-resolvers", - version = "3.17", --TAGVERSION - date = "2021-01-08", --TAGDATE + version = "3.18", --TAGVERSION + date = "2021-05-21", --TAGDATE description = "luaotfload submodule / resolvers", license = "GPL v2.0" } diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-scripts.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-scripts.lua index 003dda6c07b..8a4f51ea589 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-scripts.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-scripts.lua @@ -5,8 +5,8 @@ assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") { name = "luaotfload-script", - version = "3.17", --TAGVERSION - date = "2021-01-08", --TAGDATE + version = "3.18", --TAGVERSION + date = "2021-05-21", --TAGDATE description = "luaotfload submodule / Script helpers", license = "CC0 1.0 Universal", author = "Marcel Krüger" diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-status.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-status.lua index ef89e65010b..6743a025c38 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-status.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-status.lua @@ -1,8 +1,8 @@ return { ["hashes"]={ - { "fontloader-2021-01-07.lua", "ef54bfa34416e2c85fa48d3195c67fd2" }, + { "fontloader-2021-05-20.lua", "d3d971e3e79aefcb828157b97cc33378" }, { "fontloader-util-fil.lua", "aae2a2add764144bb58dd8216fd59260" }, - { "fontloader-util-str.lua", "c975ff7bbd178163cf47d9e9296c8b4b" }, + { "fontloader-util-str.lua", "f3480da8f9a6f34fe320900f7224719b" }, { "fontloader-l-unicode.lua", "f368874f11f3c525de5864fd413e4b24" }, { "fontloader-l-math.lua", "082add08e0bb79f39191ae9534a79849" }, { "fontloader-l-boolean.lua", "abe28515dd33e8f6c416c09bca351cf8" }, @@ -11,9 +11,9 @@ return { { "fontloader-l-table.lua", "0330da8b3a08d39876def70df8d9c0e5" }, { "fontloader-l-string.lua", "9457f2af85723e0e6c46d0b5122e9000" }, { "fontloader-l-function.lua", "a7e68a9703c35238729da41a474e951b" }, - { "fontloader-l-lpeg.lua", "10bdaef44175902917691835010ae5f5" }, + { "fontloader-l-lpeg.lua", "446dc07c8f6d2884122679fb4c8589e2" }, { "fontloader-l-lua.lua", "420bc442e6d81f4624728a6c56fcd175" }, - { "fontloader-fonts-gbn.lua", "10ecdf01e7c926e5128ad8a9dff4d677" }, + { "fontloader-fonts-gbn.lua", "34e4543a02f6fbc8c2ade896cb6dc7df" }, { "fontloader-fonts-lig.lua", "fbd251eea3810a43a8d5542319361d68" }, { "fontloader-fonts-ext.lua", "32013cbc5d5d336be8b1d1e5879d86c4" }, { "fontloader-fonts-def.lua", "f435e0875f203f343157baeff876ec9c" }, @@ -21,79 +21,79 @@ return { { "fontloader-fonts-enc.lua", "5ff4ca50493d7c4ecea0e15c203099f0" }, { "fontloader-fonts-mis.lua", "17e967c9ec4d001deefd43ddf25e98f7" }, { "fontloader-basics-chr.lua", "64fafe4eaf55d64aead6513c1e74a024" }, - { "fontloader-basics-nod.lua", "4b5c3c63e19df1b3f37fae7f87c25bda" }, - { "fontloader-font-imp-effects.lua", "a2dde5e071fcb3fc7b90f2bcd5aa4f22" }, + { "fontloader-basics-nod.lua", "b2e0a0e5e1e27349aed464fa738b8db1" }, + { "fontloader-font-imp-effects.lua", "d05997c1826355548ec9aec1346f9f23" }, { "fontloader-font-imp-italics.lua", "defcb415bc1e0a0999b27773902adc18" }, { "fontloader-font-imp-ligatures.lua", "26ffcf089391445f7af59536c8814364" }, { "fontloader-font-imp-tex.lua", "ceb087ef6fa2f89aed7179f60ddf8f35" }, - { "fontloader-font-shp.lua", "5ff497c993112d4fef4c148348d964eb" }, + { "fontloader-font-shp.lua", "2bb36adb4b264a895a2c4d97e1ac1d1e" }, { "fontloader-font-def.lua", "b9d908c2338b7dc443ce9d1e9fcb7139" }, { "fontloader-font-lua.lua", "1fbfdf7b689b2bdfd0e3bb9bf74ce136" }, { "fontloader-font-afk.lua", "9da14e0fb22129c053acc599d1312544" }, - { "fontloader-font-one.lua", "53cd565030e919da984b50471cc3be37" }, + { "fontloader-font-one.lua", "bd39d42055a44ca2002f8ddbbbbf27c3" }, { "fontloader-font-onr.lua", "6d161533f3437435e12a0ad64866df44" }, - { "fontloader-font-ocl.lua", "797b5c71bf819c5f4fb314a4d646e9a7" }, - { "fontloader-font-osd.lua", "73c9531c79df5ada320cb20777f7ed49" }, + { "fontloader-font-ocl.lua", "2a377351ae23c339764ec8ce2e8e9164" }, + { "fontloader-font-osd.lua", "0e051ca0d3b1a8e0604ced27e753fde8" }, { "fontloader-font-otc.lua", "0f12230ea07b5151f75d52726977e91f" }, - { "fontloader-font-ots.lua", "c780a471147527f4ddc139e017927ffe" }, - { "fontloader-font-ota.lua", "ad1d5de06400f88829509e1f3ff2b473" }, - { "fontloader-font-oup.lua", "6f46aa00ae1c20c43f8ffaf329dc8695" }, - { "fontloader-font-otj.lua", "8de59cb9b043e5f73c6b9f7cc8f6978e" }, + { "fontloader-font-ots.lua", "cb106ae882e8548051f00aac8b7fa862" }, + { "fontloader-font-ota.lua", "2bb12d708e35bc05443eba791e2554e7" }, + { "fontloader-font-oup.lua", "4eb2f26e51835239e26a8df2ecf04366" }, + { "fontloader-font-otj.lua", "b2c165bd6771a57633f992d07384b739" }, { "fontloader-font-oto.lua", "2b1d6bc63b2ebf8f2655a15e1cda6541" }, - { "fontloader-font-otl.lua", "f4e6652a191003493389de230b14cfb3" }, - { "fontloader-font-ott.lua", "673ed11e1d159997f535bfec5fa73808" }, + { "fontloader-font-otl.lua", "6f701653de713e8aa80d82c7cdf32d75" }, + { "fontloader-font-ott.lua", "3f67b1b1d40bbc222681d8db4aff0f42" }, { "fontloader-font-oti.lua", "309a75f9c14b77d87e94eba827dc4e71" }, { "fontloader-font-dsp.lua", "174ce11f3ba0bddf270f48d8d2addd56" }, { "fontloader-font-ttf.lua", "ffffc827e1bcddc33a2b615340ecff7f" }, - { "fontloader-font-cff.lua", "2b677fad52d9999d0685e8525271a8cc" }, - { "fontloader-font-otr.lua", "64dcbbc7107538723990e1119a80a9f8" }, + { "fontloader-font-cff.lua", "01e7c6fbc8961a566f4e4f8cbedb7004" }, + { "fontloader-font-otr.lua", "ad238624c9ebd488d4bbe9af3b620189" }, { "fontloader-font-vfc.lua", "a81c29eda98cd62cbebdb6c93544b50d" }, { "fontloader-font-map.lua", "c4a39db5ad822b348aa61bca5f4a599a" }, { "fontloader-font-cid.lua", "22b0367742fb253deef84ef7ccf5e8de" }, { "fontloader-font-con.lua", "724e5dd14aec2d4d189f8619898004cf" }, { "fontloader-font-ini.lua", "5343de60613adb24cdd7a8d2ee1d153c" }, { "fontloader-data-con.lua", "23a0f5386d46a1c157ae82a373e35fa0" }, - { "fontloader-reference.lua", "4807209e6a35420dd7528e9ec02f11da" }, + { "fontloader-reference.lua", "29911e74397766ee36205736166dd763" }, { "fontloader-basics-gen.lua", "4bc43036e9796fccb0b8869f4b05bf2e" }, { "mktests", "918cb50be9ee8bd645ac1a27dc501e8c" }, - { "mkstatus", "d3bc6e7d0f6deb80db4edc6975e2ac5c" }, + { "mkstatus", "7f2fd945c1247f6af6b96c4ed49ddeab" }, { "mkcharacters", "bfca0e96e1e351afe7077502f9595af9" }, { "mkglyphlist", "7a8a8fdc0eac7fac2f13ec8f4e8e7aa9" }, { "mkimport", "7d62f1042e548f8b9368f26b9ba4be5c" }, - { "luaotfload-glyphlist.lua", "6097b4fd28b303a3ae7577e94f86610d" }, + { "luaotfload-glyphlist.lua", "54908a38bf531914f350614afff2ccf6" }, { "luaotfload-characters.lua", "76415ca3ede312cad6e09038323489ae" }, - { "luaotfload-dvi.lua", "a0d33e699c250c0e4abd4cfa1b974b6e" }, - { "luaotfload-tounicode.lua", "e07e112222777070250fbc980b2e6b85" }, - { "luaotfload-unicode.lua", "1d7fd6ab63640cb6c8e2091ac5a57915" }, - { "luaotfload-resolvers.lua", "b387d9435738f7ce8cf1e6af86b565a6" }, - { "luaotfload-parsers.lua", "dba42cb2f6bbfa13b9a56d0e4a2b2f44" }, - { "luaotfload-fallback.lua", "a3c8c048b14a304d3352871014ef1343" }, - { "luaotfload-szss.lua", "2413a2be98181fe77f7e110369194769" }, - { "luaotfload-scripts.lua", "2b924be852e17191e651faf5a2097e12" }, - { "luaotfload-multiscript.lua", "db7b6c7791b4b909d12234620ff7973d" }, - { "luaotfload-loaders.lua", "d169564522ac7194e7410d8263cd1b31" }, - { "luaotfload-harf-plug.lua", "8fdc1ba513a6026546b883259e559c7e" }, - { "luaotfload-harf-define.lua", "1c9a663bb7bfa650b93dcf01d5450675" }, - { "luaotfload-notdef.lua", "26fed1a76150718e05c8c56b1983ebdd" }, - { "luaotfload-embolden.lua", "5506419bc583d450f252542b1105d6ce" }, - { "luaotfload-letterspace.lua", "1a518a55f6663ce13866416a5b94d6a4" }, - { "luaotfload-features.lua", "33fdd06674606d043599dc4ea9b2a56b" }, - { "luaotfload-database.lua", "4a0f9f3b500df0d8a8234a0954065e46" }, - { "luaotfload-configuration.lua", "589ca99522479a0929d6824bafa36f63" }, - { "luaotfload-colors.lua", "7c201914c79310d9e79e75dfc7ee982b" }, - { "luaotfload-auxiliary.lua", "8e427ec79ced91d9fc6fbcece159d042" }, - { "luaotfload-filelist.lua", "3cd6b9d12ba2fb48783e393593cd9afd" }, - { "luaotfload-tool.lua", "f4534033397387433601040694b70c6b" }, - { "luaotfload-diagnostics.lua", "473e1a3cd00e4b277b1f7e17b13254da" }, - { "luaotfload-log.lua", "809e4afac4e070b619512461a6fedd90" }, - { "luaotfload-init.lua", "e3b832a9efc91c977044383640835069" }, + { "luaotfload-dvi.lua", "403603ff9e267d2b9ac631e63b869718" }, + { "luaotfload-tounicode.lua", "8f7850323417188eef5197d4e420bd34" }, + { "luaotfload-unicode.lua", "5bc464447c3f5b154d8368904044d654" }, + { "luaotfload-resolvers.lua", "3655371360dd87b4a7c83e355357e6eb" }, + { "luaotfload-parsers.lua", "c715cb6ea43d644ec26d6e87d25b5d27" }, + { "luaotfload-fallback.lua", "78a566243c0ad99e74f93fface672fb5" }, + { "luaotfload-szss.lua", "4c431d8f76e06200b2df3269615097cc" }, + { "luaotfload-scripts.lua", "12bf373853ead3eab3c83ec62e37bbd6" }, + { "luaotfload-multiscript.lua", "a46096b20f5442acea29c75b77f763a7" }, + { "luaotfload-loaders.lua", "ba59f0161e985f4c97c54245a74a8d29" }, + { "luaotfload-harf-plug.lua", "bded3b2beccab4943f616b3069cbb372" }, + { "luaotfload-harf-define.lua", "a5e760f71e08a8ff40a40defc9d59e4e" }, + { "luaotfload-notdef.lua", "dbb4718b4c1b46adc5870af3f5cc6cac" }, + { "luaotfload-embolden.lua", "7cc1563093c005c40c11b8c327e617f1" }, + { "luaotfload-letterspace.lua", "e7ee541a56954ebfa1a227aa59614bb9" }, + { "luaotfload-features.lua", "bf81e7630c3786ce12c1f9b61ef73037" }, + { "luaotfload-database.lua", "9b911605805ca1fab7d4088c0c50a5d2" }, + { "luaotfload-configuration.lua", "ddedd9c27f810b254547c6a799aba892" }, + { "luaotfload-colors.lua", "f4e86b8cbbcc790a64dae59b6b05b3d1" }, + { "luaotfload-auxiliary.lua", "e814d7c408817ae01a96f279c278ed08" }, + { "luaotfload-filelist.lua", "1108447545fbcb08aa0f6d586988c2e1" }, + { "luaotfload-tool.lua", "4ca593bc9413e4de889f1c0df6e48219" }, + { "luaotfload-diagnostics.lua", "4fa11f02259f2f9e7cd60d4b668b6a33" }, + { "luaotfload-log.lua", "e1af43403d8bf68d95276c0dc00e64f0" }, + { "luaotfload-init.lua", "f80c78b2296664ba42514674d104d093" }, { "luaotfload-main.lua", "b19c9cc34cf1d676c39f872cfb41aef6" }, }, ["notes"]={ ["committer"]="Marcel Fabian Krüger <tex@2krueger.de>", - ["description"]="v3.17/2021-01-08", - ["loader"]="fontloader-2021-01-07.lua", - ["revision"]="359a8a50a0d1f778e358cc1507b6f08ec17b6898", - ["timestamp"]="2021-01-08 14:15:42 +0100", + ["description"]="v3.18/2021-05-21", + ["loader"]="fontloader-2021-05-20.lua", + ["revision"]="3f2cacb9d2136142cffb183774c0edaeb4ea3314", + ["timestamp"]="2021-05-21 02:12:47 +0200", }, }
\ No newline at end of file diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-suppress.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-suppress.lua index d78428ca962..8ea049ba916 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-suppress.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-suppress.lua @@ -5,8 +5,8 @@ assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") { name = "luaotfload-suppress", - version = "3.17", --TAGVERSION - date = "2021-01-08", --TAGDATE + version = "3.18", --TAGVERSION + date = "2021-05-21", --TAGDATE description = "luaotfload submodule / suppress", license = "GPL v2.0", author = "Marcel Krüger" diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-szss.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-szss.lua index 88b02350f08..26c89eafa26 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-szss.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-szss.lua @@ -5,8 +5,8 @@ assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") { name = "luaotfload-szss", - version = "3.17", --TAGVERSION - date = "2021-01-08", --TAGDATE + version = "3.18", --TAGVERSION + date = "2021-05-21", --TAGDATE description = "luaotfload submodule / Special feature handling", license = "GPL v2.0", author = "Marcel Krüger" @@ -90,6 +90,7 @@ otfregister { end tfmdata.extend = value * 1000 tfmdata.hb.hscale = tfmdata.units_per_em * value + tfmdata.hb.space = tfmdata.hb.space * value local parameters = tfmdata.parameters parameters.slant = parameters.slant * value parameters.space = parameters.space * value diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-tounicode.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-tounicode.lua index 5c927850667..928dfd30fc1 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-tounicode.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-tounicode.lua @@ -5,8 +5,8 @@ assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") { name = "luaotfload-tounicode", - version = "3.17", --TAGVERSION - date = "2021-01-08", --TAGDATE + version = "3.18", --TAGVERSION + date = "2021-05-21", --TAGDATE description = "luaotfload submodule / tounicode", license = "GPL v2.0", author = "Hans Hagen, Khaled Hosny, Elie Roux, Philipp Gesang, Marcel Krüger", diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-unicode.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-unicode.lua index 5320c48ab2d..ccc3988ba1d 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-unicode.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-unicode.lua @@ -5,8 +5,8 @@ assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") { name = "luaotfload-unicode", - version = "3.17", --TAGVERSION - date = "2021-01-08", --TAGDATE + version = "3.18", --TAGVERSION + date = "2021-05-21", --TAGDATE description = "luaotfload submodule / Unicode helpers", license = "CC0 1.0 Universal", author = "Marcel Krüger" diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua index 4a3cdb78aee..8d769d7dc8c 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua @@ -20,8 +20,8 @@ local authors = "\z -- version number is used below! local ProvidesLuaModule = { name = "luaotfload", - version = "3.17", --TAGVERSION - date = "2021-01-08", --TAGDATE + version = "3.18", --TAGVERSION + date = "2021-05-21", --TAGDATE description = "Lua based OpenType font support", author = authors, copyright = authors, diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.sty b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.sty index 915b418693a..20dc5ffb4fb 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.sty +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.sty @@ -39,7 +39,7 @@ \fi \ifdefined\ProvidesPackage \ProvidesPackage{luaotfload}% - [2021/01/08 v3.17 OpenType layout system] + [2021/05/21 v3.18 OpenType layout system] \fi \directlua{ if xpcall(function ()% |