From 5a51dbf2b88e97a65baeaff3f254ca4e983b48f4 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Tue, 18 May 2010 18:09:44 +0300 Subject: This commit should fix everything about the ofm and tfm priority --- otfl-font-nms.lua | 18 +++++++++++++++--- 1 file 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 -- cgit v1.2.3