summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2013-05-09 20:56:10 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2013-05-09 20:56:10 +0200
commit9f697f3c5f0e19ab3beab9a2891c42aa8cc8a325 (patch)
tree43cc2cf16038aada66067d38511ed0d194e841aa
parent14c57c4e0d5b9589c52bcef547f9478857d0c2f3 (diff)
downloadluaotfload-9f697f3c5f0e19ab3beab9a2891c42aa8cc8a325.tar.gz
make file lookups return string instead of pair
-rw-r--r--luaotfload-auxiliary.lua2
-rw-r--r--luaotfload-database.lua22
2 files changed, 12 insertions, 12 deletions
diff --git a/luaotfload-auxiliary.lua b/luaotfload-auxiliary.lua
index 9f7974a..e93ea9d 100644
--- a/luaotfload-auxiliary.lua
+++ b/luaotfload-auxiliary.lua
@@ -68,7 +68,7 @@ local add_fontdata_fallbacks = function (fontdata)
--- non-standard em-sizes (most ms fonts have 2048, others
--- come with 256)
--- this is considered a bug in the font loader
- fontdata.size = fontparameters.size * fontdata.units / 1000
+ --fontdata.size = fontparameters.size * fontdata.units / 1000
--- for legacy fontspec.lua and unicode-math.lua
fontdata.shared.otfdata = metadata
fontdata.shared.otfdata.metadata = metadata --- brr, that’s meta indeed
diff --git a/luaotfload-database.lua b/luaotfload-database.lua
index 84b884d..df5b531 100644
--- a/luaotfload-database.lua
+++ b/luaotfload-database.lua
@@ -317,7 +317,7 @@ end
local type1_formats = { "tfm", "ofm", }
---- string -> (string * bool | int)
+--- string -> string
crude_file_lookup_verbose = function (filename)
if not names.data then names.data = load_names() end
local data = names.data
@@ -327,18 +327,18 @@ crude_file_lookup_verbose = function (filename)
--- look up in db first ...
found = data.barenames[filename]
if found and mappings[found] then
- found = mappings[found].filename
+ found = mappings[found].filename[1]
report("info", 0, "db",
"crude file lookup: req=%s; hit=bare; ret=%s",
- filename, found[1])
+ filename, found)
return found
end
found = data.basenames[filename]
if found and mappings[found] then
- found = mappings[found].filename
+ found = mappings[found].filename[1]
report("info", 0, "db",
"crude file lookup: req=%s; hit=base; ret=%s",
- filename, found[1])
+ filename, found)
return found
end
@@ -346,13 +346,13 @@ crude_file_lookup_verbose = function (filename)
for i=1, #type1_formats do
local format = type1_formats[i]
if resolvers.findfile(filename, format) then
- return { file.addsuffix(filename, format), false }, format
+ return file.addsuffix(filename, format), format
end
end
- return { filename, false }, nil
+ return filename, nil
end
---- string -> (string * bool | int)
+--- string -> string
crude_file_lookup = function (filename)
if not names.data then names.data = load_names() end
local data = names.data
@@ -361,15 +361,15 @@ crude_file_lookup = function (filename)
or data.basenames[filename]
if found then
found = data.mappings[found]
- if found then return found.filename end
+ if found then return found.filename[1] end
end
for i=1, #type1_formats do
local format = type1_formats[i]
if resolvers.findfile(filename, format) then
- return { file.addsuffix(filename, format), false }, format
+ return file.addsuffix(filename, format), format
end
end
- return { filename, false }, nil
+ return filename, nil
end
--[[doc--