From ffd0ba4063fb2d0bd5ff4b157cc82940ae6cda01 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Mon, 17 May 2010 19:16:01 +0300 Subject: Fix loading TFM fonts with OSFONTDIR set If OSFONTDIR is set non-TFM files will be found first if TFM file is asked for, I'm not into the mode of digging the source of this in ConTeXt code, so just force TFM lookup by appending .tfm (or .ofm). --- otfl-font-nms.lua | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua index e40aa32..37ee8e3 100644 --- a/otfl-font-nms.lua +++ b/otfl-font-nms.lua @@ -97,7 +97,16 @@ local loaded = false local reloaded = false function names.resolve(specification) - local tfm = resolvers.find_file(specification.name, "ofm") + local tfm = resolvers.find_file(specification.name, "tfm") + local ofm = resolvers.find_file(specification.name, "ofm") + + if tfm then + -- is a tfm font, skip names database + return specification.name .. ".tfm", false + elseif ofm then + return specification.name .. ".ofm", false + end + local name = sanitize(specification.name) local style = sanitize(specification.style) or "regular" @@ -108,10 +117,6 @@ function names.resolve(specification) size = specification.size / 65536 end - if tfm then - -- is a tfm font, skip names database - return specification.name, false - end if not loaded then names.data = names.load() -- cgit v1.2.3