summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElie Roux <elie.roux@telecom-bretagne.eu>2010-05-11 16:24:54 +0300
committerElie Roux <elie.roux@telecom-bretagne.eu>2010-05-11 16:24:54 +0300
commit441b4d98ed5edb423b1de9095770789a8f1cfd3c (patch)
treea587dc20a3731f9b2dd5eb982c7c9fb5c56ca60e
parent6c669a52cf5503bac7e507ccfb0ca04d0ddf3378 (diff)
downloadluaotfload-441b4d98ed5edb423b1de9095770789a8f1cfd3c.tar.gz
Showing a log message only once (it used to be present 10s of times in the log)
-rw-r--r--otfl-font-nms.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua
index 1922be3..fd31bac 100644
--- a/otfl-font-nms.lua
+++ b/otfl-font-nms.lua
@@ -65,6 +65,10 @@ local synonyms = {
bolditalic = {boldoblique=true, boldslant=true},
}
+-- a small hack to get the log message "no font names database loaded" only
+-- once in the log
+local log_message_shown = false
+
function names.resolve(specification)
local tfm = resolvers.find_file(specification.name, "ofm")
local name = sanitize(specification.name)
@@ -171,8 +175,9 @@ function names.resolve(specification)
-- no font found so far, fallback to filename
return specification.name, false
end
- else
+ elseif not log_message_shown then
logs.report("load font", "no font names database loaded")
+ log_message_shown = true
end
end