summaryrefslogtreecommitdiff
path: root/otfl-font-nms.lua
diff options
context:
space:
mode:
authorElie Roux <elie.roux@telecom-bretagne.eu>2010-05-18 18:09:44 +0300
committerElie Roux <elie.roux@telecom-bretagne.eu>2010-05-18 18:09:44 +0300
commit5a51dbf2b88e97a65baeaff3f254ca4e983b48f4 (patch)
treefa3463e049681ded4f0dd772b96c0a0ad299fbe7 /otfl-font-nms.lua
parent4427a6ec30f2196e90cf66d140be98fff9ad65e5 (diff)
downloadluaotfload-5a51dbf2b88e97a65baeaff3f254ca4e983b48f4.tar.gz
This commit should fix everything about the ofm and tfm priority
Diffstat (limited to 'otfl-font-nms.lua')
-rw-r--r--otfl-font-nms.lua18
1 files changed, 15 insertions, 3 deletions
diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua
index 59c6b91..7731efb 100644
--- a/otfl-font-nms.lua
+++ b/otfl-font-nms.lua
@@ -6,6 +6,10 @@ if not modules then modules = { } end modules ['font-nms'] = {
license = "GPL"
}
+-- this is a patch for otfl-font-def.lua, that defines a reader for ofm fonts,
+-- this is necessary if we set the forced field of the specification to 'ofm'
+fonts.tfm.readers.ofm = fonts.tfm.readers.tfm
+
fonts = fonts or { }
fonts.names = fonts.names or { }
@@ -103,17 +107,25 @@ local reloaded = false
function names.resolve(specification)
local tfm = resolvers.find_file(specification.name, "tfm")
local ofm = resolvers.find_file(specification.name, "ofm")
+ local ext = lower(file.extname(specification.name))
if tfm then
-- is a tfm font, skip names database
- return specification.name, false
+ if ext == 'tfm' then
+ return specification.name, false
+ else
+ return specification.name..'.tfm', false
+ end
elseif ofm then
- return specification.name, false
+ if ext == 'ofm' then
+ return specification.name, false
+ else
+ return specification.name..'.ofm', false
+ end
end
local name = sanitize(specification.name)
local style = sanitize(specification.style) or "regular"
- local ext = lower(file.extname(specification.name))
local size
if specification.optsize then