Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 % Feta (not the Font-En-Tja) music font -- Staff braces | 1 % Feta (not the Font-En-Tja) music font -- Staff braces |
2 % This file is part of LilyPond, the GNU music typesetter. | 2 % This file is part of LilyPond, the GNU music typesetter. |
3 % | 3 % |
4 % Copyright (C) 1997--2011 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 % Copyright (C) 1997--2011 Han-Wen Nienhuys <hanwen@xs4all.nl> |
5 % Jan Nieuwenhuizen <janneke@gnu.org> | 5 % Jan Nieuwenhuizen <janneke@gnu.org> |
6 % | 6 % |
7 % LilyPond is free software: you can redistribute it and/or modify | 7 % LilyPond is free software: you can redistribute it and/or modify |
8 % it under the terms of the GNU General Public License as published by | 8 % it under the terms of the GNU General Public License as published by |
9 % the Free Software Foundation, either version 3 of the License, or | 9 % the Free Software Foundation, either version 3 of the License, or |
10 % (at your option) any later version. | 10 % (at your option) any later version. |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
112 | 112 |
113 fill pat; | 113 fill pat; |
114 fill pat yscaled -1; | 114 fill pat yscaled -1; |
115 fet_endchar; | 115 fet_endchar; |
116 enddef; | 116 enddef; |
117 | 117 |
118 | 118 |
119 save stafflinethickness; | 119 save stafflinethickness; |
120 save increment; | 120 save increment; |
121 save fatten_factor; | 121 save fatten_factor; |
122 save fatten_limit; | |
122 | 123 |
123 linethickness := 0.5 pt#; | 124 linethickness := 0.5 pt#; |
124 increment := 0.5 pt#; | 125 increment := 0.5 pt#; |
125 fatten_factor := 1.5; | 126 fatten_factor := 2.5; |
127 fatten_limit := 4 * braces_per_font; | |
126 y := 10 pt#; | 128 y := 10 pt#; |
127 | 129 |
128 for i := 0 step 1 until font_count: | 130 for i := 0 step 1 until font_count: |
129 save number; | 131 save number; |
130 | 132 |
131 number := braces_per_font * i; | 133 number := braces_per_font * i; |
132 | 134 |
133 for j := 0 step 1 until (braces_per_font - 1): | 135 for j := 0 step 1 until (braces_per_font - 1): |
134 % message "l: "&decimal l; | 136 % message "l: "&decimal l; |
135 % note: define_pixels (x) multiplies x by hppp, | 137 % note: define_pixels (x) multiplies x by hppp, |
136 % must never get bigger than infinity | 138 % must never get bigger than infinity |
137 y := y + increment; | 139 y := y + increment; |
138 if y > infinity / hppp: | 140 if y > infinity / hppp: |
139 message "Resolution and/or magnification is too high"; | 141 message "Resolution and/or magnification is too high"; |
140 message "HPPP: "& decimal hppp &" Y: " & decimal y; | 142 message "HPPP: "& decimal hppp &" Y: " & decimal y; |
141 errmessage "please report to <bug-lilypond@gnu.org>"; | 143 errmessage "please report to <bug-lilypond@gnu.org>"; |
142 fi; | 144 fi; |
143 | 145 |
144 % x should be about one staff space, taking brace to have | 146 % x should be about one staff space, taking brace to have |
145 % default height of 3 staffs, this yields height / 3 / 4 = 12 | 147 % default height of 3 staffs, this yields height / 3 / 4 = 12 |
146 % but 15 looks better | 148 % but 15 looks better |
147 x := y / 15; | 149 x := y / 15; |
148 | 150 |
149 increment := x / 10; | 151 increment := x / 10; |
150 save fatten; | 152 save fatten; |
Trevor Daniels
2011/05/10 22:53:55
I don't think this placement of the save causes
an
Bertrand Bordage
2011/05/10 23:15:02
That's what I thought at first. Then I saw "save n
| |
151 » » fatten := 1 + fatten_factor - min ( number * fatten_factor / 256 , fatten_factor); | 153 » » fatten := min(number / fatten_limit, 1)[fatten_factor, 1]; |
dak
2011/05/11 08:54:40
This is a bit obscure to me. How about
fatte
Bertrand Bordage
2011/05/11 09:22:14
Thanks !
Hum...
I agree with your idea of making t
| |
152 x := x * fatten; | 154 x := x * fatten; |
153 linethickness := min (0.5 pt#, y * fatten / 150); | 155 linethickness := min (0.5 pt#, y * fatten / 150); |
154 if i = font_count: | 156 if i = font_count: |
155 draw_brace (y, x, linethickness, number); | 157 draw_brace (y, x, linethickness, number); |
156 fi; | 158 fi; |
157 | 159 |
158 number := number + 1; | 160 number := number + 1; |
159 endfor; | 161 endfor; |
160 endfor; | 162 endfor; |
161 | 163 |
162 fet_endfont ("feta-braces"); | 164 fet_endfont ("feta-braces"); |
LEFT | RIGHT |