summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-oup.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-06-17 22:15:40 +0000
committerKarl Berry <karl@freefriends.org>2016-06-17 22:15:40 +0000
commit64f6ef59da37e7dfcaedbc874997dd5cc56ed813 (patch)
tree66c080e48dfa112456f9fda55ddd804c79afe9ac /Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-oup.lua
parent366e3a9df92823f8bdb06251114a235967b8b1bf (diff)
luaotfload (17jun16)
git-svn-id: svn://tug.org/texlive/trunk@41471 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-oup.lua')
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-oup.lua72
1 files changed, 69 insertions, 3 deletions
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-oup.lua b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-oup.lua
index 3b6d8ea53c7..571c69f13ba 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-oup.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-oup.lua
@@ -586,7 +586,8 @@ local function checklookups(fontdata,missing,nofmissing)
local done = { }
for i, r in next, missing do
if r then
- local name = descriptions[i].name or f_index(i)
+ local data = descriptions[i]
+ local name = data and data.name or f_index(i)
if not ignore[name] then
done[name] = true
end
@@ -706,6 +707,19 @@ local function unifyglyphs(fontdata,usenames)
end
end
--
+ local colorpalettes = resources.colorpalettes
+ if colorpalettes then
+ for index=1,#glyphs do
+ local colors = glyphs[index].colors
+ if colors then
+ for i=1,#colors do
+ local c = colors[i]
+ c.slot = indices[c.slot]
+ end
+ end
+ end
+ end
+ --
fontdata.private = private
fontdata.glyphs = nil
fontdata.names = names
@@ -1158,6 +1172,7 @@ function readers.pack(data)
local sequences = resources.sequences
local sublookups = resources.sublookups
local features = resources.features
+ local palettes = resources.colorpalettes
local chardata = characters and characters.data
local descriptions = data.descriptions or data.glyphs
@@ -1190,6 +1205,14 @@ function readers.pack(data)
end
end
end
+ -- if palettes then
+ -- local color = description.color
+ -- if color then
+ -- for i=1,#color do
+ -- color[i] = pack_normal(color[i])
+ -- end
+ -- end
+ -- end
end
local function packthem(sequences)
@@ -1279,7 +1302,8 @@ function readers.pack(data)
local r = rule.before if r then for i=1,#r do r[i] = pack_boolean(r[i]) end end
local r = rule.after if r then for i=1,#r do r[i] = pack_boolean(r[i]) end end
local r = rule.current if r then for i=1,#r do r[i] = pack_boolean(r[i]) end end
- local r = rule.replacements if r then rule.replacements = pack_flat (r) end -- can have holes
+ local r = rule.lookups if r then rule.lookups = pack_mixed (r) end
+ local r = rule.replacements if r then rule.replacements = pack_flat (r) end
end
end
end
@@ -1314,6 +1338,16 @@ function readers.pack(data)
end
end
+ if palettes then
+ for i=1,#palettes do
+ local p = palettes[i]
+ for j=1,#p do
+ p[j] = pack_indexed(p[j])
+ end
+ end
+
+ end
+
if not success(1,pass) then
return
end
@@ -1461,6 +1495,7 @@ function readers.unpack(data)
local sequences = resources.sequences
local sublookups = resources.sublookups
local features = resources.features
+ local palettes = resources.colorpalettes
local unpacked = { }
setmetatable(unpacked,unpacked_mt)
for unicode, description in next, descriptions do
@@ -1487,6 +1522,17 @@ function readers.unpack(data)
end
end
end
+ -- if palettes then
+ -- local color = description.color
+ -- if color then
+ -- for i=1,#color do
+ -- local tv = tables[color[i]]
+ -- if tv then
+ -- color[i] = tv
+ -- end
+ -- end
+ -- end
+ -- end
end
local function unpackthem(sequences)
@@ -1658,9 +1704,16 @@ function readers.unpack(data)
end
end
end
+ local lookups = rule.lookups
+ if lookups then
+ local tv = tables[lookups]
+ if tv then
+ rule.lookups = tv
+ end
+ end
local replacements = rule.replacements
if replacements then
- local tv = tables[replace]
+ local tv = tables[replacements]
if tv then
rule.replacements = tv
end
@@ -1716,6 +1769,18 @@ function readers.unpack(data)
end
end
+ if palettes then
+ for i=1,#palettes do
+ local p = palettes[i]
+ for j=1,#p do
+ local tv = tables[p[j]]
+ if tv then
+ p[j] = tv
+ end
+ end
+ end
+ end
+
data.tables = nil
end
end
@@ -2114,6 +2179,7 @@ function readers.expand(data)
local lookups = rule.lookups or false
local subtype = nil
if lookups then
+ -- is now indexed
for k, v in next, lookups do
local lookup = sublookups[v]
if lookup then