summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2013-12-20 13:16:38 +0100
committerPhilipp Gesang <phg42.2a@gmail.com>2013-12-20 13:16:38 +0100
commit11bfbe1081cb6874ecacf4a7067f011e21722b6a (patch)
treebe44298e7ae464954a494786018b1c2c94dc6d07
parent8304d6d429dffe685597fc886048d9f2e2e1e9da (diff)
downloadluaotfload-11bfbe1081cb6874ecacf4a7067f011e21722b6a.tar.gz
[fontloader] sync with Context as of 2013-12-20
-rw-r--r--luaotfload-fontloader.lua23
1 files changed, 20 insertions, 3 deletions
diff --git a/luaotfload-fontloader.lua b/luaotfload-fontloader.lua
index 468168c..688cfec 100644
--- a/luaotfload-fontloader.lua
+++ b/luaotfload-fontloader.lua
@@ -1,6 +1,6 @@
-- merged file : luatex-fonts-merged.lua
-- parent file : luatex-fonts.lua
--- merge date : 12/14/13 13:43:12
+-- merge date : 12/20/13 00:55:14
do -- begin closure to overcome local limits and interference
@@ -6435,8 +6435,25 @@ registerdirective("fonts.otf.loader.pack",function(v) packdata=v end)
registerdirective("fonts.otf.loader.syncspace",function(v) syncspace=v end)
registerdirective("fonts.otf.loader.forcenotdef",function(v) forcenotdef=v end)
registerdirective("fonts.otf.loader.overloadkerns",function(v) overloadkerns=v end)
+function otf.fileformat(filename)
+ local leader=lower(io.loadchunk(filename,4))
+ local suffix=lower(file.suffix(filename))
+ if leader=="otto" then
+ return "opentype","otf",suffix=="otf"
+ elseif leader=="ttcf" then
+ return "truetype","ttc",suffix=="ttc"
+ elseif suffix=="ttc" then
+ return "truetype","ttc",true
+ else
+ return "truetype","ttf",suffix=="ttf"
+ end
+end
local function otf_format(filename)
- return formats[lower(file.suffix(filename))]
+ local format,suffix,okay=otf.fileformat(filename)
+ if not okay then
+ report_otf("font %a is actually an %a file",filename,format)
+ end
+ return suffix
end
local function load_featurefile(raw,featurefile)
if featurefile and featurefile~="" then
@@ -8831,7 +8848,7 @@ nodes.injections=nodes.injections or {}
local injections=nodes.injections
local nodecodes=nodes.nodecodes
local glyph_code=nodecodes.glyph
-local kern_disc=nodecodes.disc
+local disc_code=nodecodes.disc
local kern_code=nodecodes.kern
local nuts=nodes.nuts
local nodepool=nuts.pool