From 0e06af55b50b2314c5d99db4843c1881dd89a88b Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 18 May 2014 21:25:24 +0200 Subject: [main] lowercase file suffix when forcing file format (thanks, Bryan!) Closing https://github.com/lualatex/luaotfload/issues/215 --- src/luaotfload-main.lua | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src') 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 -- cgit v1.2.3