summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/font-cid.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/font-cid.lua')
-rw-r--r--Master/texmf-dist/tex/context/base/font-cid.lua13
1 files changed, 8 insertions, 5 deletions
diff --git a/Master/texmf-dist/tex/context/base/font-cid.lua b/Master/texmf-dist/tex/context/base/font-cid.lua
index 13e9cce8949..d1c727af2d9 100644
--- a/Master/texmf-dist/tex/context/base/font-cid.lua
+++ b/Master/texmf-dist/tex/context/base/font-cid.lua
@@ -6,8 +6,9 @@ if not modules then modules = { } end modules ['font-cid'] = {
license = "see context related readme files"
}
-local format, match = string.format, string.match
+local format, match, lower = string.format, string.match, string.lower
local tonumber = tonumber
+local lpegmatch = lpeg.match
local trace_loading = false trackers.register("otf.loading", function(v) trace_loading = v end)
@@ -61,7 +62,7 @@ function fonts.cid.load(filename)
local data = io.loaddata(filename)
if data then
unicodes, names = { }, { }
- grammar:match(data)
+ lpegmatch(grammar,data)
local supplement, registry, ordering = match(filename,"^(.-)%-(.-)%-()%.(.-)$")
return {
supplement = supplement,
@@ -78,9 +79,11 @@ end
local template = "%s-%s-%s.cidmap"
+
local function locate(registry,ordering,supplement)
- local filename = string.lower(format(template,registry,ordering,supplement))
- local cidmap = fonts.cid.map[filename]
+ local filename = format(template,registry,ordering,supplement)
+ local hashname = lower(filename)
+ local cidmap = fonts.cid.map[hashname]
if not cidmap then
if trace_loading then
logs.report("load otf","checking cidmap, registry: %s, ordering: %s, supplement: %s, filename: %s",registry,ordering,supplement,filename)
@@ -92,7 +95,7 @@ local function locate(registry,ordering,supplement)
if trace_loading then
logs.report("load otf","using cidmap file %s",filename)
end
- fonts.cid.map[filename] = cidmap
+ fonts.cid.map[hashname] = cidmap
cidmap.usedname = file.basename(filename)
return cidmap
end