diff options
author | Hans Hagen <pragma@wxs.nl> | 2017-02-19 17:46:26 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2017-02-19 17:46:26 +0100 |
commit | b5ef32a9a6a99e134e669b702e89a55fbabf5306 (patch) | |
tree | e0b152cee73c98ea43d93e707dad31bfdebc1ef0 /tex/context/base/mkiv/font-ext.lua | |
parent | 601e63e757d4cf40d5923cee4b6b3debff57364c (diff) | |
download | context-b5ef32a9a6a99e134e669b702e89a55fbabf5306.tar.gz |
2017-02-19 17:20:00
Diffstat (limited to 'tex/context/base/mkiv/font-ext.lua')
-rw-r--r-- | tex/context/base/mkiv/font-ext.lua | 52 |
1 files changed, 48 insertions, 4 deletions
diff --git a/tex/context/base/mkiv/font-ext.lua b/tex/context/base/mkiv/font-ext.lua index eb263d316..0b2bfd44f 100644 --- a/tex/context/base/mkiv/font-ext.lua +++ b/tex/context/base/mkiv/font-ext.lua @@ -556,10 +556,10 @@ local textitalics_specification = { registerotffeature(textitalics_specification) registerafmfeature(textitalics_specification) -local function initializemathitalics(tfmdata,value) -- yes no delay - tfmdata.properties.mathitalics = toboolean(value) -end - +-- local function initializemathitalics(tfmdata,value) -- yes no delay +-- tfmdata.properties.mathitalics = toboolean(value) +-- end +-- -- local mathitalics_specification = { -- name = "mathitalics", -- description = "use alternative math italic correction", @@ -1242,3 +1242,47 @@ do } end + +do -- another hack for a crappy font + + local function additalictowidth(tfmdata,key,value) + local characters = tfmdata.characters + local resources = tfmdata.resources + local additions = { } + local private = resources.private + for unicode, old_c in next, characters do + -- maybe check for math + local oldwidth = old_c.width + local olditalic = old_c.italic + if olditalic and olditalic ~= 0 then + private = private + 1 + local new_c = { + width = oldwidth + olditalic, + height = old_c.height, + depth = old_c.depth, + commands = { + { "slot", 1, private }, + { "right", olditalic }, + }, + } + setmetatableindex(new_c,old_c) + characters[unicode] = new_c + additions[private] = old_c + end + end + for k, v in next, additions do + characters[k] = v + end + resources.private = private + end + + registerotffeature { + name = "italicwidths", + description = "add italic to width", + manipulators = { + base = additalictowidth, + -- node = additalictowidth, -- only makes sense for math + } + } + +end |