From 9e2424f29eb2e54968026f4c847bf57c64f59ed6 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Thu, 2 Jan 2014 21:27:11 +0100 Subject: [*] bump version --- luaotfload-database.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'luaotfload-database.lua') diff --git a/luaotfload-database.lua b/luaotfload-database.lua index b47fc8b..b22afd7 100644 --- a/luaotfload-database.lua +++ b/luaotfload-database.lua @@ -1,9 +1,9 @@ if not modules then modules = { } end modules ['luaotfload-database'] = { - version = "2.4", + version = "2.5", comment = "companion to luaotfload.lua", author = "Khaled Hosny, Elie Roux, Philipp Gesang", copyright = "Luaotfload Development Team", - license = "GNU GPL v2" + license = "GNU GPL v2.0" } --[[doc-- -- cgit v1.2.3 From cfd807af6c4f27fc8bc95744cd1c4da8a07559e1 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 3 Jan 2014 18:14:20 +0100 Subject: [db] handle missing metadata table Fixes issue #164, hopefully. --- luaotfload-database.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'luaotfload-database.lua') diff --git a/luaotfload-database.lua b/luaotfload-database.lua index b22afd7..4be54d6 100644 --- a/luaotfload-database.lua +++ b/luaotfload-database.lua @@ -574,7 +574,16 @@ load_names = function (dry_run) report ("info", 3, "db", "Loading took %0.f ms.", 1000 * (osgettimeofday () - starttime)) - local db_version, nms_version = data.meta.version, names.version + local db_version, nms_version + if data.meta then + db_version = data.meta.version + else + --- Compatibility branch; the version info used to be + --- stored in the table root which is why updating from + --- an earlier index version broke. + db_version = data.version or -42 --- invalid + end + nms_version = names.version if db_version ~= nms_version then report ("both", 0, "db", [[Version mismatch; expected %4.3f, got %4.3f.]], -- cgit v1.2.3 From 5d21d8a105a5634e16a9c45ba5cbf6749a7b47db Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 3 Jan 2014 18:17:16 +0100 Subject: [db] fix incorrect local --- luaotfload-database.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'luaotfload-database.lua') diff --git a/luaotfload-database.lua b/luaotfload-database.lua index 4be54d6..cc32bb8 100644 --- a/luaotfload-database.lua +++ b/luaotfload-database.lua @@ -83,7 +83,7 @@ local tableconcat = table.concat local tablesort = table.sort local utf8gsub = unicode.utf8.gsub local utf8lower = unicode.utf8.lower -local utf8length = unicode.utf8.length +local utf8len = unicode.utf8.len local zlibcompress = zlib.compress --- these come from Lualibs/Context @@ -2127,7 +2127,7 @@ end local truncate_string = function (str, restrict) local tw = luaotfloadconfig.termwidth local wd = tw - restrict - local len = utf8length (str) + local len = utf8len (str) if wd - len < 0 then --- combined length exceeds terminal, str = ".." .. stringsub(str, len - wd + 2) -- cgit v1.2.3 From 8cf014615f6dd78b59d03a189e91140c48770373 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 3 Jan 2014 20:03:08 +0100 Subject: [db] use (sanitized) names.fullname field when resolving fonts by name --- luaotfload-database.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'luaotfload-database.lua') diff --git a/luaotfload-database.lua b/luaotfload-database.lua index cc32bb8..72b043b 100644 --- a/luaotfload-database.lua +++ b/luaotfload-database.lua @@ -1070,9 +1070,10 @@ local resolve_fontname = function (specification, name, style) local face = mappings [i] local prefmodifiers = face.prefmodifiers local subfamily = face.subfamily - if face.fontname == name - or face.fullname == name - or face.psname == name + if face.fontname == name + or face.splainname == name + or face.fullname == name + or face.psname == name then return face.basename, face.subfont elseif face.familyname == name then @@ -1608,6 +1609,7 @@ t1_fullinfo = function (filename, _subfont, location, basename, format) fontname = sanitized.fontname, familyname = sanitized.familyname, plainname = fullname, + splainname = sanitized.fullname, psname = sanitized.fontname, version = metadata.version, size = false, @@ -2775,6 +2777,7 @@ local pull_values = function (entry) entry.psname = english.psname entry.fontname = info.fontname entry.fullname = english.fullname or info.fullname + entry.splainname = metadata.fullname entry.prefmodifiers = english.prefmodifiers local metafamily = metadata.familyname local familyname = english.preffamily or english.family -- cgit v1.2.3