diff options
author | Hans Hagen <pragma@wxs.nl> | 2009-11-24 10:13:00 +0100 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2009-11-24 10:13:00 +0100 |
commit | d59c05050d5ff72bb4c9496b06e42648ed5f982e (patch) | |
tree | 04762cf35b4f56182378890b62a11190353e9177 /tex/context/base/font-pat.lua | |
parent | 79817aae214b6a02b8a23c90e7d5e8fb4da6b80f (diff) | |
download | context-d59c05050d5ff72bb4c9496b06e42648ed5f982e.tar.gz |
beta 2009.11.24 10:13
Diffstat (limited to 'tex/context/base/font-pat.lua')
-rw-r--r-- | tex/context/base/font-pat.lua | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tex/context/base/font-pat.lua b/tex/context/base/font-pat.lua index 65e8355c7..e720af79c 100644 --- a/tex/context/base/font-pat.lua +++ b/tex/context/base/font-pat.lua @@ -6,7 +6,7 @@ if not modules then modules = { } end modules ['font-pat'] = { 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) @@ -106,6 +106,17 @@ local function patch_domh(data,filename,threshold) m.DisplayOperatorMinHeight = threshold end end + for _, g in pairs(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 patches["cambria"] = function(data,filename) patch_domh(data,filename,2800) end |