Debian Codegraph @

texmf-dist/fonts/source/public/knitting/knit_dimens.mf

raw
1 % Date: 2019/04/05
2
3 widewd# = 16.3pt#;
4 % This is as wide as a cell can be without causing problems with 5-cell-wide symbols
5 if known wd#: else: wd# = 12 pt#; fi
6 ht# + dp# = 12 pt#; ht#-dp# = 6.44444pt#;
7
8 symbolwidth#=0.7pt#;
9 purl_symbolwidth#=0.7pt#;
10 finesymbolwidth# = 0.4pt#;
11 dotwidth# = 1pt#;
12 gridwidth# = if gridfont: 0.3pt# else: 0pt# fi;
13 overlinewd# = if gridfont: 1.5pt# else: 0.8pt# fi;
14
15 eraserwidth# = 3pt#;
16 wrapturngap# = 2pt#;
17
18 o#:=0.4pt#; %Vertical overshoot
19 ho#:=o#; %Horizontal overshoot
20
21 % Vertical gaps
22 standardgap# = if gridfont: 3pt# else: 2.5pt# fi;
23 smallgap# = if gridfont: 2.5pt# else: 2pt# fi;
24 mingap# = if gridfont: 1.2pt# else: 1pt# fi;
25
26 botcableheight# - symbolwidth#/2 = (-dp# + smallgap#);
27 topcableheight# + symbolwidth#/2 = (ht# - smallgap#);
28
29 cablevertgap# = 3symbolwidth#;
30 cablebargap# = 4pt#;
31 cableslant# = 4pt#;
32
33 if known topgap#: else: topgap# = standardgap#; fi
34 if known bottomgap#: else: bottomgap# = standardgap#; fi
35
36 cableextend# := 0pt#;
37 % If your software is prone to leaving little gaps between the nogrid
38 % cable connectors, or in wide increases and decreases, you might want
39 % to make this nonzero.
40
41 if known gridcables: else: boolean gridcables; gridcables = gridfont; fi
42
43 nogrid_purlextend# := 0.2pt#;
44
45 if gridcables:
46 purlextend# := 0pt#;
47 else:
48 purlextend# := nogrid_purlextend#;
49 fi
50
51 % Purlextend affects how far outside their box the purl background goes.
52 %
53 % This is largely irrelevant when printing,
54 % but it makes the PDFs look much better.
55 %
56 % If you do a Knuth-esque bitmap-font customization to your
57 % particular printer, this is one parameter you *have* to fiddle with.
58
59 define_pixels(wd,ht,dp);
60 define_blacker_pixels(cableextend,purlextend,nogrid_purlextend,gridwidth,symbolwidth,
61 purl_symbolwidth, finesymbolwidth, overlinewidth, dotwidth);
62 define_pixels(eraserwidth,wrapturngap);
63 define_corrected_pixels(o,ho);
64 define_pixels(standardgap,smallgap,mingap,topgap,bottomgap,
65 cablevertgap,cablebargap,cableslant, botcableheight,topcableheight);
66
67 pickup pencircle scaled symbolwidth; symbol_pen := savepen;
68 pickup pencircle scaled dotwidth; dot_pen := savepen;
69 pickup pencircle scaled finesymbolwidth; fine_pen := savepen;
70 pickup pencircle scaled purl_symbolwidth; purl_symbol_pen := savepen;
71 pickup pencircle scaled eraserwidth; eraser_pen := savepen;
72
73 offset = (topgap-bottomgap)/2;
74 small_topgap = topgap + smallgap-standardgap;
75 small_bottomgap = bottomgap + smallgap-standardgap;
76 min_topgap = topgap + mingap-standardgap;
77 min_bottomgap = bottomgap + mingap-standardgap;
78
79 standardheight := ht+dp-topgap-bottomgap;
80 biggerheight := ht+dp-small_topgap-small_bottomgap;
81
82 font_size 10pt#;
83
84 font_slant := 0pt#; % fontdimen 1
85 font_normal_space := 0pt#; % fontdimen 2
86 font_normal_stretch := 0pt#; % fontdimen 3
87 font_normal_shrink := 0pt#; % fontdimen 4
88 font_x_height := ht#; % fontdimen 5
89 font_quad := wd#; % fontdimen 6
90 font_extra_space := 0pt#; % fontdimen 7
91
92 fontdimen 8: % Font dimensions 8+ listed here
93 dp#, % dimen 8: depth
94 % width is not needed because it is quad (dimen 6)
95 % height is not needed because it is xheight (dimen 5)
96 ht#+dp#, % dimen 9: height+depth (LaTeX height)
97 gridwidth#, % dimen 10: grid width
98 overlinewd#, % dimen 11: overline/bar width
99 (ht#+dp#)/8, % dimen 12: raise/lower symbols in narrow increases
100 (topgap#-bottomgap#), % dimen 13: vertical offset
101 purlextend#; % dimen 14: purl box outlap
102
103 if known incrwidthdefined: else:
104 def incrwidth (expr stsin, stsout) = 1*wd# enddef;
105 def decrwidth (expr stsin, stsout) = 1*wd# enddef;
106 fi
107 Vwidth := standardheight; % Used twice: v and y
108 Wwidth := biggerheight; % Used for make 3 from 1
109 wideincline := 2symbolwidth;
110 wideinctip := 0.3symbolwidth;
111
112 symbolmaxwd# = 82.244pt# - max(2purlextend#,gridwidth#);