summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/font-pat.lua
diff options
context:
space:
mode:
authorTaco Hoekwater <taco@elvenkind.com>2010-05-24 14:05:02 +0000
committerTaco Hoekwater <taco@elvenkind.com>2010-05-24 14:05:02 +0000
commit57ea7dad48fbf2541c04e434c31bde655ada3ac4 (patch)
tree1f8b43bc7cb92939271e1f5bec610710be69097f /Master/texmf-dist/tex/context/base/font-pat.lua
parent6ee41e1f1822657f7f23231ec56c0272de3855e3 (diff)
here is context 2010.05.24 13:05
git-svn-id: svn://tug.org/texlive/trunk@18445 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/font-pat.lua')
-rw-r--r--Master/texmf-dist/tex/context/base/font-pat.lua36
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