summaryrefslogtreecommitdiff
path: root/tex/generic
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2018-10-10 21:09:32 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2018-10-10 21:09:32 +0200
commit9f36318b0e571bcbc93dc2112d01bbf2178ed020 (patch)
treed6b075357717f7fde0bdf73aa364dbbca5417c50 /tex/generic
parent753dd0cbafc567d4960c5fc4888ccb4e2302c64d (diff)
downloadcontext-9f36318b0e571bcbc93dc2112d01bbf2178ed020.tar.gz
2018-10-08 17:52:00
Diffstat (limited to 'tex/generic')
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua32
1 files changed, 25 insertions, 7 deletions
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index adc2c6202..90f8f4f00 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 : 10/03/18 16:02:19
+-- merge date : 10/08/18 17:44:41
do -- begin closure to overcome local limits and interference
@@ -14218,7 +14218,7 @@ if not modules then modules={} end modules ['font-cff']={
}
local next,type,tonumber=next,type,tonumber
local byte,char,gmatch=string.byte,string.char,string.gmatch
-local concat,remove=table.concat,table.remove
+local concat,remove,unpack=table.concat,table.remove,table.unpack
local floor,abs,round,ceil,min,max=math.floor,math.abs,math.round,math.ceil,math.min,math.max
local P,C,R,S,C,Cs,Ct=lpeg.P,lpeg.C,lpeg.R,lpeg.S,lpeg.C,lpeg.Cs,lpeg.Ct
local lpegmatch=lpeg.match
@@ -20851,7 +20851,7 @@ local function checklookups(fontdata,missing,nofmissing)
end
end
if next(done) then
- report_unicode("not unicoded: % t",sortedkeys(done))
+ report_unicodes("not unicoded: % t",sortedkeys(done))
end
end
end
@@ -21040,9 +21040,25 @@ local function unifyglyphs(fontdata,usenames)
fontdata.hashmethod=hashmethod
return indices,names
end
-local p_bogusname=(
- (P("uni")+P("UNI")+P("Uni")+P("U")+P("u"))*S("Xx")^0*R("09","AF")^1+(P("identity")+P("Identity")+P("IDENTITY"))*R("09","AF")^1+(P("index")+P("Index")+P("INDEX"))*R("09")^1
-)*(P(-1)+P("."))
+local p_crappyname do
+ local p_hex=R("af","AF","09")
+ local p_digit=R("09")
+ local p_done=S("._-")^0+P(-1)
+ local p_alpha=R("az","AZ")
+ local p_ALPHA=R("AZ")
+ p_crappyname=(
+ lpeg.utfchartabletopattern({ "uni","u" },true)*S("Xx_")^0*p_hex^1
++lpeg.utfchartabletopattern({ "identity","glyph","jamo" },true)*p_hex^1
++lpeg.utfchartabletopattern({ "index","afii" },true)*p_digit^1
++p_digit*p_hex^3+p_alpha*p_digit^1
++P("aj")*p_digit^1+P("eh_")*(p_digit^1+p_ALPHA*p_digit^1)+(1-P("_"))^1*P("_uni")*p_hex^1+P("_")*P(1)^1
+ )*p_done
+end
+local forcekeep=false
+directives.register("otf.keepnames",function(v)
+ report_cleanup("keeping weird glyph names, expect larger files and more memory usage")
+ forcekeep=v
+end)
local function stripredundant(fontdata)
local descriptions=fontdata.descriptions
if descriptions then
@@ -21058,7 +21074,7 @@ local function stripredundant(fontdata)
else
for unicode,d in next,descriptions do
local name=d.name
- if name and lpegmatch(p_bogusname,name) then
+ if name and lpegmatch(p_crappyname,name) then
d.name=nil
n=n+1
end
@@ -21078,6 +21094,7 @@ local function stripredundant(fontdata)
end
end
end
+readers.stripredundant=stripredundant
function readers.getcomponents(fontdata)
local resources=fontdata.resources
if resources then
@@ -32882,6 +32899,7 @@ function afm.load(filename)
if data then
afmenhancers.apply(data,filename)
fonts.mappings.addtounicode(data,filename)
+ otfreaders.stripredundant(data)
otfreaders.pack(data)
data.size=size
data.time=time