summaryrefslogtreecommitdiff
path: root/tex/generic
diff options
context:
space:
mode:
Diffstat (limited to 'tex/generic')
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua73
1 files changed, 60 insertions, 13 deletions
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 7c06c2552..22692b566 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 : 04/21/16 12:13:25
+-- merge date : 04/21/16 19:35:29
do -- begin closure to overcome local limits and interference
@@ -8244,14 +8244,10 @@ if not modules then modules={} end modules ['font-otr']={
copyright="PRAGMA ADE / ConTeXt Development Team",
license="see context related readme files"
}
-if not characters then
- require("char-def")
- require("char-ini")
-end
local next,type,unpack=next,type,unpack
local byte,lower,char,strip,gsub=string.byte,string.lower,string.char,string.strip,string.gsub
local bittest=bit32.btest
-local concat,remove,unpack=table.concat,table.remov,table.unpack
+local concat,remove,unpack,fastcopy=table.concat,table.remov,table.unpack,table.fastcopy
local floor,mod,abs,sqrt,round=math.floor,math.mod,math.abs,math.sqrt,math.round
local P,R,S,C,Cs,Cc,Ct,Carg,Cmt=lpeg.P,lpeg.R,lpeg.S,lpeg.C,lpeg.Cs,lpeg.Cc,lpeg.Ct,lpeg.Carg,lpeg.Cmt
local lpegmatch=lpeg.match
@@ -8896,6 +8892,7 @@ local sequence={
{ 0,0,6 },
{ 3,0,6 },
{ 0,5,14 },
+ { 3,10,13 },
}
local supported={}
for i=1,#sequence do
@@ -9067,7 +9064,7 @@ formatreaders[12]=function(f,fontdata,offset)
local last=readulong(f)
local index=readulong(f)
if trace_cmap then
- report("format 12 from %C to %C",first,last)
+ report("format 12 from %C to %C starts at index %i",first,last,index)
end
for unicode=first,last do
local glyph=glyphs[index]
@@ -9093,6 +9090,49 @@ formatreaders[12]=function(f,fontdata,offset)
end
return nofdone
end
+formatreaders[13]=function(f,fontdata,offset)
+ setposition(f,offset+2+2+4+4)
+ local mapping=fontdata.mapping
+ local glyphs=fontdata.glyphs
+ local duplicates=fontdata.duplicates
+ local nofgroups=readulong(f)
+ local nofdone=0
+ for i=1,nofgroups do
+ local first=readulong(f)
+ local last=readulong(f)
+ local index=readulong(f)
+ if first<privateoffset then
+ if trace_cmap then
+ report("format 13 from %C to %C get index %i",first,last,index)
+ end
+ local glyph=glyphs[index]
+ local unicode=glyph.unicode
+ if not unicode then
+ unicode=first
+ glyph.unicode=unicode
+ first=first+1
+ end
+ local list=duplicates[unicode]
+ mapping[index]=unicode
+ if not list then
+ list={}
+ duplicates[unicode]=list
+ end
+ if last>=privateoffset then
+ local limit=privateoffset-1
+ report("format 13 from %C to %C pruned to %C",first,last,limit)
+ last=limit
+ end
+ for unicode=first,last do
+ list[unicode]=true
+ end
+ nofdone=nofdone+last-first+1
+ else
+ report("format 13 from %C to %C ignored",first,last)
+ end
+ end
+ return nofdone
+end
formatreaders[14]=function(f,fontdata,offset)
if offset and offset~=0 then
setposition(f,offset)
@@ -13932,20 +13972,27 @@ local function copyduplicates(fontdata)
local du=descriptions[u]
if du then
local t={ f_character_y(u),"@",f_index(du.index),"->" }
+ local n=0
+ local m=25
for u in next,d do
if descriptions[u] then
- t[#t+1]=f_character_n(u)
+ if n<m then
+ t[n+4]=f_character_n(u)
+ end
else
local c=copy(du)
+ c.unicode=u
descriptions[u]=c
- t[#t+1]=f_character_y(u)
+ if n<m then
+ t[n+4]=f_character_y(u)
+ end
end
+ n=n+1
end
- local n=#t
- if n>25 then
- report("duplicates: %i : %s .. %s ",n,t[1],t[n])
- else
+ if n<=m then
report("duplicates: %i : % t",n,t)
+ else
+ report("duplicates: %i : % t ...",n,t)
end
else
end