summaryrefslogtreecommitdiff
path: root/otfl-font-xtx.lua
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2010-06-07 07:28:24 +0300
committerKhaled Hosny <khaledhosny@eglug.org>2010-06-07 07:28:24 +0300
commitb4d1df9e054a2082ea85dabaf5082f4cc548cdb8 (patch)
treeec163d2c6b2166ee596678ad6aad588d8a07b578 /otfl-font-xtx.lua
parent61b06ffa25195a6bfd145c0311ed0d0160ff2259 (diff)
downloadluaotfload-b4d1df9e054a2082ea85dabaf5082f4cc548cdb8.tar.gz
Fix loading fonts with absolute path
Also, as a side effect, fixes loading Windows paths starting with drive letter. closes #10
Diffstat (limited to 'otfl-font-xtx.lua')
-rw-r--r--otfl-font-xtx.lua7
1 files changed, 3 insertions, 4 deletions
diff --git a/otfl-font-xtx.lua b/otfl-font-xtx.lua
index 7da29d3..413769d 100644
--- a/otfl-font-xtx.lua
+++ b/otfl-font-xtx.lua
@@ -173,11 +173,10 @@ local function istrue (s) list[s] = true end
local function isfalse(s) list[s] = false end
local spaces = lpeg.P(" ")^0
--- ER: now accepting names like C:/program files/texlive/2009/...
-local namespec = (lpeg.R("az", "AZ") * lpeg.P(":"))^-1 * (1-lpeg.S("/:("))^1 -- was: (1-lpeg.S("/: ("))^0
+local namespec = (1-lpeg.S("/:("))^0 -- was: (1-lpeg.S("/: ("))^0
+local filespec = (lpeg.R("az", "AZ") * lpeg.P(":"))^-1 * (1-lpeg.S(":("))^1
local crapspec = spaces * lpeg.P("/") * (((1-lpeg.P(":"))^0)/isstyle) * spaces
--- ER: can't understand why the 'file:' thing doesn't work with fontnames starting by c:...
-local filename = (lpeg.P("file:")/isfile * (namespec/thename)) + (lpeg.P("[") * lpeg.P(true)/isname * (((1-lpeg.P("]"))^0)/thename) * lpeg.P("]"))
+local filename = (lpeg.P("file:")/isfile * (filespec/thename)) + (lpeg.P("[") * lpeg.P(true)/isname * (((1-lpeg.P("]"))^0)/thename) * lpeg.P("]"))
local fontname = (lpeg.P("name:")/isname * (namespec/thename)) + lpeg.P(true)/issome * (namespec/thename)
local sometext = (lpeg.R("az","AZ","09") + lpeg.S("+-."))^1
local truevalue = lpeg.P("+") * spaces * (sometext/istrue)