Left: | ||
Right: |
OLD | NEW |
---|---|
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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
111 .. cycle; | 111 .. cycle; |
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 | 122 |
122 linethickness := 0.5 pt#; | 123 linethickness := 0.5 pt#; |
123 increment := 0.5 pt#; | 124 increment := 0.5 pt#; |
125 fatten_factor := 1.5; | |
124 y := 10 pt#; | 126 y := 10 pt#; |
125 | 127 |
126 for i := 0 step 1 until font_count: | 128 for i := 0 step 1 until font_count: |
127 save number; | 129 save number; |
128 | 130 |
129 number := braces_per_font * i; | 131 number := braces_per_font * i; |
130 | 132 |
131 for j := 0 step 1 until (braces_per_font - 1): | 133 for j := 0 step 1 until (braces_per_font - 1): |
132 % message "l: "&decimal l; | 134 % message "l: "&decimal l; |
133 % note: define_pixels (x) multiplies x by hppp, | 135 % note: define_pixels (x) multiplies x by hppp, |
134 % must never get bigger than infinity | 136 % must never get bigger than infinity |
135 y := y + increment; | 137 y := y + increment; |
136 if y > infinity / hppp: | 138 if y > infinity / hppp: |
137 message "Resolution and/or magnification is too high"; | 139 message "Resolution and/or magnification is too high"; |
138 message "HPPP: "& decimal hppp &" Y: " & decimal y; | 140 message "HPPP: "& decimal hppp &" Y: " & decimal y; |
139 errmessage "please report to <bug-lilypond@gnu.org>"; | 141 errmessage "please report to <bug-lilypond@gnu.org>"; |
140 fi; | 142 fi; |
141 | 143 |
142 % x should be about one staff space, taking brace to have | 144 % x should be about one staff space, taking brace to have |
143 % default height of 3 staffs, this yields height / 3 / 4 = 12 | 145 % default height of 3 staffs, this yields height / 3 / 4 = 12 |
144 % but 15 looks better | 146 % but 15 looks better |
145 x := y / 15; | 147 x := y / 15; |
146 | 148 |
147 increment := x / 10; | 149 increment := x / 10; |
148 » » linethickness := min (0.5 pt#, y / 150); | 150 » » 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); | |
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; | |
153 » » linethickness := min (0.5 pt#, y * fatten / 150); | |
149 if i = font_count: | 154 if i = font_count: |
150 draw_brace (y, x, linethickness, number); | 155 draw_brace (y, x, linethickness, number); |
151 fi; | 156 fi; |
152 | 157 |
153 number := number + 1; | 158 number := number + 1; |
154 endfor; | 159 endfor; |
155 endfor; | 160 endfor; |
156 | 161 |
157 fet_endfont ("feta-braces"); | 162 fet_endfont ("feta-braces"); |
OLD | NEW |