/
hinting.xgf
59 lines (45 loc) · 1.87 KB
/
hinting.xgf
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
53
54
55
56
57
58
59
<?xml version="1.0" encoding="UTF-8"?>
<xgridfit xmlns="http://xgridfit.sourceforge.net/Xgridfit2">
<control-value name="font-units-per-square-cv" value="128" />
<constant name="font-units-per-square" value="128.0" />
<constant name="font-units-per-em" value="2048" />
<variable name="design-x-coord" value="0" />
<variable name="design-y-coord" value="0" />
<variable name="squares-per-em" value="0" />
<variable name="pixels-per-square" value="0" />
<variable name="scale" value="0" />
<macro name="scale-point">
<param name="point" />
<set-equal target="design-x-coord"
source="initial-x-coord(point) / control-value(font-units-per-square-cv)" />
<set-equal target="design-y-coord"
source="initial-y-coord(point) / control-value(font-units-per-square-cv)" />
<with-vectors axis="x">
<move pixel-distance="design-x-coord * scale">
<point num="point" />
</move>
</with-vectors>
<with-vectors axis="y">
<move pixel-distance="design-y-coord * scale">
<point num="point" />
</move>
</with-vectors>
</macro>
<pre-program>
<!-- Set to a large enough value to ensure that the control values are used at all sizes. -->
<set-control-value-cut-in value="2.0" />
<!-- Turns off drop-out-control -->
<set-dropout-control flags="0" threshold="0" />
<set-dropout-type value="2" />
<set-equal target="squares-per-em" source="font-units-per-em / font-units-per-square" />
<set-equal target="pixels-per-square" source="pixels-per-em / squares-per-em" />
<set-equal target="scale" source="floor(pixels-per-square)" />
</pre-program>
<!-- Call for every glyph in the font -->
<glyph ps-name="fill in">
<!-- Call for every point in the glyph -->
<call-macro name="scale-point">
<with-param name="point" value="fill in" />
</call-macro>
</glyph>
</xgridfit>