summaryrefslogtreecommitdiff
path: root/tex/context/base/font-enh.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/font-enh.lua')
-rw-r--r--tex/context/base/font-enh.lua40
1 files changed, 26 insertions, 14 deletions
diff --git a/tex/context/base/font-enh.lua b/tex/context/base/font-enh.lua
index 65bbe7bd9..9338fc20b 100644
--- a/tex/context/base/font-enh.lua
+++ b/tex/context/base/font-enh.lua
@@ -8,8 +8,12 @@ if not modules then modules = { } end modules ['font-enh'] = {
local next = next
-local trace_defining = false trackers.register("fonts.defining", function(v) trace_defining = v end)
-local report_defining = logs.reporter("fonts","defining")
+local trace_unicoding = false
+
+trackers.register("fonts.defining", function(v) trace_unicoding = v end)
+trackers.register("fonts.unicoding", function(v) trace_unicoding = v end)
+
+local report_unicoding = logs.reporter("fonts","unicoding")
local fonts = fonts
local constructors = fonts.constructors
@@ -43,8 +47,8 @@ local registerotffeature = otffeatures.register
-- end
-- for newcode, oldcode in next, data.unicodes do
-- if newcode ~= oldcode then
--- if trace_defining then
--- report_defining("reencoding %U to %U",oldcode,newcode)
+-- if trace_unicoding then
+-- report_unicoding("reencoding %U to %U",oldcode,newcode)
-- end
-- characters[newcode] = original[oldcode]
-- end
@@ -71,8 +75,8 @@ local registerotffeature = otffeatures.register
-- end
-- for k,v in next, vector do
-- if k ~= v then
--- if trace_defining then
--- report_defining("remapping %U to %U",k,v)
+-- if trace_unicoding then
+-- report_unicoding("remapping %U to %U",k,v)
-- end
-- local c = original[k]
-- characters[v] = c
@@ -137,13 +141,17 @@ local function initializeunicoding(tfmdata)
description = descriptions[newcode],
}
end
- local original = originals[oldcode]
- if original then
- characters [newcode] = original.character
- descriptions[newcode] = original.description
+ if oldcode then
+ local original = originals[oldcode]
+ if original then
+ characters [newcode] = original.character
+ descriptions[newcode] = original.description
+ else
+ characters [newcode] = characters [oldcode]
+ descriptions[newcode] = descriptions[oldcode]
+ end
else
- characters [newcode] = characters [oldcode]
- descriptions[newcode] = descriptions[oldcode]
+ oldcoding[name] = newcode
end
if tounicode then
local index = descriptions[newcode].index
@@ -151,8 +159,12 @@ local function initializeunicoding(tfmdata)
tounicodes[index] = tosixteen(newcode) -- shared (we could have a metatable)
end
end
- if trace_defining then
- report_defining("aliasing glyph %a from %U to %U",name,oldcode,newcode)
+ if trace_unicoding then
+ if oldcode then
+ report_unicoding("aliasing glyph %a from %U to %U",name,oldcode,newcode)
+ else
+ report_unicoding("aliasing glyph %a to %U",name,newcode)
+ end
end
end
end