From 1bd7bd84c9a73105fce7909f14628746328ed823 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Mon, 6 May 2013 11:48:23 +0200 Subject: reduce verbosity of most db related tasks --- luaotfload-database.lua | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) (limited to 'luaotfload-database.lua') diff --git a/luaotfload-database.lua b/luaotfload-database.lua index b7446c9..576341f 100644 --- a/luaotfload-database.lua +++ b/luaotfload-database.lua @@ -134,11 +134,10 @@ This is a sketch of the luaotfload db: // preliminary additions of v2.2: basenames : (string, int) hash; // where int is the index in mappings barenames : (string, int) hash; // where int is the index in mappings - request_cache : lookup_cache; // see below } and fontentry = { familyname : string; - filename : (string * bool); + filename : (string * int); // int: subfont fontname : string; fullname : string; names : { @@ -189,21 +188,15 @@ mtx-fonts has in names.tma: width : string; } - --doc]]-- local fontnames_init = function (keep_cache) --- returns dbobj return { mappings = { }, status = { }, - --- adding filename mapping increases the - --- size of the serialized db on my system - --- (5840 font files) by a factor of 1.09 - --- if we store only the indices in the - --- mappings table barenames = { }, basenames = { }, --- fullnames = { }, +-- fullnames = { }, // -> status version = names.version, } end @@ -262,18 +255,21 @@ local update_names local fonts_loaded = false local fonts_reloaded = false +--- limit output when approximate font matching (luaotfload-tool -F) +local fuzzy_limit = 1 --- display closest only + --- unit -> dbobj load_names = function ( ) local starttime = os.gettimeofday() local foundname, data = load_lua_file(names.path.path) if data then - report("info", 1, "db", + report("both", 2, "db", "Font names database loaded", "%s", foundname) report("info", 3, "db", "Loading took %0.f ms", 1000*(os.gettimeofday()-starttime)) else - report("info", 1, "db", + report("both", 0, "db", [[Font names database not found, generating new one. This can take several minutes; please be patient.]]) data = update_names(fontnames_init(false)) @@ -287,7 +283,7 @@ end load_lookups = function ( ) local foundname, data = load_lua_file(names.path.lookup_path) if data then - report("both", 1, "cache", + report("both", 3, "cache", "Lookup cache loaded (%s)", foundname) else report("both", 1, "cache", @@ -297,8 +293,6 @@ load_lookups = function ( ) return data end -local fuzzy_limit = 1 --- display closest only - local style_synonyms = { set = { } } do style_synonyms.list = { @@ -664,15 +658,12 @@ resolve = function (_,_,specification) -- the 1st two parameters are used by Con if not fonts_reloaded then --- last straw: try reloading the database return reload_db( - "unresolved font name: “" .. name .. "”", + "unresolved font name: ‘" .. name .. "’", resolve, nil, nil, specification ) end --- else, fallback to requested name - --- specification.name is empty with absolute paths, looks - --- like a bug in the specification parser