summaryrefslogtreecommitdiff
path: root/otfl-font-xtx.lua
diff options
context:
space:
mode:
authorElie Roux <elie.roux@telecom-bretagne.eu>2009-06-10 20:21:00 +0300
committerElie Roux <elie.roux@telecom-bretagne.eu>2009-06-10 20:21:00 +0300
commit1ef10e57241a65e8ce2aeefdd83874e8999b7b44 (patch)
tree713769db5cdf9115e2824aa09e8f65cd795667f7 /otfl-font-xtx.lua
parent5821436af1c522206c3faf90e0813415445ea6c7 (diff)
downloadluaotfload-1ef10e57241a65e8ce2aeefdd83874e8999b7b44.tar.gz
syncing with latest ConTeXt version (more feautures, less bugs), thanks to Khaled Hosny
Diffstat (limited to 'otfl-font-xtx.lua')
-rw-r--r--otfl-font-xtx.lua26
1 files changed, 16 insertions, 10 deletions
diff --git a/otfl-font-xtx.lua b/otfl-font-xtx.lua
index 5672068..63e421f 100644
--- a/otfl-font-xtx.lua
+++ b/otfl-font-xtx.lua
@@ -61,17 +61,18 @@ local list = { }
fonts.define.specify.colonized_default_lookup = "file"
-local function issome() list.lookup = fonts.define.specify.colonized_default_lookup end
-local function isfile() list.lookup = 'file' end
-local function isname() list.lookup = 'name' end
-local function thename(s) list.name = s end
-local function iscrap(s) list.crap = string.lower(s) end
-local function istrue(s) list[s] = 'yes' end
-local function isfalse(s) list[s] = 'no' end
-local function iskey(k,v) list[k] = v end
+local function issome () list.lookup = fonts.define.specify.colonized_default_lookup end
+local function isfile () list.lookup = 'file' end
+local function isname () list.lookup = 'name' end
+local function thename(s) list.name = s end
+local function issub (v) list.sub = v end
+local function iscrap (s) list.crap = string.lower(s) end
+local function istrue (s) list[s] = 'yes' end
+local function isfalse(s) list[s] = 'no' end
+local function iskey (k,v) list[k] = v end
local spaces = lpeg.P(" ")^0
-local namespec = (1-lpeg.S("/: "))^0
+local namespec = (1-lpeg.S("/: ("))^0
local crapspec = spaces * lpeg.P("/") * (((1-lpeg.P(":"))^0)/iscrap) * spaces
local filename = (lpeg.P("file:")/isfile * (namespec/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)
@@ -80,9 +81,10 @@ local truevalue = lpeg.P("+") * spaces * (sometext/istrue)
local falsevalue = lpeg.P("-") * spaces * (sometext/isfalse)
local keyvalue = (lpeg.C(sometext) * spaces * lpeg.P("=") * spaces * lpeg.C(sometext))/iskey
local somevalue = sometext/istrue
+local subvalue = lpeg.P("(") * (lpeg.C(lpeg.P(1-lpeg.S("()"))^1)/issub) * lpeg.P(")") -- for Kim
local option = spaces * (keyvalue + falsevalue + truevalue + somevalue) * spaces
local options = lpeg.P(":") * spaces * (lpeg.P(";")^0 * option)^0
-local pattern = (filename + fontname) * crapspec^0 * options^0
+local pattern = (filename + fontname) * subvalue^0 * crapspec^0 * options^0
function fonts.define.specify.colonized(specification) -- xetex mode
list = { }
@@ -102,6 +104,10 @@ function fonts.define.specify.colonized(specification) -- xetex mode
specification.lookup = list.lookup
list.lookup = nil
end
+ if list.sub then
+ specification.sub = list.sub
+ list.sub = nil
+ end
specification.features.normal = list
return specification
end