1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
-- There can be multiple treatments.lfg files in the tree and all are loaded in
-- the order specified by tree order access. The first treatment of a file
-- always wins, so one can overload. These files are not (to be) loaded with
-- font definitions. (Experiment as part of writing the font manual.)
--
-- So there are several ways to fix a font: add a patcher to a goodie file and
-- load that one. Such a patch can end up in the cached file. Treatments are
-- 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 = {
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)
pfminfo.os2_xheight_original = os2_xheight
pfminfo.os2_xheight = nil
end
end
end,
}
return {
name = "treatments",
version = "1.00",
comment = "Goodies that deals with some general issues.",
author = "Hans Hagen",
copyright = "ConTeXt development team",
treatments = {
-- we need to complete this list in order to be able to warn
-- users not to include these files unless permitted
["adobeheitistd-regular.otf"] = {
comment = "this font is part of acrobat",
ignored = false,
-- included = false, -- not yet
},
-- just an experiment .. normally no big deal but I ran into
-- such case
["crap.ttf"] = {
comment = "a text file with suffix ttf", -- used in test file
ignored = true,
},
["latinmodern-math.otf"] = {
comment = "experimental",
},
["unifrakturcook.ttf"] = unifraktur,
["unifrakturmaguntia.ttf"] = unifraktur,
},
}
|