From 441b4d98ed5edb423b1de9095770789a8f1cfd3c Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Tue, 11 May 2010 16:24:54 +0300 Subject: Showing a log message only once (it used to be present 10s of times in the log) --- otfl-font-nms.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3