diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/font-pat.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/font-pat.lua | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/context/base/font-pat.lua b/Master/texmf-dist/tex/context/base/font-pat.lua index ae91700a90e..6aba4d47e3d 100644 --- a/Master/texmf-dist/tex/context/base/font-pat.lua +++ b/Master/texmf-dist/tex/context/base/font-pat.lua @@ -1,15 +1,17 @@ if not modules then modules = { } end modules ['font-pat'] = { version = 1.001, - comment = "companion to font-ini.tex", + comment = "companion to font-ini.mkiv", author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", copyright = "PRAGMA ADE / ConTeXt Development Team", license = "see context related readme files" } -local match, lower = string.match, string.lower +local match, lower, find = string.match, string.lower, string.find local trace_loading = false trackers.register("otf.loading", function(v) trace_loading = v end) +-- this will become a per font patch file +-- -- older versions of latin modern didn't have the designsize set -- so for them we get it from the name @@ -92,3 +94,33 @@ local function patch(data,filename) end patches["palatino.*arabic"] = patch + +local function patch_domh(data,filename,threshold) + local m = data.math + if m then + local d = m.DisplayOperatorMinHeight or 0 + if d < threshold then + if trace_loading then + logs.report("load otf","patching DisplayOperatorMinHeight(%s -> %s)",d,threshold) + end + m.DisplayOperatorMinHeight = threshold + end + end + if tex.luatexversion < 48 then + for _, g in next, data.glyphs do + local name = g.name + if find(name,"^integral$") or find(name,"^integral%.vsize") then + local width, italic = g.width or 0, g.italic_correction or 0 + local newwidth = width - italic + if trace_loading then + logs.report("load otf","patching width of %s: %s (width) - %s (italic) = %s",name,width,italic,newwidth) + end + g.width = newwidth + end + end + end +end + +patches["cambria"] = function(data,filename) patch_domh(data,filename,2800) end +patches["cambmath"] = function(data,filename) patch_domh(data,filename,2800) end +patches["asana"] = function(data,filename) patch_domh(data,filename,1350) end |