Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 /* | 1 /* |
2 pango-font.cc -- implement Pango_font | 2 pango-font.cc -- implement Pango_font |
3 | 3 |
4 source file of the GNU LilyPond music typesetter | 4 source file of the GNU LilyPond music typesetter |
5 | 5 |
6 (c) 2004--2009 Han-Wen Nienhuys <hanwen@xs4all.nl> | 6 (c) 2004--2009 Han-Wen Nienhuys <hanwen@xs4all.nl> |
7 */ | 7 */ |
8 | 8 |
9 #define PANGO_ENABLE_BACKEND // ugh, why necessary? | 9 #define PANGO_ENABLE_BACKEND // ugh, why necessary? |
10 #include <pango/pangoft2.h> | 10 #include <pango/pangoft2.h> |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
340 Box empty; | 340 Box empty; |
341 empty.set_empty (); | 341 empty.set_empty (); |
342 Stencil dimless_frame (empty, frame.expr ()); | 342 Stencil dimless_frame (empty, frame.expr ()); |
343 dest.add_stencil (frame); | 343 dest.add_stencil (frame); |
344 } | 344 } |
345 #endif | 345 #endif |
346 | 346 |
347 dest.add_stencil (item_stencil); | 347 dest.add_stencil (item_stencil); |
348 } | 348 } |
349 | 349 |
350 // UGH. Should have flags per output format signifying supported | |
351 // options. | |
joeneeman
2009/07/21 18:43:10
Could you please have a look at this? (after apply
Patrick McCarty
2009/07/24 23:30:00
Hopefully the revised conditional tests look befor
| |
352 string name = get_output_backend_name (); | 350 string name = get_output_backend_name (); |
353 | 351 string output_mod = "scm output-" + name; |
354 // We want to filter text with encoding "fetaNumber" and | 352 SCM mod = scm_c_resolve_module (output_mod.c_str ()); |
355 // "fetaDynamic", because the SVG backend processes this text | 353 |
356 // with "glyph-string" instead of "utf-8-string". -pmccarty | 354 bool has_utf8_string = false; |
joeneeman
2009/07/26 02:05:34
I like this way of dealing with the ps backend muc
| |
357 if (name == "socket" || (name != "ps" && name != "eps" && !feta)) | 355 |
356 if (ly_is_module (mod)) | |
357 { | |
358 SCM utf8_string = ly_module_lookup (mod, ly_symbol2scm ("utf-8-string")); | |
359 if (utf8_string != SCM_BOOL_F) | |
360 » has_utf8_string = true; | |
361 } | |
362 | |
363 /* | |
364 The SVG backend only uses utf-8-string for the non-music | |
365 fonts, hence the check here. --pmccarty | |
366 */ | |
367 if ((name == "svg" && !feta) || (name != "svg" && has_utf8_string)) | |
joeneeman
2009/07/26 02:05:34
...but I think it would be ideal if the text_stenc
| |
358 { | 368 { |
359 // For Pango based backends, we take a shortcut. | 369 // For Pango based backends, we take a shortcut. |
360 SCM exp = scm_list_3 (ly_symbol2scm ("utf-8-string"), | 370 SCM exp = scm_list_3 (ly_symbol2scm ("utf-8-string"), |
361 ly_string2scm (description_string ()), | 371 ly_string2scm (description_string ()), |
362 ly_string2scm (str)); | 372 ly_string2scm (str)); |
363 | 373 |
364 Box b (Interval (0, 0), Interval (0, 0)); | 374 Box b (Interval (0, 0), Interval (0, 0)); |
365 b.unite (dest.extent_box ()); | 375 b.unite (dest.extent_box ()); |
366 return Stencil (b, exp); | 376 return Stencil (b, exp); |
367 } | 377 } |
(...skipping 12 matching lines...) Expand all Loading... | |
380 return s; | 390 return s; |
381 } | 391 } |
382 | 392 |
383 SCM | 393 SCM |
384 Pango_font::font_file_name () const | 394 Pango_font::font_file_name () const |
385 { | 395 { |
386 return SCM_BOOL_F; | 396 return SCM_BOOL_F; |
387 } | 397 } |
388 | 398 |
389 #endif // HAVE_PANGO_FT2 | 399 #endif // HAVE_PANGO_FT2 |
LEFT | RIGHT |