diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2011-10-03 22:55:27 +0200 |
---|---|---|
committer | Khaled Hosny <khaledhosny@eglug.org> | 2011-10-03 22:55:27 +0200 |
commit | b59eb68344f3fce00c03ab075032561fe8a69950 (patch) | |
tree | b822948cc9e186a67218ffa4a81f7b6abbd5b604 | |
parent | fefa84ef5bb84934f5e210624a03b977245af633 (diff) | |
parent | d085e0bbd9bc778216f47a00f36d1ab5a313c159 (diff) | |
download | luaotfload-b59eb68344f3fce00c03ab075032561fe8a69950.tar.gz |
Merge branch 'master' into unstable
-rw-r--r-- | luaotfload.dtx | 2 | ||||
-rw-r--r-- | otfl-font-nms.lua | 14 |
2 files changed, 13 insertions, 3 deletions
diff --git a/luaotfload.dtx b/luaotfload.dtx index 36f403f..677570b 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -219,7 +219,7 @@ and the derived files % % The \meta{prefix} be either |file:| or |name:|, which specify % whether to use a select the font from its filename or font name, -% respectively. If no prefix is specified, then |file:| is assumed. +% respectively. If no prefix is specified |name:| is assumed. % % For compatibility with \xetex, surrounding the \meta{font name} % with square brackets is synonymous to using the |file:| prefix. diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua index 6e8b8be..dcd75d3 100644 --- a/otfl-font-nms.lua +++ b/otfl-font-nms.lua @@ -224,6 +224,8 @@ function names.resolve(specification) return names.resolve(specification) else -- else, fallback to filename + -- XXX: specification.name is empty with absolute paths, looks + -- like a bug in the specification parser return specification.name, false end end @@ -585,7 +587,10 @@ local function read_fonts_conf(path, results) ]] local f = io.open(path) if not f then - error("Cannot open the file "..path) + if trace_search then + logs.report("cannot open file", "%s", path) + end + return results end local incomments = false for line in f:lines() do @@ -667,8 +672,13 @@ local function get_os_dirs() local windir = os.getenv("WINDIR") return { file.join(windir, 'Fonts') } else - return read_fonts_conf("/etc/fonts/fonts.conf", {}) + for _,p in next, {"/usr/local/etc/fonts/fonts.conf", "/etc/fonts/fonts.conf"} do + if lfs.isfile(p) then + return read_fonts_conf("/etc/fonts/fonts.conf", {}) + end + end end + return {} end local function scan_os_fonts(fontnames, newfontnames) |