diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/font-ext.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/font-ext.lua | 59 |
1 files changed, 49 insertions, 10 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-ext.lua b/Master/texmf-dist/tex/context/base/mkiv/font-ext.lua index 189a588f146..98ad9e09ebf 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/font-ext.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/font-ext.lua @@ -554,17 +554,17 @@ 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", - initializers = { - base = initializemathitalics, - node = initializemathitalics, - } -} +-- local mathitalics_specification = { +-- name = "mathitalics", +-- description = "use alternative math italic correction", +-- initializers = { +-- base = initializemathitalics, +-- node = initializemathitalics, +-- } +-- } -registerotffeature(mathitalics_specification) -registerafmfeature(mathitalics_specification) +-- registerotffeature(mathitalics_specification) +-- registerafmfeature(mathitalics_specification) -- slanting @@ -925,6 +925,45 @@ registerotffeature { -- } -- } +-- not to be used! experimental code, only needed when testing + +local is_letter = characters.is_letter +local always = true + +local function collapseitalics(tfmdata,key,value) + local threshold = value == true and 100 or tonumber(value) + if threshold and threshold > 0 then + if threshold > 100 then + threshold = 100 + end + for unicode, data in next, tfmdata.characters do + if always or is_letter[unicode] or is_letter[data.unicode] then + local italic = data.italic + if italic and italic ~= 0 then + local width = data.width + if width and width ~= 0 then + local delta = threshold * italic / 100 + data.width = width + delta + data.italic = italic - delta + end + end + end + end + end +end + +local dimensions_specification = { + name = "collapseitalics", + description = "collapse italics", + manipulators = { + base = collapseitalics, + node = collapseitalics, + } +} + +registerotffeature(dimensions_specification) +registerafmfeature(dimensions_specification) + -- a handy helper (might change or be moved to another namespace) local nodepool = nodes.pool |