LEFT | RIGHT |
1 /* | 1 /* |
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) 2004--2012 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 2004--2012 Han-Wen Nienhuys <hanwen@xs4all.nl> |
5 | 5 |
6 LilyPond is free software: you can redistribute it and/or modify | 6 LilyPond is free software: you can redistribute it and/or modify |
7 it under the terms of the GNU General Public License as published by | 7 it under the terms of the GNU General Public License as published by |
8 the Free Software Foundation, either version 3 of the License, or | 8 the Free Software Foundation, either version 3 of the License, or |
9 (at your option) any later version. | 9 (at your option) any later version. |
10 | 10 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 // will generate a lot of warnings | 104 // will generate a lot of warnings |
105 warning ("Cannot make glyph outline"); | 105 warning ("Cannot make glyph outline"); |
106 #endif | 106 #endif |
107 return box_to_scheme_lines (ly_FT_get_unscaled_indexed_char_dimensions (fa
ce, signed_idx)); | 107 return box_to_scheme_lines (ly_FT_get_unscaled_indexed_char_dimensions (fa
ce, signed_idx)); |
108 } | 108 } |
109 | 109 |
110 FT_Outline *outline; | 110 FT_Outline *outline; |
111 outline = &(face->glyph->outline); | 111 outline = &(face->glyph->outline); |
112 SCM out = SCM_EOL; | 112 SCM out = SCM_EOL; |
113 Offset lastpos; | 113 Offset lastpos; |
| 114 Offset firstpos; |
114 vsize j = 0; | 115 vsize j = 0; |
115 while (j < outline->n_points) | 116 while (j < outline->n_points) |
116 { | 117 { |
117 if (j == 0) | 118 if (j == 0) |
118 { | 119 { |
119 lastpos = Offset (outline->points[j].x, outline->points[j].y); | 120 firstpos = Offset (outline->points[j].x, outline->points[j].y); |
| 121 lastpos = firstpos; |
120 j++; | 122 j++; |
121 } | 123 } |
122 else if (outline->tags[j] & 1) | 124 else if (outline->tags[j] & 1) |
123 { | 125 { |
124 // it is a line | 126 // it is a line |
125 out = scm_cons (scm_list_4 (scm_from_double (lastpos[X_AXIS]), | 127 out = scm_cons (scm_list_4 (scm_from_double (lastpos[X_AXIS]), |
126 scm_from_double (lastpos[Y_AXIS]), | 128 scm_from_double (lastpos[Y_AXIS]), |
127 scm_from_double (outline->points[j].x), | 129 scm_from_double (outline->points[j].x), |
128 scm_from_double (outline->points[j].y)), | 130 scm_from_double (outline->points[j].y)), |
129 out); | 131 out); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 scm_from_double (cy2), | 185 scm_from_double (cy2), |
184 scm_from_double (cx3), | 186 scm_from_double (cx3), |
185 scm_from_double (cy3), | 187 scm_from_double (cy3), |
186 SCM_UNDEFINED), | 188 SCM_UNDEFINED), |
187 out); | 189 out); |
188 lastpos = Offset (outline->points[j + 1].x, outline->points[j + 1].y); | 190 lastpos = Offset (outline->points[j + 1].x, outline->points[j + 1].y); |
189 j += 2; | 191 j += 2; |
190 } | 192 } |
191 } | 193 } |
192 | 194 |
| 195 // just in case, close the figure |
| 196 out = scm_cons (scm_list_4 (scm_from_double (lastpos[X_AXIS]), |
| 197 scm_from_double (lastpos[Y_AXIS]), |
| 198 scm_from_double (firstpos[X_AXIS]), |
| 199 scm_from_double (firstpos[Y_AXIS])), |
| 200 out); |
| 201 |
193 out = scm_reverse_x (out, SCM_EOL); | 202 out = scm_reverse_x (out, SCM_EOL); |
194 return out; | 203 return out; |
195 } | 204 } |
LEFT | RIGHT |