diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-06-06 20:26:50 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-06-06 20:26:50 +0200 |
commit | d78828b55508aae49922032ebd9117804a940f73 (patch) | |
tree | 431d8c001f14d8001ba11c6e2803ef83ba65c9fe /tex/context/base/mkiv/good-ctx.lua | |
parent | 7a761c8aebf67ee022aa4857247518ad6997d5c1 (diff) | |
download | context-d78828b55508aae49922032ebd9117804a940f73.tar.gz |
2016-06-06 19:57:00
Diffstat (limited to 'tex/context/base/mkiv/good-ctx.lua')
-rw-r--r-- | tex/context/base/mkiv/good-ctx.lua | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/tex/context/base/mkiv/good-ctx.lua b/tex/context/base/mkiv/good-ctx.lua index 4c8b9fcff..00e4ed78d 100644 --- a/tex/context/base/mkiv/good-ctx.lua +++ b/tex/context/base/mkiv/good-ctx.lua @@ -44,6 +44,8 @@ local colorschemes = fontgoodies.colorschemes or allocate { } fontgoodies.colorschemes = colorschemes colorschemes.data = colorschemes.data or { } +local privatestoo = true + local function setcolorscheme(tfmdata,scheme) if type(scheme) == "string" then local goodies = tfmdata.goodies @@ -65,13 +67,16 @@ local function setcolorscheme(tfmdata,scheme) local w = what[i] for j=1,#w do local name = w[j] + local kind = type(name) if name == "*" then -- inefficient but only used for tracing anyway for _, unicode in next, hash do reverse[unicode] = i end - elseif type(name) == "number" then + elseif kind == "number" then reverse[name] = i + elseif kind ~= "string" then + -- ignore invalid entries elseif find(name,":",1,true) then local start, stop = splitup(name,":") start = tonumber(start) @@ -94,6 +99,26 @@ local function setcolorscheme(tfmdata,scheme) end end end + if privatestoo then + local private = fonts.constructors.privateoffset + local descriptions = tfmdata.descriptions + for unicode, data in next, characters do + if unicode >= private then + if not reverse[unicode] then + local d = descriptions[unicode] + if d then + local u = d.unicode + if u then + local r = reverse[u] -- also catches tables + if r then + reverse[unicode] = r + end + end + end + end + end + end + end tfmdata.properties.colorscheme = reverse return end |