Left: | ||
Right: |
OLD | NEW |
---|---|
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) 1999--2011 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 1999--2011 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
81 All_font_metrics::find_pango_font (PangoFontDescription const *description, | 81 All_font_metrics::find_pango_font (PangoFontDescription const *description, |
82 Real output_scale | 82 Real output_scale |
83 ) | 83 ) |
84 { | 84 { |
85 gchar *pango_fn = pango_font_description_to_filename (description); | 85 gchar *pango_fn = pango_font_description_to_filename (description); |
86 SCM key = ly_symbol2scm (pango_fn); | 86 SCM key = ly_symbol2scm (pango_fn); |
87 | 87 |
88 SCM val; | 88 SCM val; |
89 if (!pango_dict_->try_retrieve (key, &val)) | 89 if (!pango_dict_->try_retrieve (key, &val)) |
90 { | 90 { |
91 if (be_verbose_global) | 91 debug_output ("[" + string (pango_fn), true); // start on a new line |
Ian Hulin (gmail)
2011/07/30 17:10:00
Why do the logging output in two calls? Why not
Reinhold
2011/07/30 17:52:35
Because the following four lines until the "]" mig
| |
92 » progress_indication ("\n[" + string (pango_fn)); | |
93 | 92 |
94 Pango_font *pf = new Pango_font (pango_ft2_fontmap_, | 93 Pango_font *pf = new Pango_font (pango_ft2_fontmap_, |
95 description, | 94 description, |
96 output_scale | 95 output_scale |
97 ); | 96 ); |
98 ······ | 97 ······ |
99 val = pf->self_scm (); | 98 val = pf->self_scm (); |
100 pango_dict_->set (key, val); | 99 pango_dict_->set (key, val); |
101 pf->unprotect (); | 100 pf->unprotect (); |
102 | 101 |
103 if (be_verbose_global) | 102 debug_output ("]", false); |
Ian Hulin (gmail)
2011/07/30 17:10:00
Add the "]" to the previous debug_output call and
| |
104 » progress_indication ("]"); | |
105 | 103 |
106 pf->description_ = scm_cons (SCM_BOOL_F, | 104 pf->description_ = scm_cons (SCM_BOOL_F, |
107 scm_from_double (1.0)); | 105 scm_from_double (1.0)); |
108 } | 106 } |
109 g_free (pango_fn); | 107 g_free (pango_fn); |
110 return dynamic_cast<Pango_font *> (unsmob_metrics (val)); | 108 return dynamic_cast<Pango_font *> (unsmob_metrics (val)); |
111 } | 109 } |
112 | 110 |
113 #endif | 111 #endif |
114 | 112 |
115 | 113 |
116 Open_type_font * | 114 Open_type_font * |
117 All_font_metrics::find_otf (string name) | 115 All_font_metrics::find_otf (string name) |
118 { | 116 { |
119 SCM sname = ly_symbol2scm (name.c_str ()); | 117 SCM sname = ly_symbol2scm (name.c_str ()); |
120 SCM val; | 118 SCM val; |
121 if (!otf_dict_->try_retrieve (sname, &val)) | 119 if (!otf_dict_->try_retrieve (sname, &val)) |
122 { | 120 { |
123 string file_name; | 121 string file_name; |
124 | 122 |
125 if (file_name.empty ()) | 123 if (file_name.empty ()) |
126 file_name = search_path_.find (name + ".otf"); | 124 file_name = search_path_.find (name + ".otf"); |
127 if (file_name.empty ()) | 125 if (file_name.empty ()) |
128 return 0; | 126 return 0; |
129 | 127 |
130 if (be_verbose_global) | 128 debug_output ("[" + file_name, true); // start on a new line |
Ian Hulin (gmail)
2011/07/30 17:10:00
As for line 91 - do all the output in this call an
| |
131 » progress_indication ("\n[" + file_name); | |
132 | 129 |
133 val = Open_type_font::make_otf (file_name); | 130 val = Open_type_font::make_otf (file_name); |
134 | 131 |
135 if (be_verbose_global) | 132 debug_output ("]", false); |
136 » progress_indication ("]"); | |
137 | 133 |
138 unsmob_metrics (val)->file_name_ = file_name; | 134 unsmob_metrics (val)->file_name_ = file_name; |
139 SCM name_string = ly_string2scm (name); | 135 SCM name_string = ly_string2scm (name); |
140 unsmob_metrics (val)->description_ = scm_cons (name_string, | 136 unsmob_metrics (val)->description_ = scm_cons (name_string, |
141 scm_from_double (1.0)); | 137 scm_from_double (1.0)); |
142 otf_dict_->set (sname, val); | 138 otf_dict_->set (sname, val); |
143 unsmob_metrics (val)->unprotect (); | 139 unsmob_metrics (val)->unprotect (); |
144 } | 140 } |
145 | 141 |
146 return dynamic_cast<Open_type_font *> (unsmob_metrics (val)); | 142 return dynamic_cast<Open_type_font *> (unsmob_metrics (val)); |
147 } | 143 } |
148 | 144 |
149 Font_metric * | 145 Font_metric * |
150 All_font_metrics::find_font (string name) | 146 All_font_metrics::find_font (string name) |
151 { | 147 { |
152 Font_metric *f = find_otf (name); | 148 Font_metric *f = find_otf (name); |
153 | 149 |
154 if (!f) | 150 if (!f) |
155 { | 151 { |
156 error (_f ("cannot find font: `%s'", name.c_str ())); | 152 error (_f ("cannot find font: `%s'", name.c_str ())); |
157 } | 153 } |
158 | 154 |
159 return f; | 155 return f; |
160 } | 156 } |
161 | 157 |
162 All_font_metrics *all_fonts_global; | 158 All_font_metrics *all_fonts_global; |
OLD | NEW |