From 2a31ed63dccd4eb59c58f2b30c7b5170fe246e24 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 2 Aug 2013 21:41:58 +0200 Subject: [db] fix missing write after auto-update fixes issues like this one: http://tex.stackexchange.com/q/126467/14066 --- luaotfload-database.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'luaotfload-database.lua') diff --git a/luaotfload-database.lua b/luaotfload-database.lua index ac2d0db..ab0d32c 100644 --- a/luaotfload-database.lua +++ b/luaotfload-database.lua @@ -400,7 +400,13 @@ load_names = function (dry_run) nms_version, db_version) if not fonts_reloaded then report("both", 0, "db", [[Force rebuild]]) - return update_names({ }, true, false) + data = update_names({ }, true, false) + local success = save_names (data) + if not success then + report ("both", 0, "db", + "Database creation unsuccessful.") + end + return data end end else -- cgit v1.2.3 From c23480eb487cce1a55c6e3957a17b52330ad34c4 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 2 Aug 2013 22:00:39 +0200 Subject: [db] always save on update --- luaotfload-database.lua | 53 +++++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 26 deletions(-) (limited to 'luaotfload-database.lua') diff --git a/luaotfload-database.lua b/luaotfload-database.lua index ab0d32c..22a3744 100644 --- a/luaotfload-database.lua +++ b/luaotfload-database.lua @@ -384,41 +384,38 @@ local fuzzy_limit = 1 --- display closest only --- bool? -> dbobj load_names = function (dry_run) - local starttime = os.gettimeofday() - local foundname, data = load_lua_file(names.path.index.lua) + local starttime = os.gettimeofday () + local foundname, data = load_lua_file (names.path.index.lua) if data then - report("both", 2, "db", - "Font names database loaded", "%s", foundname) - report("info", 3, "db", "Loading took %0.f ms", - 1000*(os.gettimeofday()-starttime)) + report ("both", 2, "db", + "Font names database loaded", "%s", foundname) + report ("info", 3, "db", "Loading took %0.f ms", + 1000*(os.gettimeofday()-starttime)) local db_version, nms_version = data.version, names.version if db_version ~= nms_version then - report("both", 0, "db", - [[Version mismatch; expected %4.3f, got %4.3f]], - nms_version, db_version) + report ("both", 0, "db", + [[Version mismatch; expected %4.3f, got %4.3f]], + nms_version, db_version) if not fonts_reloaded then - report("both", 0, "db", [[Force rebuild]]) - data = update_names({ }, true, false) - local success = save_names (data) - if not success then + report ("both", 0, "db", [[Force rebuild]]) + data = update_names ({ }, true, false) + if not data then report ("both", 0, "db", "Database creation unsuccessful.") end - return data end end else - report("both", 0, "db", - [[Font names database not found, generating new one.]]) - report("both", 0, "db", - [[This can take several minutes; please be patient.]]) + report ("both", 0, "db", + [[Font names database not found, generating new one.]]) + report ("both", 0, "db", + [[This can take several minutes; please be patient.]]) data = update_names (fontnames_init (get_font_filter ()), nil, dry_run) - local success = save_names(data) if not success then - report("both", 0, "db", "Database creation unsuccessful.") + report ("both", 0, "db", "Database creation unsuccessful.") end end fonts_loaded = true @@ -993,14 +990,13 @@ end --- string -> ('a -> 'a) -> 'a list -> 'a reload_db = function (why, caller, ...) - report("both", 1, "db", "Reload initiated; reason: %q", why) - names.data = update_names(names.data, false, false) - local success = save_names() - if success then + report ("both", 1, "db", "Reload initiated; reason: %q", why) + names.data = update_names (names.data, false, false) + if names.data then fonts_reloaded = true - return caller(...) + return caller (...) end - report("both", 0, "db", "Database update unsuccessful.") + report ("both", 0, "db", "Database update unsuccessful.") end --- string -> string -> int @@ -2226,6 +2222,11 @@ update_names = function (fontnames, force, dry_run) "Scanned %d font files; %d new entries.", n_scanned, n_new) report("info", 3, "db", "Rebuilt in %0.f ms", 1000*(os.gettimeofday()-starttime)) + names.data = newfontnames + + if dry_run ~= true then + save_names () + end return newfontnames end -- cgit v1.2.3 From 24ef88fda9d592e880c4694b50c64c5ae0b74a92 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sat, 3 Aug 2013 22:22:56 +0200 Subject: [tool] make --find process normal requests --- luaotfload-database.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'luaotfload-database.lua') diff --git a/luaotfload-database.lua b/luaotfload-database.lua index 22a3744..939b6bb 100644 --- a/luaotfload-database.lua +++ b/luaotfload-database.lua @@ -2169,7 +2169,7 @@ update_names = function (fontnames, force, dry_run) if config.luaotfload.update_live == false then report("info", 2, "db", - "skipping database update") + "Skipping database update") --- skip all db updates return fontnames or names.data end -- cgit v1.2.3 From 358258ab83d2bc0d9d8ad141427c7df989425c90 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sat, 3 Aug 2013 22:44:30 +0200 Subject: [tool] handle anon: and file: requests with --find --- luaotfload-database.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'luaotfload-database.lua') diff --git a/luaotfload-database.lua b/luaotfload-database.lua index 939b6bb..8da0713 100644 --- a/luaotfload-database.lua +++ b/luaotfload-database.lua @@ -523,21 +523,21 @@ crude_file_lookup_verbose = function (filename) --- look up in db first ... found = verbose_lookup(filenames, "bare", filename) if found then - return found + return found, nil, true end found = verbose_lookup(filenames, "base", filename) if found then - return found + return found, nil, true end --- ofm and tfm, returns pair for i=1, #type1_formats do local format = type1_formats[i] if resolvers.findfile(filename, format) then - return file.addsuffix(filename, format), format + return file.addsuffix(filename, format), format, true end end - return filename, nil + return filename, nil, false end --- string -> (string | string * string) @@ -557,15 +557,17 @@ crude_file_lookup = function (filename) if found == nil then found = dummy_findfile(filename) end - return found or filename + return found or filename, nil, true end + for i=1, #type1_formats do local format = type1_formats[i] if resolvers.findfile(filename, format) then - return file.addsuffix(filename, format), format + return file.addsuffix(filename, format), format, true end end - return filename, nil + + return filename, nil, false end --[[doc-- -- cgit v1.2.3 From a0d59a1cf91675a18f7062e11053aedf52585b2d Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 4 Aug 2013 09:58:23 +0200 Subject: [db] pre-resolve style synonyms when matching --- luaotfload-database.lua | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'luaotfload-database.lua') diff --git a/luaotfload-database.lua b/luaotfload-database.lua index 8da0713..0fbbd44 100644 --- a/luaotfload-database.lua +++ b/luaotfload-database.lua @@ -823,12 +823,15 @@ resolve = function (_, _, specification) -- the 1st two parameters are used by C return specification.name, false, false end + local synonym_set = style_synonyms.set + local stylesynonyms = synonym_set[style] + local regularsynonyms = synonym_set.regular + local exact = { } --> collect exact style matches local synonymous = { } --> collect matching style synonyms local fallback --> e.g. non-matching style (fontspec is anal about this) local candidates = { } --> secondary results, incomplete matches - local synonym_set = style_synonyms.set for n, face in next, data.mappings do local family, subfamily, fullname, prefmodifiers local psname, fontname, pfullname, metafamily @@ -856,8 +859,8 @@ resolve = function (_, _, specification) -- the 1st two parameters are used by C if continue == false then break end elseif style == subfamily then exact = add_to_match(exact, askedsize, face) - elseif synonym_set[style] and synonym_set[style][prefmodifiers] - or synonym_set.regular[prefmodifiers] + elseif stylesynonyms and stylesynonyms[prefmodifiers] + or regularsynonyms[prefmodifiers] then --- treat synonyms for prefmodifiers as first-class --- (needed to prioritize DejaVu Book over Condensed) @@ -868,8 +871,8 @@ resolve = function (_, _, specification) -- the 1st two parameters are used by C or name == psname then synonymous = add_to_match(synonymous, askedsize, face) - elseif synonym_set[style] and synonym_set[style][subfamily] - or synonym_set.regular[subfamily] + elseif stylesynonyms and stylesynonyms[subfamily] + or regularsynonyms[subfamily] then synonymous = add_to_match(synonymous, askedsize, face) elseif prefmodifiers == "regular" -- cgit v1.2.3 From 59efa957a012b64fe970d6ea95521ea5e99fb5ad Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 4 Aug 2013 12:00:25 +0200 Subject: [db] use consistent identifiers --- luaotfload-database.lua | 81 +++++++++++++++++++++++++++---------------------- 1 file changed, 45 insertions(+), 36 deletions(-) (limited to 'luaotfload-database.lua') diff --git a/luaotfload-database.lua b/luaotfload-database.lua index 0fbbd44..bd7a97b 100644 --- a/luaotfload-database.lua +++ b/luaotfload-database.lua @@ -1134,7 +1134,7 @@ table as returned by the font file reader need to be relocated. --- string -> int -> bool -> string -> fontentry ot_fullinfo = function (filename, subfont, texmf, basename) - local tfmdata = { } + local namedata = { } local metadata = load_font_file (filename, subfont) if not metadata then @@ -1145,68 +1145,74 @@ ot_fullinfo = function (filename, subfont, texmf, basename) if metadata.fontstyle_name then for _, name in next, metadata.fontstyle_name do if name.lang == 1033 then --- I hate magic numbers - tfmdata.fontstyle_name = name.name + namedata.fontstyle_name = name.name end end end if metadata.names then - for _, namedata in next, metadata.names do - if namedata.lang == "English (US)" then + for _, raw_namedata in next, metadata.names do + if raw_namedata.lang == "English (US)" then local names = { --- see --- https://developer.apple.com/fonts/TTRefMan/RM06/Chap6name.html - fullname = namedata.names.compatfull - or namedata.names.fullname, - family = namedata.names.preffamilyname - or namedata.names.family, - prefmodifiers = namedata.names.prefmodifiers, - subfamily = tfmdata.fontstyle_name - or namedata.names.subfamily, - psname = namedata.names.postscriptname, + fullname = raw_namedata.names.compatfull + or raw_namedata.names.fullname, + family = raw_namedata.names.preffamilyname + or raw_namedata.names.family, + prefmodifiers = raw_namedata.names.prefmodifiers, + subfamily = namedata.fontstyle_name + or raw_namedata.names.subfamily, + psname = raw_namedata.names.postscriptname, pfullname = metadata.fullname, fontname = metadata.fontname, metafamily = metadata.familyname, } --- tfmdata.names = names - tfmdata.sanitized = sanitize_names(names) +-- namedata.names = names + namedata.sanitized = sanitize_names(names) end end else -- no names table, propably a broken font - report("log", 1, "db", "Broken font rejected", "%s", basefile) + report("log", 1, "db", + "Broken font %s rejected due to missing names table.", + basename) return end - tfmdata.fontname = metadata.fontname - tfmdata.fullname = metadata.fullname - tfmdata.familyname = metadata.familyname - tfmdata.weight = metadata.pfminfo.weight - tfmdata.width = metadata.pfminfo.width - tfmdata.slant = metadata.italicangle - --- this is for querying - tfmdata.units_per_em = metadata.units_per_em - tfmdata.version = metadata.version + + + namedata.fontname = metadata.fontname + namedata.fullname = metadata.fullname + namedata.familyname = metadata.familyname + namedata.weight = metadata.pfminfo.weight + namedata.width = metadata.pfminfo.width + namedata.slant = metadata.italicangle + --- this is for querying, see www.ntg.nl/maps/40/07.pdf for details + namedata.units_per_em = metadata.units_per_em + namedata.version = metadata.version -- don't waste the space with zero values - tfmdata.size = { + namedata.size = { metadata.design_size ~= 0 and metadata.design_size or nil, metadata.design_range_top ~= 0 and metadata.design_range_top or nil, metadata.design_range_bottom ~= 0 and metadata.design_range_bottom or nil, } --- file location data (used to be filename field) - tfmdata.filename = filename --> sys - tfmdata.basename = basename --> texmf - tfmdata.texmf = texmf or false - tfmdata.subfont = subfont + namedata.filename = filename --> sys + namedata.basename = basename --> texmf + namedata.texmf = texmf or false + namedata.subfont = subfont - return tfmdata + return namedata end --[[doc-- - Type1 font inspector. PFB’s contain a good deal less name fields - which makes it tricky in some parts to find a meaningful representation - for the database. + Type1 font inspector. In comparison with OTF, PFB’s contain a good + deal less name fields which makes it tricky in some parts to find a + meaningful representation for the database. + + Good read: http://www.adobe.com/devnet/font/pdfs/5004.AFM_Spec.pdf --doc]]-- @@ -1219,7 +1225,7 @@ t1_fullinfo = function (filename, _subfont, texmf, basename) local fullname = metadata.fullname local familyname = metadata.familyname local italicangle = metadata.italicangle - local weight = metadata.weight + local weight = metadata.weight --- string identifier --- we have to improvise and detect whether we deal with --- italics since pfb fonts don’t come with a “subfamily” @@ -1268,15 +1274,18 @@ t1_fullinfo = function (filename, _subfont, texmf, basename) namedata.fullname = fullname namedata.familyname = familyname - namedata.weight = 0 -- dummy + namedata.slant = italicangle + namedata.units_per_em = 1000 --- ps fonts standard namedata.version = metadata.version + namedata.weight = metadata.pfminfo.weight --- integer + namedata.width = metadata.pfminfo.width namedata.size = { } namedata.filename = filename --> sys namedata.basename = basename --> texmf namedata.texmf = texmf or false - namedata.subfont = subfont + namedata.subfont = false return namedata end -- cgit v1.2.3 From ec5e064bf604d5984d3a85ba6f63943617111e51 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 4 Aug 2013 12:15:54 +0200 Subject: [db] employ the info from fontstyle_name when matching styles --- luaotfload-database.lua | 68 +++++++++++++++++++++++++++---------------------- 1 file changed, 37 insertions(+), 31 deletions(-) (limited to 'luaotfload-database.lua') diff --git a/luaotfload-database.lua b/luaotfload-database.lua index bd7a97b..31d3591 100644 --- a/luaotfload-database.lua +++ b/luaotfload-database.lua @@ -512,7 +512,7 @@ local verbose_lookup = function (data, kind, filename) return false end ---- string -> (string | string * string) +--- string -> (string * string * bool) crude_file_lookup_verbose = function (filename) if not names.data then names.data = load_names() end local data = names.data @@ -540,7 +540,7 @@ crude_file_lookup_verbose = function (filename) return filename, nil, false end ---- string -> (string | string * string) +--- string -> (string * string * bool) crude_file_lookup = function (filename) if not names.data then names.data = load_names() end local data = names.data @@ -833,14 +833,16 @@ resolve = function (_, _, specification) -- the 1st two parameters are used by C local candidates = { } --> secondary results, incomplete matches for n, face in next, data.mappings do - local family, subfamily, fullname, prefmodifiers - local psname, fontname, pfullname, metafamily + local family, metafamily + local prefmodifiers, fontstyle_name, subfamily + local psname, fullname, fontname, pfullname local facenames = face.sanitized if facenames then family = facenames.family subfamily = facenames.subfamily - prefmodifiers = facenames.prefmodifiers or facenames.subfamily + fontstyle_name = facenames.fontstyle_name + prefmodifiers = facenames.prefmodifiers or fontstyle_name or subfamily fullname = facenames.fullname psname = facenames.psname fontname = facenames.fontname @@ -853,7 +855,9 @@ resolve = function (_, _, specification) -- the 1st two parameters are used by C if name == family or name == metafamily then - if style == prefmodifiers then + if style == prefmodifiers + or style == fontstyle_name + then local continue exact, continue = add_to_match(exact, askedsize, face) if continue == false then break end @@ -1141,35 +1145,12 @@ ot_fullinfo = function (filename, subfont, texmf, basename) return nil end - -- see http://www.microsoft.com/typography/OTSPEC/features_pt.htm#size - if metadata.fontstyle_name then - for _, name in next, metadata.fontstyle_name do - if name.lang == 1033 then --- I hate magic numbers - namedata.fontstyle_name = name.name - end - end - end + local english_names if metadata.names then for _, raw_namedata in next, metadata.names do if raw_namedata.lang == "English (US)" then - local names = { - --- see - --- https://developer.apple.com/fonts/TTRefMan/RM06/Chap6name.html - fullname = raw_namedata.names.compatfull - or raw_namedata.names.fullname, - family = raw_namedata.names.preffamilyname - or raw_namedata.names.family, - prefmodifiers = raw_namedata.names.prefmodifiers, - subfamily = namedata.fontstyle_name - or raw_namedata.names.subfamily, - psname = raw_namedata.names.postscriptname, - pfullname = metadata.fullname, - fontname = metadata.fontname, - metafamily = metadata.familyname, - } --- namedata.names = names - namedata.sanitized = sanitize_names(names) + english_names = raw_namedata.names end end else @@ -1180,6 +1161,31 @@ ot_fullinfo = function (filename, subfont, texmf, basename) return end + local fontnames = { + --- see + --- https://developer.apple.com/fonts/TTRefMan/RM06/Chap6name.html + fullname = english_names.compatfull + or english_names.fullname, + family = english_names.preffamilyname + or english_names.family, + prefmodifiers = english_names.prefmodifiers, + subfamily = english_names.subfamily, + psname = english_names.postscriptname, + pfullname = metadata.fullname, + fontname = metadata.fontname, + metafamily = metadata.familyname, + } + + -- see http://www.microsoft.com/typography/OTSPEC/features_pt.htm#size + if metadata.fontstyle_name then + for _, name in next, metadata.fontstyle_name do + if name.lang == 1033 then --- I hate magic numbers + fontnames.fontstyle_name = name.name + end + end + end + + namedata.sanitized = sanitize_names (fontnames) namedata.fontname = metadata.fontname namedata.fullname = metadata.fullname -- cgit v1.2.3 From 98b8117843b91eea6d60a195f2905f249bfb7044 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 4 Aug 2013 13:33:24 +0200 Subject: [db] improve handling of zero values in design sizes --- luaotfload-database.lua | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'luaotfload-database.lua') diff --git a/luaotfload-database.lua b/luaotfload-database.lua index 31d3591..271e93c 100644 --- a/luaotfload-database.lua +++ b/luaotfload-database.lua @@ -102,7 +102,7 @@ if config.luaotfload.update_live ~= false then config.luaotfload.update_live = true end -names.version = 2.208 +names.version = 2.209 names.data = nil --- contains the loaded database names.lookups = nil --- contains the lookup cache @@ -259,6 +259,7 @@ This is a sketch of the luaotfload db: fullname : string; // <- metadata sanitized : { family : string; + fontstyle_name : string; // <- new in 2.4 fontname : string; // <- metadata fullname : string; // <- namedata.names metafamily : string; @@ -726,7 +727,7 @@ end local add_to_match = function (found, size, face) local optsize, dsnsize, maxsize, minsize - if #face.size > 0 then + if face.size ~= false then optsize = face.size dsnsize = optsize[1] and optsize[1] / 10 -- can be nil @@ -1197,11 +1198,21 @@ ot_fullinfo = function (filename, subfont, texmf, basename) namedata.units_per_em = metadata.units_per_em namedata.version = metadata.version -- don't waste the space with zero values - namedata.size = { - metadata.design_size ~= 0 and metadata.design_size or nil, - metadata.design_range_top ~= 0 and metadata.design_range_top or nil, - metadata.design_range_bottom ~= 0 and metadata.design_range_bottom or nil, - } + + local design_size = metadata.design_size + local design_range_top = metadata.design_range_top + local design_range_bottom = metadata.design_range_bottom + + if design_size ~= 0 + or design_range_top ~= 0 + or design_range_bottom ~= 0 + then + namedata.size = { + design_size, design_range_top, design_range_bottom, + } + else + namedata.size = false + end --- file location data (used to be filename field) namedata.filename = filename --> sys -- cgit v1.2.3 From 3cbbd94c24c6d3a3b7b6b0cda3ed2175b84373ad Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Mon, 5 Aug 2013 12:15:46 +0200 Subject: [db] handle missing optical size info --- luaotfload-database.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'luaotfload-database.lua') diff --git a/luaotfload-database.lua b/luaotfload-database.lua index 271e93c..7670ee6 100644 --- a/luaotfload-database.lua +++ b/luaotfload-database.lua @@ -726,16 +726,17 @@ end --- “found” is the match accumulator local add_to_match = function (found, size, face) - local optsize, dsnsize, maxsize, minsize - if face.size ~= false then - optsize = face.size + local continue = true + + local optsize = face.size + + if next (optsize) then + local dsnsize, maxsize, minsize dsnsize = optsize[1] and optsize[1] / 10 -- can be nil maxsize = optsize[2] and optsize[2] / 10 or dsnsize minsize = optsize[3] and optsize[3] / 10 or dsnsize - end - local continue = true - if optsize then + if dsnsize == size or (size > minsize and size <= maxsize) then found[1] = face continue = false ---> break @@ -746,6 +747,7 @@ local add_to_match = function (found, size, face) found[1] = face continue = false ---> break end + return found, continue end @@ -925,7 +927,7 @@ resolve = function (_, _, specification) -- the 1st two parameters are used by C local closest local least = math.huge -- initial value is infinity for i,face in next, found do - local dsnsize = face.size[1]/10 + local dsnsize = (face.size[1] or 0) / 10 local difference = mathabs(dsnsize - askedsize) if difference < least then closest = face -- cgit v1.2.3 From 1075688dae6cd26a52628d595bab3c4c5dae2e1d Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Mon, 5 Aug 2013 12:33:50 +0200 Subject: [db] pre-calculate design size values --- luaotfload-database.lua | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'luaotfload-database.lua') diff --git a/luaotfload-database.lua b/luaotfload-database.lua index 7670ee6..7e1a274 100644 --- a/luaotfload-database.lua +++ b/luaotfload-database.lua @@ -730,12 +730,11 @@ local add_to_match = function (found, size, face) local optsize = face.size - if next (optsize) then + if optsize and next (optsize) then local dsnsize, maxsize, minsize - dsnsize = optsize[1] and optsize[1] / 10 - -- can be nil - maxsize = optsize[2] and optsize[2] / 10 or dsnsize - minsize = optsize[3] and optsize[3] / 10 or dsnsize + dsnsize = optsize[1] + maxsize = optsize[2] + minsize = optsize[3] if dsnsize == size or (size > minsize and size <= maxsize) then found[1] = face @@ -926,14 +925,17 @@ resolve = function (_, _, specification) -- the 1st two parameters are used by C -- least difference from the requested size. local closest local least = math.huge -- initial value is infinity + for i,face in next, found do - local dsnsize = (face.size[1] or 0) / 10 + + local dsnsize = face.size and face.size[1] or 0 local difference = mathabs(dsnsize - askedsize) if difference < least then closest = face least = difference end end + local success, filename, subfont = get_font_file(data.filenames.full, closest) if success == true then @@ -1205,10 +1207,14 @@ ot_fullinfo = function (filename, subfont, texmf, basename) local design_range_top = metadata.design_range_top local design_range_bottom = metadata.design_range_bottom - if design_size ~= 0 - or design_range_top ~= 0 - or design_range_bottom ~= 0 - then + local fallback_size = design_size ~= 0 and design_size + or design_range_bottom ~= 0 and design_range_bottom + or design_range_top ~= 0 and design_range_top + + if fallback_size then + design_size = (design_size or fallback_size) / 10 + design_range_top = (design_range_top or fallback_size) / 10 + design_range_bottom = (design_range_bottom or fallback_size) / 10 namedata.size = { design_size, design_range_top, design_range_bottom, } @@ -1299,7 +1305,7 @@ t1_fullinfo = function (filename, _subfont, texmf, basename) namedata.weight = metadata.pfminfo.weight --- integer namedata.width = metadata.pfminfo.width - namedata.size = { } + namedata.size = false namedata.filename = filename --> sys namedata.basename = basename --> texmf -- cgit v1.2.3 From d6328e783739d68a132a33e0a95a2f7f90494f37 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Mon, 5 Aug 2013 12:51:49 +0200 Subject: [db] flush lookup cache on db version change; bump version --- luaotfload-database.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'luaotfload-database.lua') diff --git a/luaotfload-database.lua b/luaotfload-database.lua index 7e1a274..5cbedd4 100644 --- a/luaotfload-database.lua +++ b/luaotfload-database.lua @@ -102,7 +102,7 @@ if config.luaotfload.update_live ~= false then config.luaotfload.update_live = true end -names.version = 2.209 +names.version = 2.210 names.data = nil --- contains the loaded database names.lookups = nil --- contains the lookup cache @@ -2264,7 +2264,18 @@ update_names = function (fontnames, force, dry_run) names.data = newfontnames if dry_run ~= true then + save_names () + + local success, _lookups = flush_lookup_cache () + if success then + local success = names.save_lookups () + if success then + logs.names_report ("info", 2, "cache", + "Lookup cache emptied") + return true, true + end + end end return newfontnames end -- cgit v1.2.3 From 749917ae9796808d937c38375ebdb3fbfb0fcc1c Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Wed, 7 Aug 2013 12:26:22 +0200 Subject: [db] treat empty style in pfb as regular --- luaotfload-database.lua | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'luaotfload-database.lua') diff --git a/luaotfload-database.lua b/luaotfload-database.lua index 5cbedd4..11cc97d 100644 --- a/luaotfload-database.lua +++ b/luaotfload-database.lua @@ -1280,7 +1280,7 @@ t1_fullinfo = function (filename, _subfont, texmf, basename) end end - if not style then + if not style or style == "" then style = "regular" --- else italic end @@ -2273,18 +2273,13 @@ update_names = function (fontnames, force, dry_run) if success then logs.names_report ("info", 2, "cache", "Lookup cache emptied") - return true, true + return newfontnames end end end return newfontnames end ---- The lookup cache is an experimental feature of version 2.2; ---- instead of incorporating it into the database it gets its own ---- file. As we update it after every single addition this saves us ---- quite some time. - --- unit -> bool save_lookups = function ( ) local lookups = names.lookups -- cgit v1.2.3