summaryrefslogtreecommitdiff
path: root/tex/generic
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2016-03-12 17:15:10 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2016-03-12 17:15:10 +0100
commit4b6314243d4bc44fa3c94f569264fdffd5405e90 (patch)
treea50e4f3309d40b2709618a00311934c55258cfbc /tex/generic
parent4a28e5cee346738f2f9be479090c3657a87b7206 (diff)
downloadcontext-4b6314243d4bc44fa3c94f569264fdffd5405e90.tar.gz
2016-03-12 16:45:00
Diffstat (limited to 'tex/generic')
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua57
1 files changed, 32 insertions, 25 deletions
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 8b411ce15..5ed9f2e36 100644
--- a/tex/generic/context/luatex/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
-- merged file : c:/data/develop/context/sources/luatex-fonts-merged.lua
-- parent file : c:/data/develop/context/sources/luatex-fonts.lua
--- merge date : 03/04/16 10:39:33
+-- merge date : 03/12/16 16:42:37
do -- begin closure to overcome local limits and interference
@@ -7212,7 +7212,7 @@ local type,next,tonumber,tostring=type,next,tonumber,tostring
local abs=math.abs
local reversed,concat,insert,remove,sortedkeys=table.reversed,table.concat,table.insert,table.remove,table.sortedkeys
local ioflush=io.flush
-local fastcopy,tohash,derivetable=table.fastcopy,table.tohash,table.derive
+local fastcopy,tohash,derivetable,copy=table.fastcopy,table.tohash,table.derive,table.copy
local formatters=string.formatters
local P,R,S,C,Ct,lpegmatch=lpeg.P,lpeg.R,lpeg.S,lpeg.C,lpeg.Ct,lpeg.match
local setmetatableindex=table.setmetatableindex
@@ -7237,7 +7237,7 @@ local report_otf=logs.reporter("fonts","otf loading")
local fonts=fonts
local otf=fonts.handlers.otf
otf.glists={ "gsub","gpos" }
-otf.version=2.820
+otf.version=2.823
otf.cache=containers.define("fonts","otf",otf.version,true)
local hashes=fonts.hashes
local definers=fonts.definers
@@ -7375,6 +7375,7 @@ local valid_fields=table.tohash {
"isserif",
"italicangle",
"macstyle",
+ "notdef_loc",
"onlybitmaps",
"origname",
"os2_version",
@@ -7773,7 +7774,6 @@ local function somecopy(old)
end
end
actions["prepare glyphs"]=function(data,filename,raw)
- local tableversion=tonumber(raw.table_version) or 0
local rawglyphs=raw.glyphs
local rawsubfonts=raw.subfonts
local rawcidinfo=raw.cidinfo
@@ -7787,6 +7787,7 @@ actions["prepare glyphs"]=function(data,filename,raw)
local indices=resources.indices
local duplicates=resources.duplicates
local variants=resources.variants
+ local notdefindex=-1
if rawsubfonts then
metadata.subfonts=includesubfonts and {}
properties.cidinfo=rawcidinfo
@@ -7806,15 +7807,12 @@ actions["prepare glyphs"]=function(data,filename,raw)
if includesubfonts then
metadata.subfonts[cidindex]=somecopy(subfont)
end
- local cidcnt,cidmin,cidmax
- if tableversion>0.3 then
- cidcnt=subfont.glyphcnt
- cidmin=subfont.glyphmin
- cidmax=subfont.glyphmax
- else
- cidcnt=subfont.glyphcnt
- cidmin=0
- cidmax=cidcnt-1
+ local cidcnt=subfont.glyphcnt
+ local cidmin=subfont.glyphmin
+ local cidmax=subfont.glyphmax
+ local notdef=(tonumber(raw.table_version) or 0)>0.4 and subfont.notdef_loc or -1
+ if notdeffound==-1 and notdef>=0 then
+ notdeffound=notdef
end
if trace_subfonts then
local cidtot=cidmax-cidmin+1
@@ -7822,10 +7820,9 @@ actions["prepare glyphs"]=function(data,filename,raw)
report_otf("subfont: %i, min: %i, max: %i, cnt: %i, n: %i",cidindex,cidmin,cidmax,cidtot,cidcnt)
end
if cidcnt>0 then
- for cidslot=cidmin,cidmax do
- local glyph=cidglyphs[cidslot]
+ for index=cidmin,cidmax do
+ local glyph=cidglyphs[index]
if glyph then
- local index=tableversion>0.3 and glyph.orig_pos or cidslot
if trace_subfonts then
unique[index]=true
end
@@ -7869,8 +7866,7 @@ actions["prepare glyphs"]=function(data,filename,raw)
local description={
boundingbox=glyph.boundingbox,
name=name or "unknown",
- cidindex=cidindex,
- index=cidslot,
+ index=index,
glyph=glyph,
}
descriptions[unicode]=description
@@ -7913,8 +7909,9 @@ actions["prepare glyphs"]=function(data,filename,raw)
end
else
local cnt=raw.glyphcnt or 0
- local min=tableversion>0.3 and raw.glyphmin or 0
- local max=tableversion>0.3 and raw.glyphmax or (raw.glyphcnt-1)
+ local min=raw.glyphmin or 0
+ local max=raw.glyphmax or (raw.glyphcnt-1)
+ notdeffound=(tonumber(raw.table_version) or 0)>0.4 and raw.notdef_loc or -1
if cnt>0 then
for index=min,max do
local glyph=rawglyphs[index]
@@ -7985,6 +7982,12 @@ actions["prepare glyphs"]=function(data,filename,raw)
report_otf("potential problem: no glyphs found")
end
end
+ if notdeffound==-1 then
+ report_otf("warning: no .notdef found in %a",filename)
+ elseif notdeffound~=0 then
+ report_otf("warning: .notdef found at position %a in %a",notdeffound,filename)
+ end
+ metadata.notdef=notdeffound
resources.private=private
end
actions["check encoding"]=function(data,filename,raw)
@@ -8052,7 +8055,7 @@ actions["add duplicates"]=function(data,filename,raw)
local unicodes=resources.unicodes
local indices=resources.indices
local duplicates=resources.duplicates
- for unicode,d in next,duplicates do
+ for unicode,d in table.sortedhash(duplicates) do
local nofduplicates=#d
if nofduplicates>4 then
if trace_loading then
@@ -8077,11 +8080,11 @@ actions["add duplicates"]=function(data,filename,raw)
end
end
if u>0 then
- local duplicate=table.copy(description)
+ local duplicate=copy(description)
duplicate.comment=formatters["copy of %U"](unicode)
descriptions[u]=duplicate
if trace_loading then
- report_otf("duplicating %U to %U with index %H (%s kerns)",unicode,u,description.index,n)
+ report_otf("duplicating %06U to %06U with index %H (%s kerns)",unicode,u,description.index,n)
end
end
end
@@ -8883,8 +8886,9 @@ actions["check metadata"]=function(data,filename,raw)
ttftables[i].data="deleted"
end
end
+ local state=metadata.validation_state
local names=raw.names
- if metadata.validation_state and table.contains(metadata.validation_state,"bad_ps_fontname") then
+ if state and table.contains(state,"bad_ps_fontname") then
local function valid(what)
if names then
for i=1,#names do
@@ -8939,6 +8943,9 @@ actions["check metadata"]=function(data,filename,raw)
end
metadata.psname=psname
end
+ if state and table.contains(state,"bad_cmap_table") then
+ report_otf("fontfile %a has bad cmap tables",filename)
+ end
end
actions["cleanup tables"]=function(data,filename,raw)
local duplicates=data.resources.duplicates
@@ -12260,7 +12267,7 @@ function handlers.gsub_ligature(head,start,kind,lookupname,ligature,sequence)
end
return head,start,false,discfound
end
-function handlers.gpos_single(head,start,kind,lookupname,kerns,sequence,injection)
+function handlers.gpos_single(head,start,kind,lookupname,kerns,sequence,lookuphash,i,injection)
local startchar=getchar(start)
local dx,dy,w,h=setpair(start,tfmdata.parameters.factor,rlmode,sequence.flags[4],kerns,injection)
if trace_kerns then