summaryrefslogtreecommitdiff
path: root/otfl-font-map.lua
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2009-12-30 11:17:04 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2009-12-30 13:20:31 +0200
commit1005e9ef11f07210130b96c03811b0762b13e33c (patch)
treec5cbe010bf9e24dcb19e5a3179ff311a149cdfeb /otfl-font-map.lua
parentd4cccf105bb508150dc765c93bb47bf6f9a87f81 (diff)
downloadluaotfload-1005e9ef11f07210130b96c03811b0762b13e33c.tar.gz
Updating to latest ConTeXt beta (2009.12.29)
Diffstat (limited to 'otfl-font-map.lua')
-rw-r--r--otfl-font-map.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/otfl-font-map.lua b/otfl-font-map.lua
index 4cb4976..9e85516 100644
--- a/otfl-font-map.lua
+++ b/otfl-font-map.lua
@@ -6,7 +6,8 @@ if not modules then modules = { } end modules ['font-map'] = {
license = "see context related readme files"
}
-local match, format, find, concat = string.match, string.format, string.find, table.concat
+local match, format, find, concat, gsub = string.match, string.format, string.find, table.concat, string.gsub
+local lpegmatch = lpeg.match
local trace_loading = false trackers.register("otf.loading", function(v) trace_loading = v end)
@@ -88,7 +89,7 @@ function fonts.map.load_file(filename, entries, encodings)
-- print(line)
else
local extend, slant, name, fullname, fontfile, encoding
- line = line:gsub('"(.+)"', function(s)
+ line = gsub(line,'"(.+)"', function(s)
extend = find(s,'"([^"]+) ExtendFont"')
slant = find(s,'"([^"]+) SlantFont"')
return ""
@@ -169,7 +170,7 @@ end
--~ local parser = fonts.map.make_name_parser("Japan1")
--~ local parser = fonts.map.make_name_parser()
--~ local function test(str)
---~ local b, a = parser:match(str)
+--~ local b, a = lpegmatch(parser,str)
--~ print((a and table.serialize(b)) or b)
--~ end
--~ test("a.sc")