summaryrefslogtreecommitdiff
path: root/otfl-font-dum.lua
diff options
context:
space:
mode:
authoreroux <elie.roux@telecom-bretagne.eu>2010-03-03 11:25:23 +0100
committereroux <elie.roux@telecom-bretagne.eu>2010-03-03 11:25:23 +0100
commitb3776c161877c03691a4a4b2d6f1c302995112ae (patch)
tree5807cc7c2489717441c5c91cd70619fef61f5aa7 /otfl-font-dum.lua
parent8e504aea583057b70c34e71cd24af1f8cc648fa1 (diff)
downloadluaotfload-b3776c161877c03691a4a4b2d6f1c302995112ae.tar.gz
Changing the database directory to TEXMFVAR/scripts/luatexfontdb
Diffstat (limited to 'otfl-font-dum.lua')
-rw-r--r--otfl-font-dum.lua21
1 files changed, 11 insertions, 10 deletions
diff --git a/otfl-font-dum.lua b/otfl-font-dum.lua
index 0b2e911..0c76736 100644
--- a/otfl-font-dum.lua
+++ b/otfl-font-dum.lua
@@ -48,8 +48,9 @@ end
fonts.names = fonts.names or { }
-fonts.names.version = 2.004 -- not the same as in context
-fonts.names.basename = "otfl-names.lua"
+fonts.names.version = 2.004 -- not the same as in context
+fonts.names.basename = "otfl-names.lua"
+fonts.names.subtexmfvardir = "/scripts/luatexfontdb/"
fonts.names.new_to_old = { }
fonts.names.old_to_new = { }
@@ -69,14 +70,14 @@ function fonts.names.resolve(specification)
local name, style = specification.name, specification.style or "regular"
if not loaded then
local basename = fonts.names.basename
- if basename and basename ~= "" then
- for _, format in ipairs { "lua", "tex", "other text files" } do
- local foundname = resolvers.find_file(basename,format) or ""
- if foundname ~= "" then
- data = dofile(foundname)
- logs.report("load font", "loaded font names database: %s", foundname)
- break
- end
+ if basename and basename ~= "" and fonts.names.subtexmfvardir then
+ local foundname = kpse.expand_var("$TEXMFVAR") .. fonts.names.subtexmfvardir .. basename
+ if not file.isreadable(foundname) then
+ foundname = kpse.expand_var("$TEXMFSYSVAR") .. fonts.names.subtexmfvardir .. basename
+ end
+ if file.isreadable(foundname) then
+ data = dofile(foundname)
+ logs.report("load font", "loaded font names database: %s", foundname)
end
end
loaded = true