summaryrefslogtreecommitdiff
path: root/luaotfload-database.lua
diff options
context:
space:
mode:
authorElie Roux <elie.roux@telecom-bretagne.eu>2013-04-25 02:46:14 -0700
committerElie Roux <elie.roux@telecom-bretagne.eu>2013-04-25 02:46:14 -0700
commite6b0062da9c8315605e9c8a10202337416ea5cd5 (patch)
tree942ffddaa830a52504831526512ce48ddb5ab83d /luaotfload-database.lua
parent3d1c11400648c123b372e0cfce089175707a38f6 (diff)
parent7bf46ad63839d6e38a9c1e11ec7d4fba27d1bc51 (diff)
downloadluaotfload-e6b0062da9c8315605e9c8a10202337416ea5cd5.tar.gz
Merge pull request #7 from phi-gamma/master
add ``--alias`` option; catch oddity of Libertine tt
Diffstat (limited to 'luaotfload-database.lua')
-rw-r--r--luaotfload-database.lua28
1 files changed, 18 insertions, 10 deletions
diff --git a/luaotfload-database.lua b/luaotfload-database.lua
index d731038..e8f3d1d 100644
--- a/luaotfload-database.lua
+++ b/luaotfload-database.lua
@@ -201,10 +201,10 @@ load_names = function ( )
if data then
report("info", 1, "db",
"Font names database loaded", "%s", foundname)
- report("info", 1, "db", "Loading took %0.f ms",
+ report("info", 3, "db", "Loading took %0.f ms",
1000*(os.gettimeofday()-starttime))
else
- report("info", 0, "db",
+ report("info", 1, "db",
[[Font names database not found, generating new one.
This can take several minutes; please be patient.]])
data = update_names(fontnames_init())
@@ -398,6 +398,7 @@ resolve = function (_,_,specification) -- the 1st two parameters are used by Con
maxsize = optsize[2] and optsize[2] / 10 or dsnsize
minsize = optsize[3] and optsize[3] / 10 or dsnsize
end
+
if name == family then
if subfamily == style then
if optsize then
@@ -413,7 +414,8 @@ resolve = function (_,_,specification) -- the 1st two parameters are used by Con
break
end
elseif synonym_set[style] and
- synonym_set[style][subfamily] then
+ synonym_set[style][subfamily]
+ then
if optsize then
if dsnsize == size
or (size > minsize and size <= maxsize) then
@@ -429,7 +431,13 @@ resolve = function (_,_,specification) -- the 1st two parameters are used by Con
elseif subfamily == "regular" or
synonym_set.regular[subfamily] then
found.fallback = face
+ elseif name == fullname then
+ --- happens with Libertine Mono which has
+ --- “mono” as subfamily
+ found[1] = face
+ break
end
+
else
if name == fullname
or name == pfullname
@@ -930,9 +938,9 @@ local function scan_texmf_fonts(fontnames, newfontnames)
variables OPENTYPEFONTS and TTFONTS of texmf.cnf
]]
if stringis_empty(kpseexpand_path("$OSFONTDIR")) then
- report("info", 1, "db", "Scanning TEXMF fonts...")
+ report("info", 2, "db", "Scanning TEXMF fonts...")
else
- report("info", 1, "db", "Scanning TEXMF and OS fonts...")
+ report("info", 2, "db", "Scanning TEXMF and OS fonts...")
end
local fontdirs = stringgsub(kpseexpand_path("$OPENTYPEFONTS"), "^%.", "")
fontdirs = fontdirs .. stringgsub(kpseexpand_path("$TTFONTS"), "^%.", "")
@@ -1083,8 +1091,8 @@ local function scan_os_fonts(fontnames, newfontnames)
- fontcache for Unix (reads the fonts.conf file and scans the directories)
- a static set of directories for Windows and MacOSX
]]
- report("info", 1, "db", "Scanning OS fonts...")
- report("info", 2, "db", "Searching in static system directories...")
+ report("info", 2, "db", "Scanning OS fonts...")
+ report("info", 3, "db", "Searching in static system directories...")
for _,d in next, get_os_dirs() do
local found, new = scan_dir(d, fontnames, newfontnames, false)
n_scanned = n_scanned + found
@@ -1102,7 +1110,7 @@ update_names = function (fontnames, force)
- “newfontnames” is the final table to return
- force is whether we rebuild it from scratch or not
]]
- report("info", 1, "db", "Updating the font names database"
+ report("info", 2, "db", "Updating the font names database"
.. (force and " forcefully" or ""))
if force then
@@ -1136,9 +1144,9 @@ update_names = function (fontnames, force)
--- before rewrite | after rewrite
--- partial: 804 ms | 701 ms
--- forced: 45384 ms | 44714 ms
- report("info", 1, "db",
+ report("info", 3, "db",
"Scanned %d font files; %d new entries.", n_scanned, n_new)
- report("info", 1, "db",
+ report("info", 3, "db",
"Rebuilt in %0.f ms", 1000*(os.gettimeofday()-starttime))
return newfontnames
end