summaryrefslogtreecommitdiff
path: root/src/luaotfload-main.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2014-05-18 21:25:24 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2014-05-18 21:25:24 +0200
commit0e06af55b50b2314c5d99db4843c1881dd89a88b (patch)
treef51c67b560e197a0e0f0939c228b366a7f0bfc0c /src/luaotfload-main.lua
parentaca3f50f6806f838b6acbaa2f7012fc6b12d5080 (diff)
downloadluaotfload-0e06af55b50b2314c5d99db4843c1881dd89a88b.tar.gz
[main] lowercase file suffix when forcing file format (thanks, Bryan!)
Closing https://github.com/lualatex/luaotfload/issues/215
Diffstat (limited to 'src/luaotfload-main.lua')
-rw-r--r--src/luaotfload-main.lua15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/luaotfload-main.lua b/src/luaotfload-main.lua
index dba1f52..4baa225 100644
--- a/src/luaotfload-main.lua
+++ b/src/luaotfload-main.lua
@@ -63,6 +63,7 @@ local luatexbase = luatexbase
local setmetatable = setmetatable
local type, next = type, next
+local stringlower = string.lower
local kpsefind_file = kpse.find_file
local lfsisfile = lfs.isfile
@@ -477,14 +478,14 @@ fonts.encodings.known = fonts.encodings.known or { }
--doc]]--
-local resolve_file = names.crude_file_lookup
---local resolve_file = names.crude_file_lookup_verbose
+--local resolve_file = names.crude_file_lookup
+local resolve_file = names.crude_file_lookup_verbose
local file_resolver = function (specification)
local name = resolve_file (specification.name)
local suffix = filesuffix(name)
if formats[suffix] then
- specification.forced = suffix
+ specification.forced = stringlower (suffix)
specification.forcedname = file.removesuffix(name)
else
specification.name = name
@@ -522,7 +523,7 @@ request_resolvers.file = file_resolver
--doc]]--
-local type1_formats = { "tfm", "ofm", }
+local type1_formats = { "tfm", "ofm", "TFM", "OFM", }
request_resolvers.anon = function (specification)
local name = specification.name
@@ -572,7 +573,7 @@ request_resolvers.path = function (specification)
else
local suffix = filesuffix (name)
if formats[suffix] then
- specification.forced = suffix
+ specification.forced = stringlower (suffix)
specification.name = file.removesuffix(name)
specification.forcedname = name
else
@@ -595,7 +596,7 @@ request_resolvers.kpse = function (specification)
if suffix and formats[suffix] then
name = file.removesuffix(name)
if resolvers.findfile(name, suffix) then
- specification.forced = suffix
+ specification.forced = stringlower (suffix)
specification.forcedname = name
return
end
@@ -629,7 +630,7 @@ request_resolvers.name = function (specification)
specification.name, resolved, subfont)
specification.resolved = resolved
specification.sub = subfont
- specification.forced = filesuffix (resolved)
+ specification.forced = stringlower (filesuffix (resolved) or "")
specification.forcedname = resolved
specification.name = fileremovesuffix (resolved)
else