summaryrefslogtreecommitdiff
path: root/tex/context/fonts/treatments.lfg
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2013-10-07 23:20:22 +0300
committerMarius <mariausol@gmail.com>2013-10-07 23:20:22 +0300
commitdf96ce30a9d14d115fef77a6abe1a5e852906f88 (patch)
treefa5fbfc3e924d50fe17320f7f3731970bf45581d /tex/context/fonts/treatments.lfg
parent44c1fc0eda825190cd117b7b16b60398d96a4cb7 (diff)
downloadcontext-df96ce30a9d14d115fef77a6abe1a5e852906f88.tar.gz
beta 2013.10.07 22:06
Diffstat (limited to 'tex/context/fonts/treatments.lfg')
-rw-r--r--tex/context/fonts/treatments.lfg36
1 files changed, 29 insertions, 7 deletions
diff --git a/tex/context/fonts/treatments.lfg b/tex/context/fonts/treatments.lfg
index 54f35d535..18a43525b 100644
--- a/tex/context/fonts/treatments.lfg
+++ b/tex/context/fonts/treatments.lfg
@@ -8,14 +8,16 @@
-- applied at runtime. An experimental auto-loaded goodie approach is not yet
-- enabled and will never be if treatments can do the job.
-local unifraktur = {
+local report = fonts.treatments.report
+
+local fix_unifraktur = {
comment = "suspicious x height",
fixes = function(data)
local pfminfo = data.metadata.pfminfo
if pfminfo then
local os2_xheight = pfminfo.os2_xheight
if os2_xheight and os2_xheight < 350 then
- fonts.treatments.report("suspicious x-height %a, nilling",os2_xheight)
+ report("suspicious x-height %a, nilling",os2_xheight)
pfminfo.os2_xheight_original = os2_xheight
pfminfo.os2_xheight = nil
end
@@ -23,6 +25,25 @@ local unifraktur = {
end,
}
+local fix_lmmonoregular = {
+ comment = "wrong widths of some glyphs",
+ fixes = function(data)
+ report("fixing some wrong widths")
+ local unicodes = data.resources.unicodes
+ local descriptions = data.descriptions
+ local defaultwidth = descriptions[unicodes["zero"]].width
+ descriptions[unicodes["six"] ].width = defaultwidth
+ descriptions[unicodes["nine"] ].width = defaultwidth
+ descriptions[unicodes["caron"] ].width = defaultwidth
+ descriptions[unicodes["perthousand"] ].width = defaultwidth
+ descriptions[unicodes["numero"] ].width = defaultwidth
+ descriptions[unicodes["caron.cap"] ].width = defaultwidth
+ descriptions[unicodes["six.taboldstyle"] ].width = defaultwidth
+ descriptions[unicodes["nine.taboldstyle"]].width = defaultwidth
+ descriptions[unicodes["dollar.oldstyle" ]].width = defaultwidth
+ end
+}
+
return {
name = "treatments",
version = "1.00",
@@ -43,10 +64,11 @@ return {
comment = "a text file with suffix ttf", -- used in test file
ignored = true,
},
- ["latinmodern-math.otf"] = {
- comment = "experimental",
- },
- ["unifrakturcook.ttf"] = unifraktur,
- ["unifrakturmaguntia.ttf"] = unifraktur,
+ -- ["latinmodern-math.otf"] = {
+ -- comment = "experimental",
+ -- },
+ ["lmmono12regular.otf"] = fix_lmmonoregular,
+ ["unifrakturcook.ttf"] = fix_unifraktur,
+ ["unifrakturmaguntia.ttf"] = fix_unifraktur,
},
}