diff options
author | Karl Berry <karl@freefriends.org> | 2013-04-08 00:43:40 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-04-08 00:43:40 +0000 |
commit | 824f7b0903de8ad7f6ee3d7656005e4c59155e06 (patch) | |
tree | abfc8673ef9916f3ab7074e811207384c301492b /Master/texmf-dist/tex/context/base/font-enh.lua | |
parent | 689aefb0727676ed3cddf331337b4be226495e72 (diff) |
context import for TL13, from www.pragma-ade.com/context/beta/cont-tmf.zip
git-svn-id: svn://tug.org/texlive/trunk@29731 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/font-enh.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/font-enh.lua | 52 |
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, + -- } } |