summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/font-enh.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/font-enh.lua')
-rw-r--r--Master/texmf-dist/tex/context/base/font-enh.lua52
1 files changed, 36 insertions, 16 deletions
diff --git a/Master/texmf-dist/tex/context/base/font-enh.lua b/Master/texmf-dist/tex/context/base/font-enh.lua
index ca9893e3d84..9338fc20b15 100644
--- a/Master/texmf-dist/tex/context/base/font-enh.lua
+++ b/Master/texmf-dist/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+%05X to U+%05X",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+%05X to U+%05X",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 '%s' from U+%05X to U+%05X",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
@@ -164,7 +176,11 @@ registerafmfeature {
initializers = {
base = initializeunicoding,
node = initializeunicoding,
- }
+ },
+ -- manipulators = {
+ -- base = finalizeunicoding,
+ -- node = finalizeunicoding,
+ -- }
}
registerotffeature {
@@ -173,5 +189,9 @@ registerotffeature {
initializers = {
base = initializeunicoding,
node = initializeunicoding,
- }
+ },
+ -- manipulators = {
+ -- base = finalizeunicoding,
+ -- node = finalizeunicoding,
+ -- }
}