summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luaotfload
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-08-14 20:52:07 +0000
committerKarl Berry <karl@freefriends.org>2019-08-14 20:52:07 +0000
commitbce9fed0de3adbb0f82fc4ac9171b618921fb14d (patch)
tree4a9dc14d7556dba48b12bf5c8b626aa4ebbc9157 /Master/texmf-dist/tex/luatex/luaotfload
parentcb9ce80d54602fd1ef6f8703980bc158a947fd8d (diff)
luaotfload (14aug19)
git-svn-id: svn://tug.org/texlive/trunk@51880 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luaotfload')
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/fontloader-2019-08-11.lua (renamed from Master/texmf-dist/tex/luatex/luaotfload/fontloader-2019-07-04.lua)276
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-cff.lua67
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-con.lua6
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-onr.lua3
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-otl.lua3
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-oto.lua15
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-otr.lua191
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ttf.lua10
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/fontloader-l-lua.lua6
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/fontloader-l-table.lua10
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/fontloader-reference.lua141
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/fontloader-util-str.lua27
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-auxiliary.lua171
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-colors.lua41
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-configuration.lua47
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-database.lua76
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-diagnostics.lua4
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-embolden.lua4
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-features.lua30
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-filelist.lua5
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-glyphlist.lua4
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-init.lua44
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-letterspace.lua4
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-loaders.lua27
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-log.lua4
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-main.lua36
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-notdef.lua4
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-parsers.lua36
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-resolvers.lua59
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-status.lua71
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-unicode.lua109
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload.sty2
32 files changed, 809 insertions, 724 deletions
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-2019-07-04.lua b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-2019-08-11.lua
index 0a4748abe6a..b4d3f3ce126 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-2019-07-04.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-2019-08-11.lua
@@ -1,6 +1,6 @@
--[[info-----------------------------------------------------------------------
Luaotfload fontloader package
- build 2019-07-14 15:41:55
+ build 2019-08-13 18:34:34
-------------------------------------------------------------------------------
© 2019 PRAGMA ADE / ConTeXt Development Team
@@ -62,7 +62,7 @@
--info]]-----------------------------------------------------------------------
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “data-con” 7ce546725b1550f655c78ac9d69419ca] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “data-con” 7ce546725b1550f655c78ac9d69419ca] ---
if not modules then modules={} end modules ['data-con']={
version=1.100,
@@ -174,10 +174,10 @@ function containers.cleanname(name)
return (gsub(lower(name),"[^%w\128-\255]+","-"))
end
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “data-con”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “data-con”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “basics-nod” 65064d03c2650a1761ee13ebd9e1400a] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “basics-nod” 65064d03c2650a1761ee13ebd9e1400a] ---
if not modules then modules={} end modules ['luatex-fonts-nod']={
version=1.001,
@@ -381,10 +381,10 @@ do
}
end
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “basics-nod”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “basics-nod”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “basics-chr” 58b7ef0c486e06090b362971b9f85e27] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “basics-chr” 58b7ef0c486e06090b362971b9f85e27] ---
characters=characters or {}
@@ -3994,10 +3994,10 @@ characters.indicgroups={
},
}
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “basics-chr”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “basics-chr”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “font-ini” 4299a02110bbd7c0d27e131235c5319d] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “font-ini” 4299a02110bbd7c0d27e131235c5319d] ---
if not modules then modules={} end modules ['font-ini']={
version=1.001,
@@ -4035,10 +4035,10 @@ fonts.privateoffsets={
keepnames=false,
}
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “font-ini”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “font-ini”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “fonts-mis” bc9eb43c27f63ce9d0fff67e104fe1c6] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “fonts-mis” bc9eb43c27f63ce9d0fff67e104fe1c6] ---
if not modules then modules={} end modules ['luatex-font-mis']={
version=1.001,
@@ -4070,10 +4070,10 @@ function font.each()
return table.sortedhash(fonts.hashes.identifiers)
end
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “fonts-mis”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “fonts-mis”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “font-con” f7d973760207e820b954a1e478a6a347] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “font-con” ca733211a0555d9a93b1e2f7ebc937d3] ---
if not modules then modules={} end modules ['font-con']={
version=1.001,
@@ -4839,13 +4839,13 @@ function constructors.finalize(tfmdata)
parameters.width=0
end
if not parameters.slantfactor then
- parameters.slantfactor=tfmdata.slant or 0
+ parameters.slantfactor=(tfmdata.slant or 0)/1000
end
if not parameters.extendfactor then
- parameters.extendfactor=tfmdata.extend or 0
+ parameters.extendfactor=(tfmdata.extend or 1000)/1000
end
if not parameters.squeezefactor then
- parameters.squeezefactor=tfmdata.squeeze or 0
+ parameters.squeezefactor=(tfmdata.squeeze or 1000)/1000
end
local designsize=parameters.designsize
if designsize then
@@ -5416,10 +5416,10 @@ function constructors.addcoreunicodes(unicodes)
return unicodes
end
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “font-con”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “font-con”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “fonts-enc” 3e71a54297e8f85a1ac438bb0f20dd79] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “fonts-enc” 3e71a54297e8f85a1ac438bb0f20dd79] ---
if not modules then modules={} end modules ['luatex-font-enc']={
version=1.001,
@@ -5488,10 +5488,10 @@ function encodings.load(filename)
return containers.write(encodings.cache,name,data)
end
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “fonts-enc”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “fonts-enc”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “font-cid” 4d87988efa86020a14708ee03c23415f] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “font-cid” 4d87988efa86020a14708ee03c23415f] ---
if not modules then modules={} end modules ['font-cid']={
version=1.001,
@@ -5642,10 +5642,10 @@ function cid.getmap(specification)
return found
end
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “font-cid”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “font-cid”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “font-map” f486746e90fe972de4b73e208ac7cbb2] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “font-map” f486746e90fe972de4b73e208ac7cbb2] ---
if not modules then modules={} end modules ['font-map']={
version=1.001,
@@ -6033,10 +6033,10 @@ function mappings.addtounicode(data,filename,checklookups,forceligatures)
end
end
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “font-map”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “font-map”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “font-vfc” 94937140f2c909e9c831ba021f1ab303] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “font-vfc” 94937140f2c909e9c831ba021f1ab303] ---
if not modules then modules={} end modules ['font-vfc']={
version=1.001,
@@ -6134,10 +6134,10 @@ helpers.commands=utilities.storage.allocate {
dummy=dummy,
}
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “font-vfc”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “font-vfc”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “font-otr” 340999eb6c53879787a7560bc1a30360] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “font-otr” b1c03925c949027c86f781785fa7a208] ---
if not modules then modules={} end modules ['font-otr']={
version=1.001,
@@ -6159,8 +6159,9 @@ local sortedhash=table.sortedhash
local stripstring=string.nospaces
local utf16_to_utf8_be=utf.utf16_to_utf8_be
local report=logs.reporter("otf reader")
-local trace_cmap=false
-local trace_cmap_detail=false
+local report_cmap=logs.reporter("otf reader","cmap")
+local trace_cmap=false trackers.register("otf.cmap",function(v) trace_cmap=v end)
+local trace_cmap_details=false trackers.register("otf.cmap.details",function(v) trace_cmap_details=v end)
fonts=fonts or {}
local handlers=fonts.handlers or {}
fonts.handlers=handlers
@@ -6822,15 +6823,18 @@ readers.vmtx=function(f,fontdata,specification)
local glyphs=fontdata.glyphs
local nofglyphs=fontdata.nofglyphs
local vheight=0
- local vdefault=verticalheader.ascender+verticalheader.descender
+ local vdefault=verticalheader.ascender-verticalheader.descender
local topsidebearing=0
for i=0,nofmetrics-1 do
local glyph=glyphs[i]
- vheight=readshort(f)
+ vheight=readushort(f)
topsidebearing=readshort(f)
if vheight~=0 and vheight~=vdefault then
glyph.vheight=vheight
end
+ if topsidebearing~=0 then
+ glyph.tsb=topsidebearing
+ end
end
for i=nofmetrics,nofglyphs-1 do
local glyph=glyphs[i]
@@ -6908,11 +6912,14 @@ local sequence={
{ 3,1,4 },
{ 3,10,12 },
{ 0,3,4 },
+ { 0,3,12 },
{ 0,1,4 },
+ { 0,1,12 },
{ 0,0,6 },
{ 3,0,6 },
+ { 3,0,4 },
{ 0,5,14 },
-{ 0,4,12 },
+ { 0,4,12 },
{ 3,10,13 },
}
local supported={}
@@ -6957,7 +6964,7 @@ formatreaders[4]=function(f,fontdata,offset)
elseif startchar==0xFFFF and offset==0 then
elseif offset==0xFFFF then
elseif offset==0 then
- if trace_cmap_detail then
+ if trace_cmap_details then
report("format 4.%i segment %2i from %C upto %C at index %H",1,segment,startchar,endchar,(startchar+delta)%65536)
end
for unicode=startchar,endchar do
@@ -6989,8 +6996,8 @@ formatreaders[4]=function(f,fontdata,offset)
end
else
local shift=(segment-nofsegments+offset/2)-startchar
- if trace_cmap_detail then
- report("format 4.%i segment %2i from %C upto %C at index %H",0,segment,startchar,endchar,(startchar+delta)%65536)
+ if trace_cmap_details then
+ report_cmap("format 4.%i segment %2i from %C upto %C at index %H",0,segment,startchar,endchar,(startchar+delta)%65536)
end
for unicode=startchar,endchar do
local slot=shift+unicode
@@ -7037,8 +7044,8 @@ formatreaders[6]=function(f,fontdata,offset)
local count=readushort(f)
local stop=start+count-1
local nofdone=0
- if trace_cmap_detail then
- report("format 6 from %C to %C",2,start,stop)
+ if trace_cmap_details then
+ report_cmap("format 6 from %C to %C",2,start,stop)
end
for unicode=start,stop do
local index=readushort(f)
@@ -7070,8 +7077,8 @@ formatreaders[12]=function(f,fontdata,offset)
local first=readulong(f)
local last=readulong(f)
local index=readulong(f)
- if trace_cmap_detail then
- report("format 12 from %C to %C starts at index %i",first,last,index)
+ if trace_cmap_details then
+ report_cmap("format 12 from %C to %C starts at index %i",first,last,index)
end
for unicode=first,last do
local glyph=glyphs[index]
@@ -7109,8 +7116,8 @@ formatreaders[13]=function(f,fontdata,offset)
local last=readulong(f)
local index=readulong(f)
if first<privateoffset then
- if trace_cmap_detail then
- report("format 13 from %C to %C get index %i",first,last,index)
+ if trace_cmap_details then
+ report_cmap("format 13 from %C to %C get index %i",first,last,index)
end
local glyph=glyphs[index]
local unicode=glyph.unicode
@@ -7180,27 +7187,46 @@ formatreaders[14]=function(f,fontdata,offset)
end
end
local function checkcmap(f,fontdata,records,platform,encoding,format)
- local data=records[platform]
- if not data then
+ local pdata=records[platform]
+ if not pdata then
+ if trace_cmap_details then
+ report_cmap("skipped, %s, p=%i e=%i f=%i","no platform",platform,encoding,format)
+ end
return 0
end
- data=data[encoding]
- if not data then
+ local edata=pdata[encoding]
+ if not edata then
+ if trace_cmap_details then
+ report_cmap("skipped, %s, p=%i e=%i f=%i","no encoding",platform,encoding,format)
+ end
return 0
end
- data=data[format]
- if not data then
+ local fdata=edata[format]
+ if not fdata then
+ if trace_cmap_details then
+ report_cmap("skipped, %s, p=%i e=%i f=%i","no format",platform,encoding,format)
+ end
+ return 0
+ elseif type(fdata)~="number" then
+ if trace_cmap_details then
+ report_cmap("skipped, %s, p=%i e=%i f=%i","already done",platform,encoding,format)
+ end
return 0
end
+ edata[format]=true
local reader=formatreaders[format]
if not reader then
+ if trace_cmap_details then
+ report_cmap("skipped, %s, p=%i e=%i f=%i","unsupported format",platform,encoding,format)
+ end
return 0
end
- local p=platforms[platform]
- local e=encodings[p]
- local n=reader(f,fontdata,data) or 0
- if trace_cmap then
- report("cmap checked: platform %i (%s), encoding %i (%s), format %i, new unicodes %i",platform,p,encoding,e and e[encoding] or "?",format,n)
+ local n=reader(f,fontdata,fdata) or 0
+ if trace_cmap_details or trace_cmap then
+ local p=platforms[platform]
+ local e=encodings[p]
+ report_cmap("checked, platform %i (%s), encoding %i (%s), format %i, new unicodes %i",
+ platform,p,encoding,e and e[encoding] or "?",format,n)
end
return n
end
@@ -7395,6 +7421,7 @@ local function getinfo(maindata,sub,platformnames,rawfamilynames,metricstoo,inst
local postscript=fontdata.postscript or {}
local fontheader=fontdata.fontheader or {}
local cffinfo=fontdata.cffinfo or {}
+ local verticalheader=fontdata.verticalheader or {}
local filename=fontdata.filename
local weight=getname(fontdata,"weight") or (cffinfo and cffinfo.weight) or (metrics and metrics.weight)
local width=getname(fontdata,"width") or (cffinfo and cffinfo.width ) or (metrics and metrics.width )
@@ -7460,6 +7487,7 @@ local function getinfo(maindata,sub,platformnames,rawfamilynames,metricstoo,inst
platformnames=platformnames or nil,
instancenames=instancenames or nil,
tableoffsets=fontdata.tableoffsets,
+ defaultvheight=(verticalheader.ascender or 0)-(verticalheader.descender or 0)
}
if metricstoo then
local keys={
@@ -7959,10 +7987,10 @@ function readers.extend(fontdata)
end
end
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “font-otr”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “font-otr”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “font-oti” dbae7722baae24d917a17176553825cf] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “font-oti” dbae7722baae24d917a17176553825cf] ---
if not modules then modules={} end modules ['font-oti']={
version=1.001,
@@ -8105,10 +8133,10 @@ function otffeatures.checkeddefaultlanguage(featuretype,autolanguage,languages)
end
end
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “font-oti”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “font-oti”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “font-ott” aba6d8335a5f38a5a62d3631492f3392] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “font-ott” aba6d8335a5f38a5a62d3631492f3392] ---
if not modules then modules={} end modules ["font-ott"]={
version=1.001,
@@ -9227,10 +9255,10 @@ function otffeatures.normalize(features,wrap)
end
end
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “font-ott”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “font-ott”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “font-cff” 7ff1a757f6a26f57f635014cc8a174fe] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “font-cff” 98d5a660ea803b65cb883c009ecf3c0b] ---
if not modules then modules={} end modules ['font-cff']={
version=1.001,
@@ -10571,7 +10599,7 @@ do
local function call(scope,list,bias)
depth=depth+1
if top==0 then
- showstate(formatters["unknown %s call"](scope))
+ showstate(formatters["unknown %s call %s"](scope,"?"))
top=0
else
local index=stack[top]+bias
@@ -10583,7 +10611,7 @@ do
if tab then
process(tab)
else
- showstate(formatters["unknown %s call %i"](scope,index))
+ showstate(formatters["unknown %s call %s"](scope,index))
top=0
end
end
@@ -10653,7 +10681,7 @@ do
i=i+1
local t=tab[i]
if justpass then
- if t>=34 or t<=37 then
+ if t>=34 and t<=37 then
for i=1,top do
r=r+1;result[r]=encode[stack[i]]
end
@@ -10755,12 +10783,16 @@ end
end
end
end
- local function setbias(globals,locals)
+ local function setbias(globals,locals,nobias)
+ if nobias then
+ return 0,0
+ else
local g=#globals
local l=#locals
return
((g<1240 and 107) or (g<33900 and 1131) or 32768)+1,
((l<1240 and 107) or (l<33900 and 1131) or 32768)+1
+ end
end
local function processshape(tab,index)
if not tab then
@@ -10870,7 +10902,7 @@ end
end
return privatedata.nominalwidthx or 0,privatedata.defaultwidthx or 0
end
- parsecharstrings=function(fontdata,data,glphs,doshapes,tversion,streams)
+ parsecharstrings=function(fontdata,data,glphs,doshapes,tversion,streams,nobias)
local dictionary=data.dictionaries[1]
local charstrings=dictionary.charstrings
keepcurve=doshapes
@@ -10881,7 +10913,7 @@ end
charset=dictionary.charset
vsindex=dictionary.vsindex or 0
glyphs=glphs or {}
- globalbias,localbias=setbias(globals,locals)
+ globalbias,localbias=setbias(globals,locals,nobias)
nominalwidth,defaultwidth=setwidths(dictionary.private)
if charstrings then
startparsing(fontdata,data,streams)
@@ -10903,8 +10935,8 @@ end
charset=false
vsindex=dictionary.vsindex or 0
glyphs=glphs or {}
- justpass=streams==true
- globalbias,localbias=setbias(globals,locals)
+ justpass=streams==true
+ globalbias,localbias=setbias(globals,locals,nobias)
nominalwidth,defaultwidth=setwidths(dictionary.private)
processshape(tab,index-1)
end
@@ -11250,10 +11282,10 @@ function readers.cffcheck(filename)
end
end
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “font-cff”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “font-cff”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “font-ttf” f2d53377b264d59368703e659a7bc228] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “font-ttf” 44e61cef50dab9b1aaf48130f9367c34] ---
if not modules then modules={} end modules ['font-ttf']={
version=1.001,
@@ -11876,7 +11908,14 @@ local function repackpoints(glyphs,shapes)
currentx=px
currenty=py
if lastflag==fl then
- nofflags=nofflags+1
+ if nofflags==255 then
+ lastflag=lastflag+0x08
+ r=r+1 result[r]=char(lastflag,nofflags-1)
+ nofflags=1
+ lastflag=fl
+ else
+ nofflags=nofflags+1
+ end
else
if nofflags==1 then
r=r+1 result[r]=chars[lastflag]
@@ -12416,10 +12455,10 @@ function readers.gvar(f,fontdata,specification,glyphdata,shapedata)
end
end
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “font-ttf”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “font-ttf”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “font-dsp” b5bf2f1c198e027a0d4ededcdf3947b4] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “font-dsp” b5bf2f1c198e027a0d4ededcdf3947b4] ---
if not modules then modules={} end modules ['font-dsp']={
version=1.001,
@@ -15660,10 +15699,10 @@ function readers.mvar(f,fontdata,specification)
end
end
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “font-dsp”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “font-dsp”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “font-oup” 669e479e716999edc626a1f045bd76fa] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “font-oup” 669e479e716999edc626a1f045bd76fa] ---
if not modules then modules={} end modules ['font-oup']={
version=1.001,
@@ -18300,10 +18339,10 @@ function readers.expand(data)
expandlookups(sublookups)
end
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “font-oup”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “font-oup”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “font-otl” b041e8512af19d28edbbebc683f7cd51] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “font-otl” 940f9c5ad84f4968a8488f4da2d15e2d] ---
if not modules then modules={} end modules ['font-otl']={
version=1.001,
@@ -18331,7 +18370,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.108
+otf.version=3.109
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)
@@ -18693,6 +18732,7 @@ local function copytotfm(data,cache_id)
parameters.ascender=abs(metadata.ascender or 0)
parameters.descender=abs(metadata.descender or 0)
parameters.units=units
+ parameters.vheight=metadata.defaultvheight
properties.space=spacer
properties.encodingbytes=2
properties.format=data.format or formats.otf
@@ -19005,10 +19045,10 @@ otf.coverup={
end
}
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “font-otl”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “font-otl”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “font-oto” 54ea5c823993e536950b2245e94aee93] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “font-oto” 52804afd96f4be005f513a012b874668] ---
if not modules then modules={} end modules ['font-oto']={
version=1.001,
@@ -19466,10 +19506,10 @@ registerotffeature {
}
otf.basemodeinitializer=featuresinitializer
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “font-oto”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “font-oto”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “font-otj” 66c7a910d95d4a52b81061de776898e1] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “font-otj” 66c7a910d95d4a52b81061de776898e1] ---
if not modules then modules={} end modules ['font-otj']={
version=1.001,
@@ -20926,10 +20966,10 @@ function injections.handler(head,where)
end
end
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “font-otj”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “font-otj”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “font-ota” d6dfb94563d6a52675e274b2e673e4a6] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “font-ota” d6dfb94563d6a52675e274b2e673e4a6] ---
if not modules then modules={} end modules ['font-ota']={
version=1.001,
@@ -21306,10 +21346,10 @@ directives.register("otf.analyze.useunicodemarks",function(v)
analyzers.useunicodemarks=v
end)
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “font-ota”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “font-ota”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “font-ots” d5504847a278385cd0d20ecf1b3d59cc] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “font-ots” d5504847a278385cd0d20ecf1b3d59cc] ---
if not modules then modules={} end modules ['font-ots']={
version=1.001,
@@ -24923,10 +24963,10 @@ registerotffeature {
},
}
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “font-ots”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “font-ots”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “font-osd” 79eb2fc4a71364fd73c8b996a109f5df] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “font-osd” 79eb2fc4a71364fd73c8b996a109f5df] ---
if not modules then modules={} end modules ['font-osd']={
version=1.001,
@@ -27358,10 +27398,10 @@ for i=1,nofscripts do
methods[scripts_two[i]]=method_two
end
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “font-osd”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “font-osd”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “font-ocl” b720867fb19a23f0b50377efd2a3c54a] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “font-ocl” b720867fb19a23f0b50377efd2a3c54a] ---
if not modules then modules={} end modules ['font-ocl']={
version=1.001,
@@ -27844,10 +27884,10 @@ fonts.handlers.otf.features.register {
}
}
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “font-ocl”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “font-ocl”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “font-otc” 95a4ff28ba4afb55a978a4aecfd688bf] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “font-otc” 95a4ff28ba4afb55a978a4aecfd688bf] ---
if not modules then modules={} end modules ['font-otc']={
version=1.001,
@@ -28597,10 +28637,10 @@ end
otf.enhancers.enhance=enhance
otf.enhancers.register("check extra features",enhance)
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “font-otc”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “font-otc”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “font-onr” 20b0d2753f58ff91180947ce4078571e] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “font-onr” d4d2449b4084e6afb1837ae5835082cc] ---
if not modules then modules={} end modules ['font-onr']={
version=1.001,
@@ -28765,7 +28805,7 @@ do
}
},
}
- fonts.handlers.otf.readers.parsecharstrings(false,data,glyphs,true,"cff",streams)
+ fonts.handlers.otf.readers.parsecharstrings(false,data,glyphs,true,"cff",streams,true)
else
lpegmatch(p_filternames,binary,1,filename)
end
@@ -28972,10 +29012,10 @@ function readers.getinfo(filename)
end
end
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “font-onr”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “font-onr”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “font-one” 987c5c5ed3754ad2feab80985067d59e] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “font-one” 987c5c5ed3754ad2feab80985067d59e] ---
if not modules then modules={} end modules ['font-one']={
version=1.001,
@@ -29686,10 +29726,10 @@ registerafmenhancer("normalize features",enhance_normalize_features)
registerafmenhancer("check extra features",otfenhancers.enhance)
registerafmenhancer("fix names",enhance_fix_names)
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “font-one”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “font-one”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “font-afk” 54d554530e75c57c56ee76234724e26d] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “font-afk” 54d554530e75c57c56ee76234724e26d] ---
if not modules then modules={} end modules ['font-afk']={
version=1.001,
@@ -29856,10 +29896,10 @@ fonts.handlers.afm.helpdata={
}
}
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “font-afk”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “font-afk”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “fonts-tfm” 3bbba3214fd0b8c6f35ad85592fc2917] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “fonts-tfm” 3bbba3214fd0b8c6f35ad85592fc2917] ---
if not modules then modules={} end modules ['luatex-fonts-tfm']={
version=1.001,
@@ -30374,10 +30414,10 @@ registertfmfeature {
}
}
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “fonts-tfm”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “fonts-tfm”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “font-lua” 55b281fb98f7bd848fc19928f376f647] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “font-lua” 55b281fb98f7bd848fc19928f376f647] ---
if not modules then modules={} end modules ['font-lua']={
version=1.001,
@@ -30417,10 +30457,10 @@ function readers.lua(specification)
return check_lua(specification,fullname)
end
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “font-lua”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “font-lua”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “font-def” f66c365dae4499f982d8bf16e5d37de3] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “font-def” f66c365dae4499f982d8bf16e5d37de3] ---
if not modules then modules={} end modules ['font-def']={
version=1.001,
@@ -30822,10 +30862,10 @@ function font.getfont(id)
end
callbacks.register('define_font',definers.read,"definition of fonts (tfmdata preparation)")
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “font-def”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “font-def”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “fonts-def” 5ad79120ebc5e60f4d322fb3ee13bffe] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “fonts-def” 5ad79120ebc5e60f4d322fb3ee13bffe] ---
if not modules then modules={} end modules ['luatex-fonts-def']={
version=1.001,
@@ -30906,10 +30946,10 @@ function fonts.definers.applypostprocessors(tfmdata)
return tfmdata
end
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “fonts-def”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “fonts-def”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “fonts-ext” 01015ab3758cdc2af29394e6d502a91a] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “fonts-ext” 01015ab3758cdc2af29394e6d502a91a] ---
if not modules then modules={} end modules ['luatex-fonts-ext']={
version=1.001,
@@ -31095,10 +31135,10 @@ registerotffeature {
}
}
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “fonts-ext”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “fonts-ext”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “font-imp-tex” 77c374b0ef00c2fb12188ec42beb4257] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “font-imp-tex” 77c374b0ef00c2fb12188ec42beb4257] ---
if not modules then modules={} end modules ['font-imp-tex']={
version=1.001,
@@ -31197,10 +31237,10 @@ registerotffeature {
description="arabic digits",
}
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “font-imp-tex”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “font-imp-tex”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “font-imp-ligatures” 043daa4fcccf2560868da359d71d3a4a] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “font-imp-ligatures” 043daa4fcccf2560868da359d71d3a4a] ---
if not modules then modules={} end modules ['font-imp-ligatures']={
version=1.001,
@@ -31314,10 +31354,10 @@ if context then
}
end
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “font-imp-ligatures”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “font-imp-ligatures”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “font-imp-italics” fe1ca80fb5ea4a2f8d2d5c484e7ba913] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “font-imp-italics” fe1ca80fb5ea4a2f8d2d5c484e7ba913] ---
if not modules then modules={} end modules ['font-imp-italics']={
version=1.001,
@@ -31423,10 +31463,10 @@ if context then
registerafmfeature(dimensions_specification)
end
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “font-imp-italics”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “font-imp-italics”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “font-imp-effects” 73a660359a0ec71e44cc2b7225a715ac] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “font-imp-effects” 73a660359a0ec71e44cc2b7225a715ac] ---
if not modules then modules={} end modules ['font-imp-effects']={
version=1.001,
@@ -31783,10 +31823,10 @@ local specification={
registerotffeature(specification)
registerafmfeature(specification)
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “font-imp-effects”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “font-imp-effects”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “fonts-lig” b9dbe77ce747d4c35bb2a20ffbe5aa51] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “fonts-lig” b9dbe77ce747d4c35bb2a20ffbe5aa51] ---
fonts.handlers.otf.addfeature {
@@ -33855,10 +33895,10 @@ fonts.handlers.otf.addfeature {
["type"]="ligature",
}
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “fonts-lig”] ---
+end --- [luaotfload, fontloader-2019-08-13.lua scope for “fonts-lig”] ---
-do --- [luaotfload, fontloader-2019-07-14.lua scope for “fonts-gbn” d25472d54c4841db43a745764a63533e] ---
+do --- [luaotfload, fontloader-2019-08-13.lua scope for “fonts-gbn” d25472d54c4841db43a745764a63533e] ---
if not modules then modules={} end modules ['luatex-fonts-gbn']={
version=1.001,
@@ -34123,7 +34163,7 @@ function nodes.simple_font_handler(head,groupcode,size,packtype,direction)
return head
end
-end --- [luaotfload, fontloader-2019-07-14.lua scope for “fonts-gbn”] ---
+end --- [luaotfload, fontloader-2019-08-13.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-font-cff.lua b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-cff.lua
index 86ae448cc22..a19acc1a1dc 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-cff.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-cff.lua
@@ -1012,43 +1012,6 @@ do
top = 0
end
--- local function xxcurveto(swap)
--- local last = top % 4 ~= 0 and stack[top]
--- if last then
--- top = top - 1
--- end
--- for i=1,top,4 do
--- local ax, ay, bx, by
--- if swap then
--- ax = x + stack[i]
--- ay = y
--- bx = ax + stack[i+1]
--- by = ay + stack[i+2]
--- y = by + stack[i+3]
--- if last and i+3 == top then
--- x = bx + last
--- else
--- x = bx
--- end
--- swap = false
--- else
--- ax = x
--- ay = y + stack[i]
--- bx = ax + stack[i+1]
--- by = ay + stack[i+2]
--- x = bx + stack[i+3]
--- if last and i+3 == top then
--- y = by + last
--- else
--- y = by
--- end
--- swap = true
--- end
--- xycurveto(ax,ay,bx,by,x,y)
--- end
--- top = 0
--- end
-
local function xxcurveto(swap)
local last = top % 4 ~= 0 and stack[top]
if last then
@@ -1086,7 +1049,6 @@ do
top = 0
end
-
local function hvcurveto()
if trace_charstrings then
showstate("hvcurveto")
@@ -1663,7 +1625,7 @@ do
local function call(scope,list,bias) -- ,process)
depth = depth + 1
if top == 0 then
- showstate(formatters["unknown %s call"](scope))
+ showstate(formatters["unknown %s call %s"](scope,"?"))
top = 0
else
local index = stack[top] + bias
@@ -1675,7 +1637,7 @@ do
if tab then
process(tab)
else
- showstate(formatters["unknown %s call %i"](scope,index))
+ showstate(formatters["unknown %s call %s"](scope,index))
top = 0
end
end
@@ -1796,7 +1758,7 @@ do
i = i + 1
local t = tab[i]
if justpass then
- if t >= 34 or t <= 37 then -- flexes
+ if t >= 34 and t <= 37 then -- flexes
for i=1,top do
r = r + 1 ; result[r] = encode[stack[i]]
end
@@ -1941,21 +1903,16 @@ end
-- end
-- end
- local function setbias(globals,locals)
--- if version == 1 then -- charstring version, not cff
--- return
--- 0,
--- 0
--- return
--- 1,
--- 1
--- else
+ local function setbias(globals,locals,nobias)
+ if nobias then
+ return 0, 0
+ else
local g = #globals
local l = #locals
return
((g < 1240 and 107) or (g < 33900 and 1131) or 32768) + 1,
((l < 1240 and 107) or (l < 33900 and 1131) or 32768) + 1
--- end
+ end
end
local function processshape(tab,index)
@@ -2086,7 +2043,7 @@ end
return privatedata.nominalwidthx or 0, privatedata.defaultwidthx or 0
end
- parsecharstrings = function(fontdata,data,glphs,doshapes,tversion,streams)
+ parsecharstrings = function(fontdata,data,glphs,doshapes,tversion,streams,nobias)
local dictionary = data.dictionaries[1]
local charstrings = dictionary.charstrings
@@ -2100,7 +2057,7 @@ end
vsindex = dictionary.vsindex or 0
glyphs = glphs or { }
- globalbias, localbias = setbias(globals,locals)
+ globalbias, localbias = setbias(globals,locals,nobias)
nominalwidth, defaultwidth = setwidths(dictionary.private)
if charstrings then
@@ -2127,9 +2084,9 @@ end
vsindex = dictionary.vsindex or 0
glyphs = glphs or { }
- justpass = streams == true
+ justpass = streams == true
- globalbias, localbias = setbias(globals,locals)
+ globalbias, localbias = setbias(globals,locals,nobias)
nominalwidth, defaultwidth = setwidths(dictionary.private)
processshape(tab,index-1)
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-con.lua b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-con.lua
index 9def52ef02c..9c1e825fa2e 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-con.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-con.lua
@@ -982,15 +982,15 @@ function constructors.finalize(tfmdata)
end
--
if not parameters.slantfactor then
- parameters.slantfactor = tfmdata.slant or 0
+ parameters.slantfactor = (tfmdata.slant or 0)/1000
end
--
if not parameters.extendfactor then
- parameters.extendfactor = tfmdata.extend or 0
+ parameters.extendfactor = (tfmdata.extend or 1000)/1000
end
--
if not parameters.squeezefactor then
- parameters.squeezefactor = tfmdata.squeeze or 0
+ parameters.squeezefactor = (tfmdata.squeeze or 1000)/1000
end
--
local designsize = parameters.designsize
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-onr.lua b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-onr.lua
index 8523d8729ab..188aaf6449b 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-onr.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-onr.lua
@@ -235,7 +235,6 @@ do
binary = decrypt(binary,55665,4)
local names = { }
-
local encoding = lpegmatch(p_filterencoding,ascii)
local metadata = lpegmatch(p_filtermetadata,ascii,1,{})
local glyphs = { }
@@ -255,7 +254,7 @@ do
},
}
-- only cff 1 in type 1 fonts
- fonts.handlers.otf.readers.parsecharstrings(false,data,glyphs,true,"cff",streams)
+ fonts.handlers.otf.readers.parsecharstrings(false,data,glyphs,true,"cff",streams,true)
else
lpegmatch(p_filternames,binary,1,filename)
end
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 bba7bcb64a4..f8cd8217cd7 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.108 -- beware: also sync font-mis.lua and in mtx-fonts
+otf.version = 3.109 -- 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)
@@ -491,6 +491,7 @@ local function copytotfm(data,cache_id)
parameters.ascender = abs(metadata.ascender or 0)
parameters.descender = abs(metadata.descender or 0)
parameters.units = units
+ parameters.vheight = metadata.defaultvheight
--
properties.space = spacer
properties.encodingbytes = 2
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-oto.lua b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-oto.lua
index 6f6d89d434a..4d112ac3160 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-oto.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-oto.lua
@@ -11,14 +11,13 @@ local insert, remove = table.insert, table.remove
local format, gmatch, gsub, find, match, lower, strip = string.format, string.gmatch, string.gsub, string.find, string.match, string.lower, string.strip
local type, next, tonumber, tostring, rawget = type, next, tonumber, tostring, rawget
-local trace_baseinit = false trackers.register("otf.baseinit", function(v) trace_baseinit = v end)
-local trace_singles = false trackers.register("otf.singles", function(v) trace_singles = v end)
-local trace_multiples = false trackers.register("otf.multiples", function(v) trace_multiples = v end)
-local trace_alternatives = false trackers.register("otf.alternatives", function(v) trace_alternatives = v end)
-local trace_ligatures = false trackers.register("otf.ligatures", function(v) trace_ligatures = v end)
------ trace_ligatures_detail = false trackers.register("otf.ligatures.detail", function(v) trace_ligatures_detail = v end)
-local trace_kerns = false trackers.register("otf.kerns", function(v) trace_kerns = v end)
-local trace_preparing = false trackers.register("otf.preparing", function(v) trace_preparing = v end)
+local trace_baseinit = false trackers.register("otf.baseinit", function(v) trace_baseinit = v end)
+local trace_singles = false trackers.register("otf.singles", function(v) trace_singles = v end)
+local trace_multiples = false trackers.register("otf.multiples", function(v) trace_multiples = v end)
+local trace_alternatives = false trackers.register("otf.alternatives", function(v) trace_alternatives = v end)
+local trace_ligatures = false trackers.register("otf.ligatures", function(v) trace_ligatures = v end)
+local trace_kerns = false trackers.register("otf.kerns", function(v) trace_kerns = v end)
+local trace_preparing = false trackers.register("otf.preparing", function(v) trace_preparing = v end)
local report_prepare = logs.reporter("fonts","otf prepare")
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 4ac73769720..4fe0a6a9765 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-otr.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-otr.lua
@@ -73,56 +73,54 @@ local P, R, S, C, Cs, Cc, Ct, Carg, Cmt = lpeg.P, lpeg.R, lpeg.S, lpeg.C, lpeg.C
local lpegmatch = lpeg.match
local rshift = bit32.rshift
-local setmetatableindex = table.setmetatableindex
-local sortedkeys = table.sortedkeys
-local sortedhash = table.sortedhash
-local stripstring = string.nospaces
-local utf16_to_utf8_be = utf.utf16_to_utf8_be
-
-local report = logs.reporter("otf reader")
-
-local trace_cmap = false -- only for checking issues
-local trace_cmap_detail = false -- only for checking issues
-
--- local trace_cmap = true
--- local trace_cmap_detail = true
-
-fonts = fonts or { }
-local handlers = fonts.handlers or { }
-fonts.handlers = handlers
-local otf = handlers.otf or { }
-handlers.otf = otf
-local readers = otf.readers or { }
-otf.readers = readers
-
------ streamreader = utilities.streams -- faster on big files (not true any longer)
-local streamreader = utilities.files -- faster on identify (also uses less memory)
-local streamwriter = utilities.files
-
-readers.streamreader = streamreader
-readers.streamwriter = streamwriter
-
-local openfile = streamreader.open
-local closefile = streamreader.close
------ skipbytes = streamreader.skip
-local setposition = streamreader.setposition
-local skipshort = streamreader.skipshort
-local readbytes = streamreader.readbytes
-local readstring = streamreader.readstring
-local readbyte = streamreader.readcardinal1 -- 8-bit unsigned integer
-local readushort = streamreader.readcardinal2 -- 16-bit unsigned integer
-local readuint = streamreader.readcardinal3 -- 24-bit unsigned integer
-local readulong = streamreader.readcardinal4 -- 32-bit unsigned integer
------ readchar = streamreader.readinteger1 -- 8-bit signed integer
-local readshort = streamreader.readinteger2 -- 16-bit signed integer
-local readlong = streamreader.readinteger4 -- 32-bit unsigned integer
-local readfixed = streamreader.readfixed4
-local read2dot14 = streamreader.read2dot14 -- 16-bit signed fixed number with the low 14 bits of fraction (2.14) (F2DOT14)
-local readfword = readshort -- 16-bit signed integer that describes a quantity in FUnits
-local readufword = readushort -- 16-bit unsigned integer that describes a quantity in FUnits
-local readoffset = readushort
-local readcardinaltable = streamreader.readcardinaltable
-local readintegertable = streamreader.readintegertable
+local setmetatableindex = table.setmetatableindex
+local sortedkeys = table.sortedkeys
+local sortedhash = table.sortedhash
+local stripstring = string.nospaces
+local utf16_to_utf8_be = utf.utf16_to_utf8_be
+
+local report = logs.reporter("otf reader")
+local report_cmap = logs.reporter("otf reader","cmap")
+
+local trace_cmap = false trackers.register("otf.cmap", function(v) trace_cmap = v end)
+local trace_cmap_details = false trackers.register("otf.cmap.details", function(v) trace_cmap_details = v end)
+
+fonts = fonts or { }
+local handlers = fonts.handlers or { }
+fonts.handlers = handlers
+local otf = handlers.otf or { }
+handlers.otf = otf
+local readers = otf.readers or { }
+otf.readers = readers
+
+----- streamreader = utilities.streams -- faster on big files (not true any longer)
+local streamreader = utilities.files -- faster on identify (also uses less memory)
+local streamwriter = utilities.files
+
+readers.streamreader = streamreader
+readers.streamwriter = streamwriter
+
+local openfile = streamreader.open
+local closefile = streamreader.close
+----- skipbytes = streamreader.skip
+local setposition = streamreader.setposition
+local skipshort = streamreader.skipshort
+local readbytes = streamreader.readbytes
+local readstring = streamreader.readstring
+local readbyte = streamreader.readcardinal1 -- 8-bit unsigned integer
+local readushort = streamreader.readcardinal2 -- 16-bit unsigned integer
+local readuint = streamreader.readcardinal3 -- 24-bit unsigned integer
+local readulong = streamreader.readcardinal4 -- 32-bit unsigned integer
+----- readchar = streamreader.readinteger1 -- 8-bit signed integer
+local readshort = streamreader.readinteger2 -- 16-bit signed integer
+local readlong = streamreader.readinteger4 -- 32-bit unsigned integer
+local readfixed = streamreader.readfixed4
+local read2dot14 = streamreader.read2dot14 -- 16-bit signed fixed number with the low 14 bits of fraction (2.14) (F2DOT14)
+local readfword = readshort -- 16-bit signed integer that describes a quantity in FUnits
+local readufword = readushort -- 16-bit unsigned integer that describes a quantity in FUnits
+local readoffset = readushort
+local readcardinaltable = streamreader.readcardinaltable
+local readintegertable = streamreader.readintegertable
function streamreader.readtag(f)
return lower(stripstring(readstring(f,4)))
@@ -1213,18 +1211,18 @@ readers.vmtx = function(f,fontdata,specification)
local glyphs = fontdata.glyphs
local nofglyphs = fontdata.nofglyphs
local vheight = 0
- local vdefault = verticalheader.ascender + verticalheader.descender
+ local vdefault = verticalheader.ascender - verticalheader.descender
local topsidebearing = 0
for i=0,nofmetrics-1 do
local glyph = glyphs[i]
- vheight = readshort(f)
+ vheight = readushort(f)
topsidebearing = readshort(f)
if vheight ~= 0 and vheight ~= vdefault then
glyph.vheight = vheight
end
- -- if topsidebearing ~= 0 then
- -- glyph.tsb = topsidebearing
- -- end
+ if topsidebearing ~= 0 then
+ glyph.tsb = topsidebearing
+ end
end
-- The next can happen in for instance a monospace font or in a cjk font
-- with fixed heights.
@@ -1233,9 +1231,6 @@ readers.vmtx = function(f,fontdata,specification)
if vheight ~= 0 and vheight ~= vdefault then
glyph.vheight = vheight
end
- -- if topsidebearing ~= 0 then
- -- glyph.tsb = topsidebearing
- -- end
end
end
end
@@ -1320,32 +1315,23 @@ local formatreaders = { }
local duplicatestoo = true
local sequence = {
+ -- these is some provision against redundant loading
{ 3, 1, 4 },
{ 3, 10, 12 },
{ 0, 3, 4 },
+ { 0, 3, 12 },
{ 0, 1, 4 },
- -- { 0, 4, 12 },
+ { 0, 1, 12 }, -- for some old mac fonts
{ 0, 0, 6 },
{ 3, 0, 6 },
+ { 3, 0, 4 }, -- for (likely) old crap
-- variants
{ 0, 5, 14 },
-- last resort ranges
-{ 0, 4, 12 },
+ { 0, 4, 12 },
{ 3, 10, 13 },
}
--- local sequence = {
--- { 0, 1, 4 },
--- { 0, 4, 12 },
--- { 0, 3, 4 },
--- { 3, 1, 4 },
--- { 3, 10, 12 },
--- { 0, 0, 6 },
--- { 3, 0, 6 },
--- -- variants
--- { 0, 5, 14 },
--- }
-
local supported = { }
for i=1,#sequence do
@@ -1398,7 +1384,7 @@ formatreaders[4] = function(f,fontdata,offset)
elseif offset == 0xFFFF then
-- bad encoding
elseif offset == 0 then
- if trace_cmap_detail then
+ if trace_cmap_details then
report("format 4.%i segment %2i from %C upto %C at index %H",1,segment,startchar,endchar,(startchar + delta) % 65536)
end
for unicode=startchar,endchar do
@@ -1431,8 +1417,8 @@ formatreaders[4] = function(f,fontdata,offset)
end
else
local shift = (segment-nofsegments+offset/2) - startchar
- if trace_cmap_detail then
- report("format 4.%i segment %2i from %C upto %C at index %H",0,segment,startchar,endchar,(startchar + delta) % 65536)
+ if trace_cmap_details then
+ report_cmap("format 4.%i segment %2i from %C upto %C at index %H",0,segment,startchar,endchar,(startchar + delta) % 65536)
end
for unicode=startchar,endchar do
local slot = shift + unicode
@@ -1481,8 +1467,8 @@ formatreaders[6] = function(f,fontdata,offset)
local count = readushort(f)
local stop = start+count-1
local nofdone = 0
- if trace_cmap_detail then
- report("format 6 from %C to %C",2,start,stop)
+ if trace_cmap_details then
+ report_cmap("format 6 from %C to %C",2,start,stop)
end
for unicode=start,stop do
local index = readushort(f)
@@ -1518,8 +1504,8 @@ formatreaders[12] = function(f,fontdata,offset)
local first = readulong(f)
local last = readulong(f)
local index = readulong(f)
- if trace_cmap_detail then
- report("format 12 from %C to %C starts at index %i",first,last,index)
+ if trace_cmap_details then
+ report_cmap("format 12 from %C to %C starts at index %i",first,last,index)
end
for unicode=first,last do
local glyph = glyphs[index]
@@ -1562,8 +1548,8 @@ formatreaders[13] = function(f,fontdata,offset)
local last = readulong(f)
local index = readulong(f)
if first < privateoffset then
- if trace_cmap_detail then
- report("format 13 from %C to %C get index %i",first,last,index)
+ if trace_cmap_details then
+ report_cmap("format 13 from %C to %C get index %i",first,last,index)
end
local glyph = glyphs[index]
local unicode = glyph.unicode
@@ -1649,27 +1635,46 @@ formatreaders[14] = function(f,fontdata,offset)
end
local function checkcmap(f,fontdata,records,platform,encoding,format)
- local data = records[platform]
- if not data then
+ local pdata = records[platform]
+ if not pdata then
+ if trace_cmap_details then
+ report_cmap("skipped, %s, p=%i e=%i f=%i","no platform",platform,encoding,format)
+ end
return 0
end
- data = data[encoding]
- if not data then
+ local edata = pdata[encoding]
+ if not edata then
+ if trace_cmap_details then
+ report_cmap("skipped, %s, p=%i e=%i f=%i","no encoding",platform,encoding,format)
+ end
return 0
end
- data = data[format]
- if not data then
+ local fdata = edata[format]
+ if not fdata then
+ if trace_cmap_details then
+ report_cmap("skipped, %s, p=%i e=%i f=%i","no format",platform,encoding,format)
+ end
+ return 0
+ elseif type(fdata) ~= "number" then
+ if trace_cmap_details then
+ report_cmap("skipped, %s, p=%i e=%i f=%i","already done",platform,encoding,format)
+ end
return 0
end
+ edata[format] = true -- done
local reader = formatreaders[format]
if not reader then
+ if trace_cmap_details then
+ report_cmap("skipped, %s, p=%i e=%i f=%i","unsupported format",platform,encoding,format)
+ end
return 0
end
- local p = platforms[platform]
- local e = encodings[p]
- local n = reader(f,fontdata,data) or 0
- if trace_cmap then
- report("cmap checked: platform %i (%s), encoding %i (%s), format %i, new unicodes %i",platform,p,encoding,e and e[encoding] or "?",format,n)
+ local n = reader(f,fontdata,fdata) or 0
+ if trace_cmap_details or trace_cmap then
+ local p = platforms[platform]
+ local e = encodings[p]
+ report_cmap("checked, platform %i (%s), encoding %i (%s), format %i, new unicodes %i",
+ platform,p,encoding,e and e[encoding] or "?",format,n)
end
return n
end
@@ -1904,6 +1909,7 @@ local function getinfo(maindata,sub,platformnames,rawfamilynames,metricstoo,inst
local postscript = fontdata.postscript or { }
local fontheader = fontdata.fontheader or { }
local cffinfo = fontdata.cffinfo or { }
+ local verticalheader = fontdata.verticalheader or { }
local filename = fontdata.filename
local weight = getname(fontdata,"weight") or (cffinfo and cffinfo.weight) or (metrics and metrics.weight)
local width = getname(fontdata,"width") or (cffinfo and cffinfo.width ) or (metrics and metrics.width )
@@ -1973,6 +1979,7 @@ local function getinfo(maindata,sub,platformnames,rawfamilynames,metricstoo,inst
platformnames = platformnames or nil,
instancenames = instancenames or nil,
tableoffsets = fontdata.tableoffsets,
+ defaultvheight = (verticalheader.ascender or 0) - (verticalheader.descender or 0)
}
if metricstoo then
local keys = {
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ttf.lua b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ttf.lua
index d2fe0917c53..651ede17e21 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ttf.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-ttf.lua
@@ -733,7 +733,15 @@ local function repackpoints(glyphs,shapes)
currentx = px
currenty = py
if lastflag == fl then
- nofflags = nofflags + 1
+ if nofflags == 255 then
+ -- This happens in koeieletters!
+ lastflag = lastflag + 0x08
+ r = r + 1 result[r] = char(lastflag,nofflags-1)
+ nofflags = 1
+ lastflag = fl
+ else
+ nofflags = nofflags + 1
+ end
else -- if > 255
if nofflags == 1 then
-- r = r + 1 result[r] = char(lastflag)
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-l-lua.lua b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-l-lua.lua
index 5570e83dc8d..6e9606e849f 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-l-lua.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-l-lua.lua
@@ -212,7 +212,7 @@ FFISUPPORTED = type(ffi) == "table" and ffi.os ~= "" and ffi.arch ~= "" and ffi.
if not FFISUPPORTED then
- -- Maybe we should check for LUATEXENGINE but that's also a bti tricky as we still
+ -- Maybe we should check for LUATEXENGINE but that's also a bit tricky as we still
-- can have a weird ffi library laying around. Checking for presence of 'jit' is
-- also not robust. So for now we hope for the best.
@@ -253,3 +253,7 @@ if LUAVERSION > 5.3 then
-- collectgarbage("collect")
-- collectgarbage("generational") -- crashes on unix
end
+
+if status and os.setenv then
+ os.setenv("engine",string.lower(status.luatex_engine or "unknown"))
+end
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-l-table.lua b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-l-table.lua
index 192347b0619..cffdcc23e20 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-l-table.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-l-table.lua
@@ -1261,10 +1261,12 @@ function table.reverse(t) -- check with 5.3 ?
end
end
+-- This one is for really simple cases where need a hash from a table.
+
local function sequenced(t,sep,simple)
if not t then
return ""
- elseif type(t) == "string" then
+ elseif type(t) ~= "table" then
return t -- handy fallback
end
local n = #t
@@ -1305,7 +1307,11 @@ local function sequenced(t,sep,simple)
end
end
end
- return concat(s,sep or " | ")
+ if sep == true then
+ return "{ " .. concat(s,", ") .. " }"
+ else
+ return concat(s,sep or " | ")
+ end
end
table.sequenced = sequenced
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-reference.lua b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-reference.lua
index 6bd9bbd5930..3120f45135b 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 : 07/04/19 12:29:22
+-- merge date : 08/11/19 20:03:46
do -- begin closure to overcome local limits and interference
@@ -121,6 +121,9 @@ elseif not ffi.number then
end
if LUAVERSION>5.3 then
end
+if status and os.setenv then
+ os.setenv("engine",string.lower(status.luatex_engine or "unknown"))
+end
end -- closure
@@ -1988,7 +1991,7 @@ end
local function sequenced(t,sep,simple)
if not t then
return ""
- elseif type(t)=="string" then
+ elseif type(t)~="table" then
return t
end
local n=#t
@@ -2027,7 +2030,11 @@ local function sequenced(t,sep,simple)
end
end
end
- return concat(s,sep or " | ")
+ if sep==true then
+ return "{ "..concat(s,", ").." }"
+ else
+ return concat(s,sep or " | ")
+ end
end
table.sequenced=sequenced
function table.print(t,...)
@@ -3392,6 +3399,13 @@ local template=[[
%s
return function(%s) return %s end
]]
+local pattern=Cs(Cc('"')*(
+ (1-S('"\\\n\r'))^1+P('"')/'\\"'+P('\\')/'\\\\'+P('\n')/'\\n'+P('\r')/'\\r'
+)^0*Cc('"'))
+patterns.escapedquotes=pattern
+function string.escapedquotes(s)
+ return lpegmatch(pattern,s)
+end
local preamble=""
local environment={
global=global or _G,
@@ -3418,6 +3432,7 @@ local environment={
formattedfloat=number.formattedfloat,
stripzero=patterns.stripzero,
stripzeros=patterns.stripzeros,
+ escapedquotes=string.escapedquotes,
FORMAT=string.f9,
}
local arguments={ "a1" }
@@ -3475,7 +3490,7 @@ local format_q=function()
end
local format_Q=function()
n=n+1
- return format("format('%%q',tostring(a%s))",n)
+ return format("escapedquotes(tostring(a%s))",n)
end
local format_i=function(f)
n=n+1
@@ -9437,13 +9452,13 @@ function constructors.finalize(tfmdata)
parameters.width=0
end
if not parameters.slantfactor then
- parameters.slantfactor=tfmdata.slant or 0
+ parameters.slantfactor=(tfmdata.slant or 0)/1000
end
if not parameters.extendfactor then
- parameters.extendfactor=tfmdata.extend or 0
+ parameters.extendfactor=(tfmdata.extend or 1000)/1000
end
if not parameters.squeezefactor then
- parameters.squeezefactor=tfmdata.squeeze or 0
+ parameters.squeezefactor=(tfmdata.squeeze or 1000)/1000
end
local designsize=parameters.designsize
if designsize then
@@ -10830,8 +10845,9 @@ local sortedhash=table.sortedhash
local stripstring=string.nospaces
local utf16_to_utf8_be=utf.utf16_to_utf8_be
local report=logs.reporter("otf reader")
-local trace_cmap=false
-local trace_cmap_detail=false
+local report_cmap=logs.reporter("otf reader","cmap")
+local trace_cmap=false trackers.register("otf.cmap",function(v) trace_cmap=v end)
+local trace_cmap_details=false trackers.register("otf.cmap.details",function(v) trace_cmap_details=v end)
fonts=fonts or {}
local handlers=fonts.handlers or {}
fonts.handlers=handlers
@@ -11493,15 +11509,18 @@ readers.vmtx=function(f,fontdata,specification)
local glyphs=fontdata.glyphs
local nofglyphs=fontdata.nofglyphs
local vheight=0
- local vdefault=verticalheader.ascender+verticalheader.descender
+ local vdefault=verticalheader.ascender-verticalheader.descender
local topsidebearing=0
for i=0,nofmetrics-1 do
local glyph=glyphs[i]
- vheight=readshort(f)
+ vheight=readushort(f)
topsidebearing=readshort(f)
if vheight~=0 and vheight~=vdefault then
glyph.vheight=vheight
end
+ if topsidebearing~=0 then
+ glyph.tsb=topsidebearing
+ end
end
for i=nofmetrics,nofglyphs-1 do
local glyph=glyphs[i]
@@ -11579,11 +11598,14 @@ local sequence={
{ 3,1,4 },
{ 3,10,12 },
{ 0,3,4 },
+ { 0,3,12 },
{ 0,1,4 },
+ { 0,1,12 },
{ 0,0,6 },
{ 3,0,6 },
+ { 3,0,4 },
{ 0,5,14 },
-{ 0,4,12 },
+ { 0,4,12 },
{ 3,10,13 },
}
local supported={}
@@ -11628,7 +11650,7 @@ formatreaders[4]=function(f,fontdata,offset)
elseif startchar==0xFFFF and offset==0 then
elseif offset==0xFFFF then
elseif offset==0 then
- if trace_cmap_detail then
+ if trace_cmap_details then
report("format 4.%i segment %2i from %C upto %C at index %H",1,segment,startchar,endchar,(startchar+delta)%65536)
end
for unicode=startchar,endchar do
@@ -11660,8 +11682,8 @@ formatreaders[4]=function(f,fontdata,offset)
end
else
local shift=(segment-nofsegments+offset/2)-startchar
- if trace_cmap_detail then
- report("format 4.%i segment %2i from %C upto %C at index %H",0,segment,startchar,endchar,(startchar+delta)%65536)
+ if trace_cmap_details then
+ report_cmap("format 4.%i segment %2i from %C upto %C at index %H",0,segment,startchar,endchar,(startchar+delta)%65536)
end
for unicode=startchar,endchar do
local slot=shift+unicode
@@ -11708,8 +11730,8 @@ formatreaders[6]=function(f,fontdata,offset)
local count=readushort(f)
local stop=start+count-1
local nofdone=0
- if trace_cmap_detail then
- report("format 6 from %C to %C",2,start,stop)
+ if trace_cmap_details then
+ report_cmap("format 6 from %C to %C",2,start,stop)
end
for unicode=start,stop do
local index=readushort(f)
@@ -11741,8 +11763,8 @@ formatreaders[12]=function(f,fontdata,offset)
local first=readulong(f)
local last=readulong(f)
local index=readulong(f)
- if trace_cmap_detail then
- report("format 12 from %C to %C starts at index %i",first,last,index)
+ if trace_cmap_details then
+ report_cmap("format 12 from %C to %C starts at index %i",first,last,index)
end
for unicode=first,last do
local glyph=glyphs[index]
@@ -11780,8 +11802,8 @@ formatreaders[13]=function(f,fontdata,offset)
local last=readulong(f)
local index=readulong(f)
if first<privateoffset then
- if trace_cmap_detail then
- report("format 13 from %C to %C get index %i",first,last,index)
+ if trace_cmap_details then
+ report_cmap("format 13 from %C to %C get index %i",first,last,index)
end
local glyph=glyphs[index]
local unicode=glyph.unicode
@@ -11851,27 +11873,46 @@ formatreaders[14]=function(f,fontdata,offset)
end
end
local function checkcmap(f,fontdata,records,platform,encoding,format)
- local data=records[platform]
- if not data then
+ local pdata=records[platform]
+ if not pdata then
+ if trace_cmap_details then
+ report_cmap("skipped, %s, p=%i e=%i f=%i","no platform",platform,encoding,format)
+ end
return 0
end
- data=data[encoding]
- if not data then
+ local edata=pdata[encoding]
+ if not edata then
+ if trace_cmap_details then
+ report_cmap("skipped, %s, p=%i e=%i f=%i","no encoding",platform,encoding,format)
+ end
return 0
end
- data=data[format]
- if not data then
+ local fdata=edata[format]
+ if not fdata then
+ if trace_cmap_details then
+ report_cmap("skipped, %s, p=%i e=%i f=%i","no format",platform,encoding,format)
+ end
+ return 0
+ elseif type(fdata)~="number" then
+ if trace_cmap_details then
+ report_cmap("skipped, %s, p=%i e=%i f=%i","already done",platform,encoding,format)
+ end
return 0
end
+ edata[format]=true
local reader=formatreaders[format]
if not reader then
+ if trace_cmap_details then
+ report_cmap("skipped, %s, p=%i e=%i f=%i","unsupported format",platform,encoding,format)
+ end
return 0
end
- local p=platforms[platform]
- local e=encodings[p]
- local n=reader(f,fontdata,data) or 0
- if trace_cmap then
- report("cmap checked: platform %i (%s), encoding %i (%s), format %i, new unicodes %i",platform,p,encoding,e and e[encoding] or "?",format,n)
+ local n=reader(f,fontdata,fdata) or 0
+ if trace_cmap_details or trace_cmap then
+ local p=platforms[platform]
+ local e=encodings[p]
+ report_cmap("checked, platform %i (%s), encoding %i (%s), format %i, new unicodes %i",
+ platform,p,encoding,e and e[encoding] or "?",format,n)
end
return n
end
@@ -12066,6 +12107,7 @@ local function getinfo(maindata,sub,platformnames,rawfamilynames,metricstoo,inst
local postscript=fontdata.postscript or {}
local fontheader=fontdata.fontheader or {}
local cffinfo=fontdata.cffinfo or {}
+ local verticalheader=fontdata.verticalheader or {}
local filename=fontdata.filename
local weight=getname(fontdata,"weight") or (cffinfo and cffinfo.weight) or (metrics and metrics.weight)
local width=getname(fontdata,"width") or (cffinfo and cffinfo.width ) or (metrics and metrics.width )
@@ -12131,6 +12173,7 @@ local function getinfo(maindata,sub,platformnames,rawfamilynames,metricstoo,inst
platformnames=platformnames or nil,
instancenames=instancenames or nil,
tableoffsets=fontdata.tableoffsets,
+ defaultvheight=(verticalheader.ascender or 0)-(verticalheader.descender or 0)
}
if metricstoo then
local keys={
@@ -15239,7 +15282,7 @@ do
local function call(scope,list,bias)
depth=depth+1
if top==0 then
- showstate(formatters["unknown %s call"](scope))
+ showstate(formatters["unknown %s call %s"](scope,"?"))
top=0
else
local index=stack[top]+bias
@@ -15251,7 +15294,7 @@ do
if tab then
process(tab)
else
- showstate(formatters["unknown %s call %i"](scope,index))
+ showstate(formatters["unknown %s call %s"](scope,index))
top=0
end
end
@@ -15321,7 +15364,7 @@ do
i=i+1
local t=tab[i]
if justpass then
- if t>=34 or t<=37 then
+ if t>=34 and t<=37 then
for i=1,top do
r=r+1;result[r]=encode[stack[i]]
end
@@ -15423,12 +15466,16 @@ end
end
end
end
- local function setbias(globals,locals)
+ local function setbias(globals,locals,nobias)
+ if nobias then
+ return 0,0
+ else
local g=#globals
local l=#locals
return
((g<1240 and 107) or (g<33900 and 1131) or 32768)+1,
((l<1240 and 107) or (l<33900 and 1131) or 32768)+1
+ end
end
local function processshape(tab,index)
if not tab then
@@ -15538,7 +15585,7 @@ end
end
return privatedata.nominalwidthx or 0,privatedata.defaultwidthx or 0
end
- parsecharstrings=function(fontdata,data,glphs,doshapes,tversion,streams)
+ parsecharstrings=function(fontdata,data,glphs,doshapes,tversion,streams,nobias)
local dictionary=data.dictionaries[1]
local charstrings=dictionary.charstrings
keepcurve=doshapes
@@ -15549,7 +15596,7 @@ end
charset=dictionary.charset
vsindex=dictionary.vsindex or 0
glyphs=glphs or {}
- globalbias,localbias=setbias(globals,locals)
+ globalbias,localbias=setbias(globals,locals,nobias)
nominalwidth,defaultwidth=setwidths(dictionary.private)
if charstrings then
startparsing(fontdata,data,streams)
@@ -15571,8 +15618,8 @@ end
charset=false
vsindex=dictionary.vsindex or 0
glyphs=glphs or {}
- justpass=streams==true
- globalbias,localbias=setbias(globals,locals)
+ justpass=streams==true
+ globalbias,localbias=setbias(globals,locals,nobias)
nominalwidth,defaultwidth=setwidths(dictionary.private)
processshape(tab,index-1)
end
@@ -16543,7 +16590,14 @@ local function repackpoints(glyphs,shapes)
currentx=px
currenty=py
if lastflag==fl then
- nofflags=nofflags+1
+ if nofflags==255 then
+ lastflag=lastflag+0x08
+ r=r+1 result[r]=char(lastflag,nofflags-1)
+ nofflags=1
+ lastflag=fl
+ else
+ nofflags=nofflags+1
+ end
else
if nofflags==1 then
r=r+1 result[r]=chars[lastflag]
@@ -22995,7 +23049,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.108
+otf.version=3.109
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)
@@ -23357,6 +23411,7 @@ local function copytotfm(data,cache_id)
parameters.ascender=abs(metadata.ascender or 0)
parameters.descender=abs(metadata.descender or 0)
parameters.units=units
+ parameters.vheight=metadata.defaultvheight
properties.space=spacer
properties.encodingbytes=2
properties.format=data.format or formats.otf
@@ -33372,7 +33427,7 @@ do
}
},
}
- fonts.handlers.otf.readers.parsecharstrings(false,data,glyphs,true,"cff",streams)
+ fonts.handlers.otf.readers.parsecharstrings(false,data,glyphs,true,"cff",streams,true)
else
lpegmatch(p_filternames,binary,1,filename)
end
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 5470c2fd698..ad22302df0c 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-util-str.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-util-str.lua
@@ -584,6 +584,26 @@ local template = [[
return function(%s) return %s end
]]
+-- this might move
+
+local pattern = Cs(Cc('"') * (
+ (1-S('"\\\n\r'))^1
+ + P('"') / '\\"'
+ + P('\\') / '\\\\'
+ + P('\n') / '\\n'
+ + P('\r') / '\\r'
+)^0 * Cc('"'))
+
+patterns.escapedquotes = pattern
+
+function string.escapedquotes(s)
+ return lpegmatch(pattern,s)
+end
+
+-- print(string.escapedquotes('1\\23\n"'))
+
+-- but for now here
+
local preamble = ""
local environment = {
@@ -611,6 +631,7 @@ local environment = {
formattedfloat = number.formattedfloat,
stripzero = patterns.stripzero,
stripzeros = patterns.stripzeros,
+ escapedquotes = string.escapedquotes,
FORMAT = string.f9,
}
@@ -685,11 +706,13 @@ local format_q = function()
-- lua 5.3 has a different q than lua 5.2 (which does a tostring on numbers)
-- return format("(a%s ~= nil and format('%%q',a%s) or '')",n,n)
return format("(a%s ~= nil and format('%%q',tostring(a%s)) or '')",n,n)
+ -- return format("(a%s ~= nil and escapedquotes(tostring(a%s)) or '')",n,n)
end
-local format_Q = function() -- can be optimized
+local format_Q = function() -- fast escaping
n = n + 1
- return format("format('%%q',tostring(a%s))",n)
+-- return format("format('%%q',tostring(a%s))",n)
+ return format("escapedquotes(tostring(a%s))",n)
end
local format_i = function(f)
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-auxiliary.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-auxiliary.lua
index c1b8236cb58..72e530d0740 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 @@
local ProvidesLuaModule = {
name = "luaotfload-auxiliary",
- version = "2.98", --TAGVERSION
- date = "2019-07-04", --TAGDATE
+ version = "2.99", --TAGVERSION
+ date = "2019-08-11", --TAGDATE
description = "luaotfload submodule / auxiliary functions",
license = "GPL v2.0"
}
@@ -31,7 +31,7 @@ local texsprint = tex.sprint
local dofile = dofile
local getmetatable = getmetatable
local setmetatable = setmetatable
-local utf8 = unicode.utf8
+local utfcodepoint = utf8.codepoint
local stringlower = string.lower
local stringformat = string.format
local stringgsub = string.gsub
@@ -48,7 +48,7 @@ local luaotfload_callbacks = { }
--- https://github.com/khaledhosny/luaotfload/issues/54
-local rewrite_fontname = function (tfmdata, specification)
+local function rewrite_fontname(tfmdata, specification)
local format = tfmdata.format or tfmdata.properties.format
if stringfind (specification, " ") then
tfmdata.name = stringformat ("%q", specification)
@@ -60,7 +60,7 @@ end
local rewriting = false
-local start_rewrite_fontname = function ()
+function aux.start_rewrite_fontname()
if rewriting == false then
luatexbase.add_to_callback (
"luaotfload.patch_font",
@@ -72,9 +72,7 @@ local start_rewrite_fontname = function ()
end
end
-aux.start_rewrite_fontname = start_rewrite_fontname
-
-local stop_rewrite_fontname = function ()
+function aux.stop_rewrite_fontname()
if rewriting == true then
luatexbase.remove_from_callback
("luaotfload.patch_font", "luaotfload.rewrite_fontname")
@@ -84,15 +82,13 @@ local stop_rewrite_fontname = function ()
end
end
-aux.stop_rewrite_fontname = stop_rewrite_fontname
-
--[[doc--
This sets two dimensions apparently relied upon by the unicode-math
package.
--doc]]--
-local set_sscale_dimens = function (fontdata)
+local function set_sscale_dimens(fontdata)
local resources = fontdata.resources if not resources then return end
local mathconstants = resources.MathConstants if not mathconstants then return end
local parameters = fontdata.parameters if not parameters then return end
@@ -108,7 +104,7 @@ luaotfload_callbacks [#luaotfload_callbacks + 1] = {
local default_units = 1000
--- fontobj -> int
-local lookup_units = function (fontdata)
+local function lookup_units(fontdata)
local units = fontdata.units
if units and units > 0 then return units end
local shared = fontdata.shared if not shared then return default_units end
@@ -126,7 +122,7 @@ end
This callback corrects some values of the Cambria font.
--doc]]--
--- fontobj -> unit
-local patch_cambria_domh = function (fontdata)
+local function patch_cambria_domh(fontdata)
local mathconstants = fontdata.MathConstants
if mathconstants and fontdata.psname == "CambriaMath" then
--- my test Cambria has 2048
@@ -155,15 +151,13 @@ luaotfload_callbacks [#luaotfload_callbacks + 1] = {
--doc]]--
--- fontobj -> unit
-local fixup_fontdata = function (data)
-
+local function fixup_fontdata(data)
local t = type (data)
--- Some OT fonts like Libertine R lack the resources table, causing
--- the fontloader to nil-index.
if t == "table" then
if data and not data.resources then data.resources = { } end
end
-
end
luaotfload_callbacks [#luaotfload_callbacks + 1] = {
@@ -187,15 +181,14 @@ Comment from fontspec:
local capheight_reference_chars = { "X", "M", "Ж", "ξ", }
local capheight_reference_codepoints do
- local utfbyte = unicode.utf8.byte
capheight_reference_codepoints = { }
for i = 1, #capheight_reference_chars do
local chr = capheight_reference_chars [i]
- capheight_reference_codepoints [i] = utfbyte (chr)
+ capheight_reference_codepoints [i] = utfcodepoint (chr)
end
end
-local determine_capheight = function (fontdata)
+local function determine_capheight(fontdata)
local parameters = fontdata.parameters if not parameters then return false end
local characters = fontdata.characters if not characters then return false end
--- Pretty simplistic but it does return *some* value for most fonts;
@@ -215,7 +208,7 @@ local determine_capheight = function (fontdata)
return false
end
-local query_ascender = function (fontdata)
+local function query_ascender(fontdata)
local parameters = fontdata.parameters if not parameters then return false end
local ascender = parameters.ascender
if ascender then
@@ -232,7 +225,7 @@ local query_ascender = function (fontdata)
return ascender * size / units --- scaled
end
-local query_capheight = function (fontdata)
+local function query_capheight(fontdata)
local parameters = fontdata.parameters if not parameters then return false end
local shared = fontdata.shared if not shared then return false end
local rawdata = shared.rawdata if not rawdata then return false end
@@ -244,20 +237,20 @@ local query_capheight = function (fontdata)
return capheight * size / units
end
-local query_fontdimen8 = function (fontdata)
+local function query_fontdimen8(fontdata)
local parameters = fontdata.parameters if not parameters then return false end
local fontdimen8 = parameters [8]
if fontdimen8 then return fontdimen8 end
return false
end
-local caphtfmt = function (ref, ht)
+local function caphtfmt(ref, ht)
if not ht then return "<none>" end
if not ref then return tostring (ht) end
return stringformat ("%s(δ=%s)", ht, ht - ref)
end
-local set_capheight = function (fontdata)
+local function set_capheight(fontdata)
if not fontdata then
logreport ("both", 0, "aux",
"error: set_capheight() received garbage")
@@ -307,7 +300,7 @@ luaotfload_callbacks [#luaotfload_callbacks + 1] = {
-----------------------------------------------------------------------
--- int -> int -> bool
-local font_has_glyph = function (font_id, codepoint)
+function aux.font_has_glyph(font_id, codepoint)
local fontdata = fonts.hashes.identifiers[font_id]
if fontdata then
if fontdata.characters[codepoint] ~= nil then return true end
@@ -315,11 +308,9 @@ local font_has_glyph = function (font_id, codepoint)
return false
end
-aux.font_has_glyph = font_has_glyph
-
--- undocumented
-local raw_slot_of_name = function (font_id, glyphname)
+local function raw_slot_of_name(font_id, glyphname)
local fontdata = font.fonts[font_id]
if fontdata.type == "virtual" then --- get base font for glyph idx
local codepoint = encodings.agl.unicodes[glyphname]
@@ -346,7 +337,7 @@ end
--doc]]--
--- int -> string -> bool -> (int | false)
-local slot_of_name = function (font_id, glyphname, unsafe)
+function aux.slot_of_name(font_id, glyphname, unsafe)
if not font_id or type (font_id) ~= "number"
or not glyphname or type (glyphname) ~= "string"
then
@@ -372,8 +363,6 @@ local slot_of_name = function (font_id, glyphname, unsafe)
return false
end
-aux.slot_of_name = slot_of_name
-
--[[doc--
Inverse of above; not authoritative as to my knowledge the official
@@ -388,7 +377,7 @@ aux.slot_of_name = slot_of_name
local indices
--- int -> (string | false)
-local name_of_slot = function (codepoint)
+function aux.name_of_slot(codepoint)
if not codepoint or type (codepoint) ~= "number" then
logreport ("both", 0, "aux",
"invalid parameters to name_of_slot (%s)",
@@ -412,15 +401,12 @@ local name_of_slot = function (codepoint)
return false
end
-aux.name_of_slot = name_of_slot
-
-
-----------------------------------------------------------------------
--- features / scripts / languages
-----------------------------------------------------------------------
--- lots of arrowcode ahead
-local get_features = function (tfmdata)
+local function get_features(tfmdata)
local resources = tfmdata.resources if not resources then return false end
local features = resources.features if not features then return false end
return features
@@ -433,7 +419,7 @@ least one feature.
--doc]]--
--- int -> string -> bool
-local provides_script = function (font_id, asked_script)
+function aux.provides_script(font_id, asked_script)
if not font_id or type (font_id) ~= "number"
or not asked_script or type (asked_script) ~= "string"
then
@@ -470,8 +456,6 @@ local provides_script = function (font_id, asked_script)
return false
end
-aux.provides_script = provides_script
-
--[[doc--
This function, modeled after “check_language()” from fontspec, returns
true if in the given font, the language with tage “asked_language” is
@@ -480,7 +464,7 @@ feature.
--doc]]--
--- int -> string -> string -> bool
-local provides_language = function (font_id, asked_script, asked_language)
+function aux.provides_language(font_id, asked_script, asked_language)
if not font_id or type (font_id) ~= "number"
or not asked_script or type (asked_script) ~= "string"
or not asked_language or type (asked_language) ~= "string"
@@ -525,8 +509,6 @@ local provides_language = function (font_id, asked_script, asked_language)
return false
end
-aux.provides_language = provides_language
-
--[[doc--
We strip the syntax elements from feature definitions (shouldn’t
actually be there in the first place, but who cares ...)
@@ -562,7 +544,7 @@ accounted for in the script with tag “asked_script” in feature
--doc]]--
--- int -> string -> string -> string -> bool
-local provides_feature = function (font_id, asked_script,
+function aux.provides_feature(font_id, asked_script,
asked_language, asked_feature)
if not font_id or type (font_id) ~= "number"
or not asked_script or type (asked_script) ~= "string"
@@ -579,7 +561,7 @@ local provides_feature = function (font_id, asked_script,
asked_language = stringlower(asked_language)
asked_feature = lpegmatch(strip_garbage, asked_feature)
- if font_id and font_id > 0 then
+ if font_id > 0 then
local tfmdata = identifiers[font_id]
if not tfmdata then return false end
local features = get_features (tfmdata)
@@ -610,14 +592,12 @@ local provides_feature = function (font_id, asked_script,
return false
end
-aux.provides_feature = provides_feature
-
-----------------------------------------------------------------------
--- font dimensions
-----------------------------------------------------------------------
--- int -> string -> int
-local get_math_dimension = function (font_id, dimenname)
+local function get_math_dimension(font_id, dimenname)
if type(font_id) == "string" then
font_id = fontid(font_id) --- safeguard
end
@@ -632,7 +612,7 @@ end
aux.get_math_dimension = get_math_dimension
--- int -> string -> unit
-local sprint_math_dimension = function (font_id, dimenname)
+function aux.sprint_math_dimension(font_id, dimenname)
if type(font_id) == "string" then
font_id = fontid(font_id)
end
@@ -640,15 +620,10 @@ local sprint_math_dimension = function (font_id, dimenname)
texsprint(luatexbase.catcodetables["latex-package"], dim, "sp")
end
-aux.sprint_math_dimension = sprint_math_dimension
-
-----------------------------------------------------------------------
--- extra database functions
-----------------------------------------------------------------------
-local namesresolve = fontnames.resolve
-local namesscan_dir = fontnames.scan_dir
-
--[====[-- TODO -> port this to new db model
--- local directories -------------------------------------------------
@@ -677,7 +652,7 @@ aux.scan_external_dir = scan_external_dir
--]====]--
-aux.scan_external_dir = function ()
+function aux.scan_external_dir()
print "ERROR: scan_external_dir() is not implemented"
end
@@ -685,14 +660,12 @@ end
--- https://github.com/lualatex/luaotfload/issues/74
--- string -> (string * int)
-local resolve_fontname = function (name)
- local foundname, subfont, success = namesresolve(nil, nil, {
- name = name,
- lookup = "name",
- optsize = 0,
- specification = "name:" .. name,
- })
- if success then
+local function resolve_fontname(name)
+ local foundname, subfont = luaotfload.resolvers.name {
+ name = name,
+ specification = "name:" .. name,
+ }
+ if foundname then
return foundname, subfont
end
return false, false
@@ -701,24 +674,16 @@ end
aux.resolve_fontname = resolve_fontname
--- string list -> (string * int)
-local resolve_fontlist
-resolve_fontlist = function (names, n)
- if not n then
- return resolve_fontlist(names, 1)
- end
- local this = names[n]
- if this then
+function aux.resolve_fontlist(names)
+ for n = 1, #names do
local foundname, subfont = resolve_fontname(this)
if foundname then
return foundname, subfont
end
- return resolve_fontlist(names, n+1)
end
return false, false
end
-aux.resolve_fontlist = resolve_fontlist
-
--- index access ------------------------------------------------------
--- Based on a discussion on the Luatex mailing list:
@@ -737,7 +702,7 @@ aux.resolve_fontlist = resolve_fontlist
local load_names = fontnames.load
local access_font_index = fontnames.access_font_index
-local read_font_index = function ()
+function aux.read_font_index()
return load_names (true) or { }
end
@@ -750,29 +715,18 @@ end
--doc]]--
-local font_index = function () return access_font_index () end
+function aux.font_index() return access_font_index () end
-aux.read_font_index = read_font_index
-aux.font_index = font_index
--- loaded fonts ------------------------------------------------------
--- just a proof of concept
--- fontobj -> string list -> (string list) list
-local get_font_data get_font_data = function (tfmdata, keys, acc, n)
- if not acc then
- return get_font_data(tfmdata, keys, {}, 1)
- end
- local key = keys[n]
- if key then
- local val = tfmdata[key]
- if val then
- acc[#acc+1] = val
- else
- acc[#acc+1] = false
- end
- return get_font_data(tfmdata, keys, acc, n+1)
+local function get_font_data (tfmdata, keys)
+ local acc = {}
+ for n = 1, #keys do
+ acc[n] = tfmdata[keys[n]] or false
end
return acc
end
@@ -791,27 +745,19 @@ end
local default_keys = { "fullname" }
--- string list -> (int * string list) list
-local get_loaded_fonts get_loaded_fonts = function (keys, acc, lastid)
- if not acc then
- if not keys then
- keys = default_keys
- end
- return get_loaded_fonts(keys, {}, lastid)
- end
- local id, tfmdata = next(identifiers, lastid)
- if id then
+function aux.get_loaded_fonts (keys)
+ keys = keys or default_keys
+ local acc = {}
+ for id, tfmdata in pairs(identifiers) do
local data = get_font_data(tfmdata, keys)
acc[#acc+1] = { id, data }
- return get_loaded_fonts (keys, acc, id)
end
return acc
end
-aux.get_loaded_fonts = get_loaded_fonts
-
--- Raw access to the font.* namespace is unsafe so no documentation on
--- this one.
-local get_raw_fonts = function ( )
+function aux.get_raw_fonts ()
local res = { }
for i, v in font.each() do
if v.filename then
@@ -821,8 +767,6 @@ local get_raw_fonts = function ( )
return res
end
-aux.get_raw_fonts = get_raw_fonts
-
-----------------------------------------------------------------------
--- font parameters
-----------------------------------------------------------------------
@@ -856,7 +800,7 @@ end})
--doc]]--
--- int -> (number | false)
-local get_quad = function (font_id)
+function aux.get_quad(font_id)
local quad = quads[font_id]
if quad then
return quad
@@ -870,14 +814,11 @@ local get_quad = function (font_id)
return false
end
-aux.get_quad = get_quad
-
-
-----------------------------------------------------------------------
--- initialization
-----------------------------------------------------------------------
-local inject_callbacks = function (lst)
+local function inject_callbacks (lst)
if not lst and next (lst) then return false end
local inject = function (def)
@@ -901,14 +842,10 @@ local inject_callbacks = function (lst)
return ret
end
-return {
- init = function ()
- local ret = true
- luaotfload.aux = aux
- ret = inject_callbacks (luaotfload_callbacks)
- return ret
- end
-}
+return function ()
+ luaotfload.aux = aux
+ return inject_callbacks (luaotfload_callbacks)
+end
-- vim:tw=79:sw=2:ts=8:et
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-colors.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-colors.lua
index 164d5bfa7df..5460ac12e61 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 @@
local ProvidesLuaModule = {
name = "luaotfload-colors",
- version = "2.98", --TAGVERSION
- date = "2019-07-04", --TAGDATE
+ version = "2.99", --TAGVERSION
+ date = "2019-08-11", --TAGDATE
description = "luaotfload submodule / color",
license = "GPL v2.0",
author = "Khaled Hosny, Elie Roux, Philipp Gesang, Dohyun Kim, David Carlisle",
@@ -391,27 +391,24 @@ local setcolor = function (tfmdata, value)
end
end
-return {
- init = function ()
- logreport = luaotfload.log.report
- if not fonts then
- logreport ("log", 0, "color",
- "OTF mechanisms missing -- did you forget to \z
- load a font loader?")
- return false
- end
- fonts.handlers.otf.features.register {
- name = "color",
- description = "color",
- initializers = {
- base = setcolor,
- node = setcolor,
- }
- }
- return true
+return function ()
+ logreport = luaotfload.log.report
+ if not fonts then
+ logreport ("log", 0, "color",
+ "OTF mechanisms missing -- did you forget to \z
+ load a font loader?")
+ return false
end
-}
-
+ fonts.handlers.otf.features.register {
+ name = "color",
+ description = "color",
+ initializers = {
+ base = setcolor,
+ node = setcolor,
+ }
+ }
+ return true
+end
-- vim:tw=71:sw=4:ts=4:expandtab
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-configuration.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-configuration.lua
index fd3db5f7a29..e30ef66dec4 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 @@
local ProvidesLuaModule = {
name = "luaotfload-configuration",
- version = "2.98", --TAGVERSION
- date = "2019-07-04", --TAGDATE
+ version = "2.99", --TAGVERSION
+ date = "2019-08-11", --TAGDATE
description = "luaotfload submodule / config file reader",
license = "GPL v2.0"
}
@@ -1011,27 +1011,24 @@ end
--- EXPORTS
-------------------------------------------------------------------------------
-return {
- init = function ()
- config.luaotfload = { }
- logreport = luaotfload.log.report
- local parsers = luaotfload.parsers
- config_parser = parsers.config
- stripslashes = parsers.stripslashes
-
- luaotfload.default_config = default_config
- config.actions = {
- read = read,
- apply = apply,
- apply_defaults = apply_defaults,
- reconfigure = reconfigure,
- dump = dump,
- }
- if not apply_defaults () then
- logreport ("log", 0, "load",
- "Configuration unsuccessful: error loading default settings.")
- end
- return true
+return function ()
+ config.luaotfload = { }
+ logreport = luaotfload.log.report
+ local parsers = luaotfload.parsers
+ config_parser = parsers.config
+ stripslashes = parsers.stripslashes
+
+ luaotfload.default_config = default_config
+ config.actions = {
+ read = read,
+ apply = apply,
+ apply_defaults = apply_defaults,
+ reconfigure = reconfigure,
+ dump = dump,
+ }
+ if not apply_defaults () then
+ logreport ("log", 0, "load",
+ "Configuration unsuccessful: error loading default settings.")
end
-}
-
+ return true
+end
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-database.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-database.lua
index 322cd5e9144..0cff8f51b4b 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
local ProvidesLuaModule = {
name = "luaotfload-database",
- version = "2.98", --TAGVERSION
- date = "2019-07-04", --TAGDATE
+ version = "2.99", --TAGVERSION
+ date = "2019-08-11", --TAGDATE
description = "luaotfload submodule / database",
license = "GPL v2.0",
author = "Khaled Hosny, Elie Roux, Philipp Gesang, Marcel Krüger",
@@ -171,9 +171,8 @@ local stringsub = string.sub
local stringupper = string.upper
local tableconcat = table.concat
local tablesort = table.sort
-local utf8gsub = unicode.utf8.gsub
-local utf8lower = unicode.utf8.lower
-local utf8len = unicode.utf8.len
+local utf8len = utf8.len
+local utf8offset = utf8.offset
--- these come from Lualibs/Context
local filebasename = file.basename
@@ -203,6 +202,11 @@ local tabletohash = table.tohash
local tableserialize = table.serialize
local names = fonts and fonts.names or { }
+--- some of our own
+local unicode = require'luaotfload-unicode'
+local casefold = unicode.casefold
+local alphnum_only = unicode.alphnum_only
+
local name_index = nil --> upvalue for names.data
local lookup_cache = nil --> for names.lookups
@@ -235,11 +239,9 @@ end
--- string -> string
-local invalidchars = "[^%a%d]"
-
local sanitize_fontname = function (str)
if str ~= nil then
- str = utf8gsub (utf8lower (str), invalidchars, "")
+ str = alphnum_only(casefold(str, true))
return str
end
return nil
@@ -250,15 +252,11 @@ local sanitize_fontnames = function (rawnames)
for category, namedata in next, rawnames do
if type (namedata) == "string" then
- result [category] = utf8gsub (utf8lower (namedata),
- invalidchars,
- "")
+ result [category] = alphnum_only(casefold(namedata, true))
else
local target = { }
for field, name in next, namedata do
- target [field] = utf8gsub (utf8lower (name),
- invalidchars,
- "")
+ target [field] = alphnum_only(casefold(name, true))
end
result [category] = target
end
@@ -2239,7 +2237,7 @@ local truncate_string = function (str, restrict)
local len = utf8len (str)
if wd - len < 0 then
--- combined length exceeds terminal,
- str = ".." .. stringsub(str, len - wd + 2)
+ str = ".." .. stringsub(str, utf8offset(str, - wd + 2))
end
return str
end
@@ -3725,30 +3723,28 @@ local export = {
find_closest = find_closest,
}
-return {
- init = function ()
- --- the font loader namespace is “fonts”, same as in Context
- --- we need to put some fallbacks into place for when running
- --- as a script
- if not fonts then return false end
- logreport = luaotfload.log.report
- local fonts = fonts
- fonts.names = fonts.names or names
- fonts.formats = fonts.formats or { }
- fonts.definers = fonts.definers or { resolvers = { } }
-
- names.blacklist = blacklist
- -- MK Changed to rebuild with case insensitive fallback.
- -- Negative version to indicate generation by modified code.
- names.version = -1 --- decrease monotonically
- -- /MK
- names.data = nil --- contains the loaded database
- names.lookups = nil --- contains the lookup cache
-
- for sym, ref in next, export do names[sym] = ref end
- for sym, ref in next, api do names[sym] = names[sym] or ref end
- return true
- end
-}
+return function ()
+ --- the font loader namespace is “fonts”, same as in Context
+ --- we need to put some fallbacks into place for when running
+ --- as a script
+ if not fonts then return false end
+ logreport = luaotfload.log.report
+ local fonts = fonts
+ fonts.names = fonts.names or names
+ fonts.formats = fonts.formats or { }
+ fonts.definers = fonts.definers or { resolvers = { } }
+
+ names.blacklist = blacklist
+ -- MK Changed to rebuild with case insensitive fallback.
+ -- Negative version to indicate generation by modified code.
+ names.version = -1 --- decrease monotonically
+ -- /MK
+ names.data = nil --- contains the loaded database
+ names.lookups = nil --- contains the lookup cache
+
+ for sym, ref in next, export do names[sym] = ref end
+ for sym, ref in next, api do names[sym] = names[sym] or ref end
+ return true
+end
-- vim:tw=71:sw=4:ts=4:expandtab
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-diagnostics.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-diagnostics.lua
index 74fc4dcb542..d38ac5cc252 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 @@
local ProvidesLuaModule = {
name = "luaotfload-diagnostics",
- version = "2.98", --TAGVERSION
- date = "2019-07-04", --TAGDATE
+ version = "2.99", --TAGVERSION
+ date = "2019-08-11", --TAGDATE
description = "luaotfload-tool submodule / diagnostics",
license = "GPL v2.0"
}
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-embolden.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-embolden.lua
index f30e259e33a..3edc86c00a8 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 @@
local ProvidesLuaModule = {
name = "luaotfload-embolden",
- version = "2.98", --TAGVERSION
- date = "2019-07-04", --TAGDATE
+ version = "2.99", --TAGVERSION
+ date = "2019-08-11", --TAGDATE
description = "luaotfload submodule / color",
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 72f63a9b92f..6aff692ff7f 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 @@
local ProvidesLuaModule = {
name = "luaotfload-features",
- version = "2.98", --TAGVERSION
- date = "2019-07-04", --TAGDATE
+ version = "2.99", --TAGVERSION
+ date = "2019-08-11", --TAGDATE
description = "luaotfload submodule / features",
license = "GPL v2.0",
author = "Hans Hagen, Khaled Hosny, Elie Roux, Philipp Gesang, Marcel Krüger",
@@ -581,22 +581,16 @@ local add_auto_features = function ()
end
end
-return {
- init = function ()
+return function ()
+ logreport = luaotfload.log.report
- logreport = luaotfload.log.report
-
- if not fonts and fonts.handlers then
- logreport ("log", 0, "features",
- "OTF mechanisms missing -- did you forget to \z
- load a font loader?")
- return false
- end
-
- add_auto_features ()
-
- return true
+ if not fonts and fonts.handlers then
+ logreport ("log", 0, "features",
+ "OTF mechanisms missing -- did you forget to \z
+ load a font loader?")
+ return false
end
-}
-
+ add_auto_features ()
+ return true
+end
-- vim:tw=79:sw=4:ts=4:expandtab
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-filelist.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-filelist.lua
index 78ffeb1aaf4..6f141da033c 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 @@
local ProvidesLuaModule = {
name = "luaotfload-filelist",
- version = "2.98", --TAGVERSION
- date = "2019-07-04", --TAGDATE
+ version = "2.99", --TAGVERSION
+ date = "2019-08-11", --TAGDATE
description = "luaotfload submodule / filelist",
license = "GPL v2.0"
}
@@ -251,6 +251,7 @@ luaotfload.filelist.data =
{ name = "loaders" ,kind = kind_library, ext =".lua", gitdir=gitdirsrc, texdir=texdirtex, gitpref = "luaotfload-" },
{ name = "parsers" ,kind = kind_library, ext =".lua", gitdir=gitdirsrc, texdir=texdirtex, gitpref = "luaotfload-" },
{ name = "resolvers" ,kind = kind_library, ext =".lua", gitdir=gitdirsrc, texdir=texdirtex, gitpref = "luaotfload-" },
+ { name = "unicode" ,kind = kind_library, ext =".lua", gitdir=gitdirsrc, texdir=texdirtex, gitpref = "luaotfload-" },
{ name = "characters" ,kind = kind_generated, ext =".lua", gitdir=gitdirgen, texdir=texdirtex, gitpref = "luaotfload-", script="mkcharacter" },
{ name = "glyphlist" ,kind = kind_generated, ext =".lua", gitdir=gitdirgen, texdir=texdirtex, gitpref = "luaotfload-", script="mkglyphlist" },
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-glyphlist.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-glyphlist.lua
index 06294e5b44e..e663f3d6a2f 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-glyphlist.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-glyphlist.lua
@@ -1,7 +1,7 @@
local ProvidesLuaModule = {
name = "luaotfload-glyphlist",
- version = "2.98", --TAGVERSION
- date = "2019-07-04", --TAGDATE
+ version = "2.99", --TAGVERSION
+ date = "2019-08-11", --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-init.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-init.lua
index e578e7b1845..bd0242aac5c 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 @@
local ProvidesLuaModule = {
name = "luaotfload-init",
- version = "2.98", --TAGVERSION
- date = "2019-07-04", --TAGDATE
+ version = "2.99", --TAGVERSION
+ date = "2019-08-11", --TAGDATE
description = "luaotfload submodule / initialization",
license = "GPL v2.0"
}
@@ -78,44 +78,6 @@ local logreport --- filled in after loading the log module
--doc]]--
-local glyph_codes =
- { [0] = "character"
- , [1] = "glyph"
- , [2] = "ligature"
- , [3] = "ghost"
- , [4] = "left"
- , [5] = "right"
- }
-
-local disc_codes =
- { [0] = "discretionary"
- , [1] = "explicit"
- , [2] = "automatic"
- , [3] = "regular"
- , [4] = "first"
- , [5] = "second"
- }
-
-local node_types = { disc = disc_codes, glyph = glyph_codes }
-
-local luatex_stubs = function ()
- if not node.subtypes then
- node.subtypes = function (t) return node_types [t] or { } end
- local direct = node.direct
-
- local getfield = direct.getfield
- local setfield = direct.setfield
-
- direct.setchar = direct.setchar or function (n, ...) setfield (n, "char", ...) end
- direct.setprev = direct.setprev or function (n, ...) setfield (n, "prev", ...) end
- direct.setnext = direct.setnext or function (n, ...) setfield (n, "next", ...) end
-
- direct.getchar = direct.getchar or function (n) getfield (n, "char") end
- direct.getprev = direct.getprev or function (n) getfield (n, "prev") end
- direct.getnext = direct.getnext or function (n) getfield (n, "next") end
- end
-end
-
local init_early = function ()
local store = { }
@@ -132,8 +94,6 @@ local init_early = function ()
if not lualibs then error "this module requires Luaotfload" end
if not luaotfload then error "this module requires Luaotfload" end
- luatex_stubs ()
-
--[[doc--
The logger needs to be in place prior to loading the fontloader due
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-letterspace.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-letterspace.lua
index 071f737053c..180d1ca57c4 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 @@
local ProvidesLuaModule = {
name = "luaotfload-letterspace",
- version = "2.98", --TAGVERSION
- date = "2019-07-04", --TAGDATE
+ version = "2.99", --TAGVERSION
+ date = "2019-08-11", --TAGDATE
description = "luaotfload submodule / color",
license = "GPL v2.0",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-loaders.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-loaders.lua
index 5c9e9d01192..e193b78d350 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 @@
local ProvidesLuaModule = {
name = "luaotfload-loaders",
- version = "2.98", --TAGVERSION
- date = "2019-07-04", --TAGDATE
+ version = "2.99", --TAGVERSION
+ date = "2019-08-11", --TAGDATE
description = "luaotfload submodule / callback handling",
license = "GPL v2.0"
}
@@ -226,18 +226,15 @@ local install_callbacks = function ()
return true
end
-return {
- init = function ()
- local ret = true
- if not install_formats () then
- logreport ("log", 0, "loaders", "Error initializing OFM/PF{A,B} loaders.")
- ret = false
- end
- if not install_callbacks () then
- logreport ("log", 0, "loaders", "Error installing font loader callbacks.")
- ret = false
- end
- return ret
+return function ()
+ if not install_formats () then
+ logreport ("log", 0, "loaders", "Error initializing OFM/PF{A,B} loaders.")
+ return false
end
-}
+ if not install_callbacks () then
+ logreport ("log", 0, "loaders", "Error installing font loader callbacks.")
+ return false
+ end
+ return true
+end
-- vim:tw=79:sw=2:ts=2:expandtab
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-log.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-log.lua
index 4b8f4670437..ebb379d0f92 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 @@
local ProvidesLuaModule = {
name = "luaotfload-log",
- version = "2.98", --TAGVERSION
- date = "2019-07-04", --TAGDATE
+ version = "2.99", --TAGVERSION
+ date = "2019-08-11", --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-main.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-main.lua
index 12b364355e6..280a28a77b8 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-main.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-main.lua
@@ -20,8 +20,8 @@ local authors = "\z
-- version number is used below!
local ProvidesLuaModule = {
name = "luaotfload-main",
- version = "2.98", --TAGVERSION
- date = "2019-07-04", --TAGDATE
+ version = "2.99", --TAGVERSION
+ date = "2019-08-11", --TAGDATE
description = "luaotfload entry point",
author = authors,
copyright = authors,
@@ -236,22 +236,20 @@ local install_loaders = function ()
loaders.initialize = function (name)
local tmp = loadmodule (name)
local logreport = luaotfload.log.report
- if type (tmp) == "table" then
- local init = tmp.init
- if init and type (init) == "function" then
- local t_0 = osgettimeofday ()
- if not init () then
- logreport ("log", 0, "load",
- "Failed to load module “%s”.", name)
- return
- end
- local t_end = osgettimeofday ()
- local d_t = t_end - t_0
- logreport ("log", 4, "load",
- "Module “%s” loaded in %d ms.",
- name, d_t)
- timing_info.t_init [name] = d_t
+ local init = type(tmp) == "table" and tmp.init or tmp
+ if init and type (init) == "function" then
+ local t_0 = osgettimeofday ()
+ if not init () then
+ logreport ("log", 0, "load",
+ "Failed to load module “%s”.", name)
+ return
end
+ local t_end = osgettimeofday ()
+ local d_t = t_end - t_0
+ logreport ("log", 4, "load",
+ "Module “%s” loaded in %d ms.",
+ name, d_t)
+ timing_info.t_init [name] = d_t
end
end
@@ -291,8 +289,8 @@ luaotfload.main = function ()
initialize "database" --- Font management.
initialize "colors" --- Per-font colors.
- luaotfload.resolvers = loadmodule "resolvers" --- Font lookup
- luaotfload.resolvers.init ()
+ local init_resolvers = loadmodule "resolvers" --- Font lookup
+ init_resolvers ()
if not config.actions.reconfigure () then
logreport ("log", 0, "load", "Post-configuration hooks failed.")
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-notdef.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-notdef.lua
index a5ab257f2d9..74efafe04cd 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 @@
local ProvidesLuaModule = {
name = "luaotfload-notdef",
- version = "2.98", --TAGVERSION
- date = "2019-07-04", --TAGDATE
+ version = "2.99", --TAGVERSION
+ date = "2019-08-11", --TAGDATE
description = "luaotfload submodule / color",
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 39e17362418..2ef984f8e4a 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 @@
local ProvidesLuaModule = {
name = "luaotfload-parsers",
- version = "2.98", --TAGVERSION
- date = "2019-07-04", --TAGDATE
+ version = "2.99", --TAGVERSION
+ date = "2019-08-11", --TAGDATE
description = "luaotfload submodule / filelist",
license = "GPL v2.0"
}
@@ -780,22 +780,20 @@ local parse_config = Ct (ini_sections)
--doc]=]--
-return {
- init = function ()
- logreport = luaotfload.log.report
- luaotfload.parsers = {
- --- parameters
- traversal_maxdepth = traversal_maxdepth,
- --- main parsers
- read_fonts_conf = read_fonts_conf,
- font_request = font_request,
- config = parse_config,
- --- common patterns
- stripslashes = stripslashes,
- splitcomma = splitcomma,
- }
- return true
- end
-}
+return function ()
+ logreport = luaotfload.log.report
+ luaotfload.parsers = {
+ --- parameters
+ traversal_maxdepth = traversal_maxdepth,
+ --- main parsers
+ read_fonts_conf = read_fonts_conf,
+ font_request = font_request,
+ config = parse_config,
+ --- common patterns
+ stripslashes = stripslashes,
+ splitcomma = splitcomma,
+ }
+ return true
+end
-- vim:ft=lua:tw=71:et:sw=2:sts=4:ts=8
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-resolvers.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-resolvers.lua
index eeb706eb1d2..a45d726124f 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 @@
local ProvidesLuaModule = {
name = "luaotfload-resolvers",
- version = "2.98", --TAGVERSION
- date = "2019-07-04", --TAGDATE
+ version = "2.99", --TAGVERSION
+ date = "2019-08-11", --TAGDATE
description = "luaotfload submodule / resolvers",
license = "GPL v2.0"
}
@@ -117,8 +117,7 @@ local function resolve_name (specification)
logreport ("log", 1, "resolve", "name lookup %q -> \"%s%s\"",
specification.name, resolved,
subfont and stringformat ("(%d)", subfont) or "")
- specification.sub = subfont
- return resolved
+ return resolved, tonumber(subfont)
end
return resolve_file (specification)
end
@@ -244,11 +243,16 @@ end
local function wrap_resolver(resolver)
return function (specification)
- local filename, forced = resolver(specification)
+ local filename, sub, forced = resolver(specification)
+ if type(sub) ~= "number" then
+ forced = sub
+ sub = nil
+ end
if filename then
specification.resolved = filename
specification.filename = filename
specification.name = filename
+ specification.sub = sub or specification.sub
specification.forced = specification.forced or forced
if not specification.forced then
local suffix = stringlower (filesuffix (filename))
@@ -275,28 +279,25 @@ local resolvers = table.merge(luaotfload.resolvers, {
})
luaotfload.resolvers = resolvers
-return {
- init = function ( )
- if luatexbase and luatexbase.create_callback then
- luatexbase.create_callback ("luaotfload.resolve_font",
- "exclusive", function () end)
- end
- logreport ("log", 5, "resolvers", "installing font resolvers", name)
- local request_resolvers = fonts.definers.resolvers
- for k, _ in pairs(resolvers) do
- request_resolvers[k] = nil
- end
- setmetatable(request_resolvers, {__index = function(t, n)
- if not resolvers[n] then return end
- local wrapped = wrap_resolver(resolvers[n])
- t[n] = wrapped
- return wrapped
- end})
- fonts.formats.ofm = "type1"
- fonts.encodings = fonts.encodings or { }
- fonts.encodings.known = fonts.encodings.known or { }
- return true
- end, --- [.init]
-}
-
+return function()
+ if luatexbase and luatexbase.create_callback then
+ luatexbase.create_callback ("luaotfload.resolve_font",
+ "exclusive", function () end)
+ end
+ logreport ("log", 5, "resolvers", "installing font resolvers", name)
+ local request_resolvers = fonts.definers.resolvers
+ for k, _ in pairs(resolvers) do
+ request_resolvers[k] = nil
+ end
+ setmetatable(request_resolvers, {__index = function(t, n)
+ if not resolvers[n] then return end
+ local wrapped = wrap_resolver(resolvers[n])
+ t[n] = wrapped
+ return wrapped
+ end})
+ fonts.formats.ofm = "type1"
+ fonts.encodings = fonts.encodings or { }
+ fonts.encodings.known = fonts.encodings.known or { }
+ return true
+end
--- vim:ft=lua:ts=8:sw=4:et:tw=79
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-status.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-status.lua
index ddf53c29960..f3065ef547a 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-status.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-status.lua
@@ -1,18 +1,18 @@
return {
["hashes"]={
- { "fontloader-2019-07-04.lua", "ecbc47be678c3cde76fac1c793213284" },
+ { "fontloader-2019-08-11.lua", "f2f8385defe9a85e335b767930543e48" },
{ "fontloader-util-fil.lua", "4bb3e4dc72e308d8ed67cd7a80027fa7" },
- { "fontloader-util-str.lua", "a09020dcaed195ea9acaace2b7b9a66f" },
+ { "fontloader-util-str.lua", "3c829af0b336703e62cb5a1cb7a6e503" },
{ "fontloader-l-unicode.lua", "d46cc6cf18fb3f368ef1e404dc9fcb5c" },
{ "fontloader-l-math.lua", "a373be3ed2db0d5f98588fa81abca48f" },
{ "fontloader-l-boolean.lua", "18ed6c4b2c40dd87224ea33229548d20" },
{ "fontloader-l-file.lua", "3d6ea476061292a0da98c3f65cdabe46" },
{ "fontloader-l-io.lua", "42608ad95eb2822fdc370d1c11f08fb5" },
- { "fontloader-l-table.lua", "bc6b9fca25a9d65bead10e250db68bb1" },
+ { "fontloader-l-table.lua", "63b13279139d2f94d29238b0d6242330" },
{ "fontloader-l-string.lua", "e1347bef0eeeff9f098df83b30b32df9" },
{ "fontloader-l-function.lua", "f771cc91839ebcdfc094083434fbe00f" },
{ "fontloader-l-lpeg.lua", "a5364ddabb490408da9276ea7f7a7ba1" },
- { "fontloader-l-lua.lua", "10134a2dd786bd16b69377eaddab2906" },
+ { "fontloader-l-lua.lua", "9e5e9d4f3b8f9e337f28aa2322192b94" },
{ "fontloader-fonts-gbn.lua", "d25472d54c4841db43a745764a63533e" },
{ "fontloader-fonts-lig.lua", "b9dbe77ce747d4c35bb2a20ffbe5aa51" },
{ "fontloader-fonts-ext.lua", "01015ab3758cdc2af29394e6d502a91a" },
@@ -30,60 +30,61 @@ return {
{ "fontloader-font-lua.lua", "55b281fb98f7bd848fc19928f376f647" },
{ "fontloader-font-afk.lua", "54d554530e75c57c56ee76234724e26d" },
{ "fontloader-font-one.lua", "987c5c5ed3754ad2feab80985067d59e" },
- { "fontloader-font-onr.lua", "20b0d2753f58ff91180947ce4078571e" },
+ { "fontloader-font-onr.lua", "d4d2449b4084e6afb1837ae5835082cc" },
{ "fontloader-font-otc.lua", "95a4ff28ba4afb55a978a4aecfd688bf" },
{ "fontloader-font-ocl.lua", "b720867fb19a23f0b50377efd2a3c54a" },
{ "fontloader-font-osd.lua", "79eb2fc4a71364fd73c8b996a109f5df" },
{ "fontloader-font-ots.lua", "d5504847a278385cd0d20ecf1b3d59cc" },
{ "fontloader-font-ota.lua", "d6dfb94563d6a52675e274b2e673e4a6" },
{ "fontloader-font-otj.lua", "66c7a910d95d4a52b81061de776898e1" },
- { "fontloader-font-oto.lua", "54ea5c823993e536950b2245e94aee93" },
- { "fontloader-font-otl.lua", "b041e8512af19d28edbbebc683f7cd51" },
+ { "fontloader-font-oto.lua", "52804afd96f4be005f513a012b874668" },
+ { "fontloader-font-otl.lua", "940f9c5ad84f4968a8488f4da2d15e2d" },
{ "fontloader-font-oup.lua", "669e479e716999edc626a1f045bd76fa" },
{ "fontloader-font-dsp.lua", "b5bf2f1c198e027a0d4ededcdf3947b4" },
- { "fontloader-font-ttf.lua", "f2d53377b264d59368703e659a7bc228" },
- { "fontloader-font-cff.lua", "7ff1a757f6a26f57f635014cc8a174fe" },
+ { "fontloader-font-ttf.lua", "44e61cef50dab9b1aaf48130f9367c34" },
+ { "fontloader-font-cff.lua", "98d5a660ea803b65cb883c009ecf3c0b" },
{ "fontloader-font-ott.lua", "aba6d8335a5f38a5a62d3631492f3392" },
{ "fontloader-font-oti.lua", "dbae7722baae24d917a17176553825cf" },
- { "fontloader-font-otr.lua", "340999eb6c53879787a7560bc1a30360" },
+ { "fontloader-font-otr.lua", "b1c03925c949027c86f781785fa7a208" },
{ "fontloader-font-vfc.lua", "94937140f2c909e9c831ba021f1ab303" },
{ "fontloader-font-map.lua", "f486746e90fe972de4b73e208ac7cbb2" },
{ "fontloader-font-cid.lua", "4d87988efa86020a14708ee03c23415f" },
- { "fontloader-font-con.lua", "f7d973760207e820b954a1e478a6a347" },
+ { "fontloader-font-con.lua", "ca733211a0555d9a93b1e2f7ebc937d3" },
{ "fontloader-font-ini.lua", "4299a02110bbd7c0d27e131235c5319d" },
{ "fontloader-data-con.lua", "7ce546725b1550f655c78ac9d69419ca" },
- { "fontloader-reference.lua", "e4e7faea340329c82b338804d5860368" },
+ { "fontloader-reference.lua", "759787e7ee75437382c0a2c4f8fe3b81" },
{ "fontloader-basics-gen.lua", "b21e91bbd534f77e368f0ec13f865aed" },
{ "mktests", "c7cff7025962922944376acc1ffa9c47" },
- { "mkstatus", "54c20ea0757ef99b5f01b7c6bdeb69f4" },
+ { "mkstatus", "603f9a6281988c8f6e48fa6d2b01f4f2" },
{ "mkcharacters", "92c24bb582fc84c0365634f29eb89863" },
{ "mkglyphlist", "557836886d4f0e6d656eac3ded4456a2" },
{ "mkimport", "60e0b11a1a68719033e86a3e0f4d5e86" },
- { "luaotfload-glyphlist.lua", "cb00ea9b0aa15756c768ab6270d8f9f6" },
+ { "luaotfload-glyphlist.lua", "65cb87f152fda4c0951ba7c5f0ab6809" },
{ "luaotfload-characters.lua", "593ce9dccf6ddc4f7d4be0514f581102" },
- { "luaotfload-resolvers.lua", "aa5b547c46529f1d61afb611d1aa0bc1" },
- { "luaotfload-parsers.lua", "07697fd60be0e731bca7252b8f0b1b60" },
- { "luaotfload-loaders.lua", "9649f7747c8a87237d037ee2c9d9aaa3" },
- { "luaotfload-notdef.lua", "7b0ccdbc629638230f715da857747e10" },
- { "luaotfload-embolden.lua", "dd7153f9fcca37f251d44f8769e6368a" },
- { "luaotfload-letterspace.lua", "61a7479fe93af06bb1a01a5f86ce1068" },
- { "luaotfload-features.lua", "4a784f251797b79b65742e3405ed94c0" },
- { "luaotfload-database.lua", "582da708e2bbcd5f7ed283b9da059883" },
- { "luaotfload-configuration.lua", "a9fc3f22a1c4b828668bdedc8105db8a" },
- { "luaotfload-colors.lua", "71377fb41bae4f4958c34999a73282b8" },
- { "luaotfload-auxiliary.lua", "73c4a8e13f0ac20a86406213e178a839" },
- { "luaotfload-filelist.lua", "99fe8524d86d61f5e261abf550c54187" },
- { "luaotfload-tool.lua", "ad691c108c79b4417f1b957584faf366" },
- { "luaotfload-diagnostics.lua", "941490076281ab08383d987464c76011" },
- { "luaotfload-log.lua", "aaa3ae3dffa7bf888a8f14fd2181d81c" },
- { "luaotfload-init.lua", "7ca1c4fd2bb50eb89f485fe6e7b12e7a" },
- { "luaotfload-main.lua", "1212b51ec3865dc30898d0e43b1e0555" },
+ { "luaotfload-unicode.lua", "a473dc832e9e0cef6862ec70e7927474" },
+ { "luaotfload-resolvers.lua", "3290274d8bb49d930e76528865f81899" },
+ { "luaotfload-parsers.lua", "36e8c2ff43fcc4308005db0c2ed884b3" },
+ { "luaotfload-loaders.lua", "7a69f7c97c82b46d8028e41b07eb2eed" },
+ { "luaotfload-notdef.lua", "92161275f17417f4e6d5d5ec0ae1df57" },
+ { "luaotfload-embolden.lua", "6bfbd38350f3ff9f9a8d71020dcf9881" },
+ { "luaotfload-letterspace.lua", "d6987792121f8690d9e4e6f860a3fd1c" },
+ { "luaotfload-features.lua", "adcf8a1ab0763d39f700ee0ef2fe9053" },
+ { "luaotfload-database.lua", "f9a4521bdaeb00a20b4f5eb36516a4ee" },
+ { "luaotfload-configuration.lua", "39561327149f8bf0330bae91c6e1acfe" },
+ { "luaotfload-colors.lua", "d520998ec59d1df82d8c893c1b96f36d" },
+ { "luaotfload-auxiliary.lua", "8204efea40f4eab1f20644eb1392ef69" },
+ { "luaotfload-filelist.lua", "12ae678f899c650160be9344397c4b37" },
+ { "luaotfload-tool.lua", "9dc7826470a75286b97f1f384d942917" },
+ { "luaotfload-diagnostics.lua", "c791c5894ba0a3207ad2eeee54148467" },
+ { "luaotfload-log.lua", "cd7bff9876c56964b62f3a7681260735" },
+ { "luaotfload-init.lua", "535e94ca91d47958cb45f88cf6c84d1e" },
+ { "luaotfload-main.lua", "8a8584a87cb676a1522683f130ffab86" },
},
["notes"]={
["committer"]="Ulrike Fischer <fischer@troubleshooting-tex.de>",
- ["description"]="v2.98",
- ["loader"]="fontloader-2019-07-04.lua",
- ["revision"]="aed2845ed28088243e91589a2707e3c0d8a12e50",
- ["timestamp"]="2019-07-14 16:41:58 +0200",
+ ["description"]="v2.99/2019-08-11",
+ ["loader"]="fontloader-2019-08-11.lua",
+ ["revision"]="0e00bc101765fb226290691a56646acb5bbbcf3c",
+ ["timestamp"]="2019-08-13 20:20:29 +0200",
},
} \ No newline at end of file
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-unicode.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-unicode.lua
new file mode 100644
index 00000000000..cdd9925549f
--- /dev/null
+++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-unicode.lua
@@ -0,0 +1,109 @@
+-----------------------------------------------------------------------
+-- FILE: luaotfload-unicode.lua
+-- DESCRIPTION: part of luaotfload / unicode
+-----------------------------------------------------------------------
+
+local ProvidesLuaModule = {
+ name = "luaotfload-unicode",
+ version = "2.99", --TAGVERSION
+ date = "2019-08-11", --TAGDATE
+ description = "luaotfload submodule / Unicode helpers",
+ license = "CC0 1.0 Universal",
+ author = "Marcel Krüger"
+}
+
+if luatexbase and luatexbase.provides_module then
+ luatexbase.provides_module (ProvidesLuaModule)
+end
+
+local utf8codes = utf8.codes
+local utf8char = utf8.char
+local sub = string.sub
+local unpack = table.unpack
+local concat = table.concat
+local move = table.move
+
+local codepoint = lpeg.S'0123456789ABCDEF'^4/function(c)return tonumber(c, 16)end
+local empty = {}
+local result = {}
+
+local casefold do
+ local nl = ('#' * (1-lpeg.P'\n')^0)^-1 * '\n'
+ local entry = codepoint * "; " * lpeg.C(1) * ";" * lpeg.Ct((' ' * codepoint)^1) * "; " * nl
+ local file = lpeg.Cf(
+ lpeg.Ct(
+ lpeg.Cg(lpeg.Ct"", "C")
+ * lpeg.Cg(lpeg.Ct"", "F")
+ * lpeg.Cg(lpeg.Ct"", "S")
+ * lpeg.Cg(lpeg.Ct"", "T"))
+ * nl^0 * lpeg.Cg(entry)^0 * nl^0 * -1
+ , function(t, base, class, mapping)
+ rawset(rawget(t, class), base, mapping)
+ return t
+ end)
+
+ local f = io.open(kpse.find_file"CaseFolding.txt")
+ local data = file:match(f:read'*a')
+ f:close()
+ function casefold(s, full, special)
+ local first = special and data.T or empty
+ local second = data.C
+ local third = full and data.F or data.S
+ local result = result
+ for i = #result, 1, -1 do result[i] = nil end
+ local i = 1
+ for _, c in utf8codes(s) do
+ local datum = first[c] or second[c] or third[c]
+ if datum then
+ local l = #datum
+ move(datum, 1, l, i, result)
+ i = i + l
+ else
+ result[i] = c
+ i = i + 1
+ end
+ end
+ return utf8char(unpack(result))
+ end
+end
+
+local alphnum_only do
+ local niceentry = lpeg.Cg(codepoint * ';' * (1-lpeg.P';')^0 * ';' * lpeg.S'LN' * lpeg.Cc(true))
+ local entry = niceentry^0 * (1-lpeg.P'\n')^0 * lpeg.P'\n'
+ local file = lpeg.Cf(
+ lpeg.Ct''
+ * entry^0
+ , rawset)
+
+ local f = io.open(kpse.find_file"UnicodeData.txt")
+ local data = file:match(f:read'*a')
+ f:close()
+ function alphnum_only(s)
+ local result = result
+ for i = #result, 1, -1 do result[i] = nil end
+ local nice = nil
+ for p, c in utf8codes(s) do
+ if data[c]
+ or (c >= 0x3400 and c<= 0x3DB5)
+ or (c >= 0x4E00 and c<= 0x9FEF)
+ or (c >= 0xAC00 and c<= 0xD7A3)
+ then
+ if not nice then nice = p end
+ else
+ if nice then
+ result[#result + 1] = sub(s, nice, p-1)
+ nice = nil
+ end
+ end
+ end
+ if nice then
+ result[#result + 1] = sub(s, nice, #s)
+ end
+ return concat(result)
+ end
+end
+
+return {
+ casefold = casefold,
+ alphnum_only = alphnum_only,
+}
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.sty b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.sty
index 44b28377990..d77600c9175 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.sty
+++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.sty
@@ -40,7 +40,7 @@
\fi
\ifdefined\ProvidesPackage
\ProvidesPackage{luaotfload}%
- [2019/07/04 v2.98 OpenType layout system]
+ [2019/08/11 v2.99 OpenType layout system]
\fi
\directlua{
if xpcall(function ()%