diff options
| author | Khaled Hosny <khaledhosny@eglug.org> | 2010-05-17 19:16:01 +0300 | 
|---|---|---|
| committer | Khaled Hosny <khaledhosny@eglug.org> | 2010-05-17 19:16:01 +0300 | 
| commit | ffd0ba4063fb2d0bd5ff4b157cc82940ae6cda01 (patch) | |
| tree | 784600fa57fb6a2525de199ffcf963237dfbd203 | |
| parent | 6107598f5c25bfd6a8669d145ce4112c603b9e0f (diff) | |
| download | luaotfload-ffd0ba4063fb2d0bd5ff4b157cc82940ae6cda01.tar.gz | |
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).
| -rw-r--r-- | otfl-font-nms.lua | 15 | 
1 files 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() | 
