diff options
author | Hans Hagen <pragma@wxs.nl> | 2014-04-17 12:39:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2014-04-17 12:39:00 +0200 |
commit | dbde719e7593a47d67acd0fdc0aa48a0ea55c6e5 (patch) | |
tree | 0c450cd70f01c209e99952d9d48b4a92c73ad9b3 /tex/context/base/font-chk.lua | |
parent | 6ccaa7b5cce190bade86bc12ff90108fadf121e4 (diff) | |
download | context-dbde719e7593a47d67acd0fdc0aa48a0ea55c6e5.tar.gz |
beta 2014.04.17 12:39
Diffstat (limited to 'tex/context/base/font-chk.lua')
-rw-r--r-- | tex/context/base/font-chk.lua | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/tex/context/base/font-chk.lua b/tex/context/base/font-chk.lua index 178ca71be..9d612adc1 100644 --- a/tex/context/base/font-chk.lua +++ b/tex/context/base/font-chk.lua @@ -9,6 +9,8 @@ if not modules then modules = { } end modules ['font-chk'] = { -- possible optimization: delayed initialization of vectors -- move to the nodes namespace +local next = next + local formatters = string.formatters local bpfactor = number.dimenfactors.bp local fastcopy = table.fastcopy @@ -32,6 +34,8 @@ local getprivatenode = helpers.getprivatenode local otffeatures = fonts.constructors.newfeatures("otf") local registerotffeature = otffeatures.register +local afmfeatures = fonts.constructors.newfeatures("afm") +local registerafmfeature = afmfeatures.register local is_character = characters.is_character local chardata = characters.data @@ -403,3 +407,48 @@ local function expandglyph(characters,index,done) end helpers.expandglyph = expandglyph + +-- should not be needed as we add .notdef in the engine + +local dummyzero = { + -- width = 0, + -- height = 0, + -- depth = 0, + -- commands = { { "special", "pdf: q Q" } }, + commands = { { "special", "" } }, +} + +local function adddummysymbols(tfmdata,...) + local characters = tfmdata.characters + if not characters[0] then + characters[0] = dummyzero + end + -- temp test: + if not characters[1] then + characters[1] = dummyzero + end +end + +registerotffeature { + name = "dummies", + description = "dummy symbols", + default = true, + manipulators = { + base = adddummysymbols, + node = adddummysymbols, + } +} + +registerafmfeature { + name = "dummies", + description = "dummy symbols", + default = true, + manipulators = { + base = adddummysymbols, + node = adddummysymbols, + } +} + +-- callback.register("char_exists",function(f,c) -- to slow anyway as called often so we should flag in tfmdata +-- return true +-- end) |