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) 2004--2015 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 2004--2015 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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 SCM | 380 SCM |
381 Pango_font::physical_font_tab () const | 381 Pango_font::physical_font_tab () const |
382 { | 382 { |
383 return physical_font_tab_; | 383 return physical_font_tab_; |
384 } | 384 } |
385 | 385 |
386 extern bool music_strings_to_paths; | 386 extern bool music_strings_to_paths; |
387 | 387 |
388 Stencil | 388 Stencil |
389 Pango_font::text_stencil (Output_def * /* state */, | 389 Pango_font::text_stencil (Output_def * /* state */, |
390 const string &str, bool music_string) const | 390 const string &str, |
| 391 bool music_string, |
| 392 const string &features_str) const |
391 { | 393 { |
392 /* | 394 /* |
393 The text assigned to a PangoLayout is automatically divided | 395 The text assigned to a PangoLayout is automatically divided |
394 into sections and reordered according to the Unicode | 396 into sections and reordered according to the Unicode |
395 Bidirectional Algorithm, if necessary. | 397 Bidirectional Algorithm, if necessary. |
396 */ | 398 */ |
397 PangoLayout *layout = pango_layout_new (context_); | 399 PangoLayout *layout = pango_layout_new (context_); |
| 400 |
| 401 if (!features_str.empty()) |
| 402 { |
| 403 PangoAttrList *list = pango_attr_list_new(); |
| 404 PangoAttribute *features_attr = pango_attr_font_features_new(features_str.
c_str()); |
| 405 pango_attr_list_insert(list, features_attr); |
| 406 pango_layout_set_attributes(layout, list); |
| 407 pango_attr_list_unref(list); |
| 408 } |
| 409 |
398 pango_layout_set_text (layout, str.c_str (), -1); | 410 pango_layout_set_text (layout, str.c_str (), -1); |
399 GSList *lines = pango_layout_get_lines (layout); | 411 GSList *lines = pango_layout_get_lines (layout); |
400 | 412 |
401 Stencil dest; | 413 Stencil dest; |
402 Real last_x = 0.0; | 414 Real last_x = 0.0; |
403 | 415 |
404 for (GSList *l = lines; l; l = l->next) | 416 for (GSList *l = lines; l; l = l->next) |
405 { | 417 { |
406 PangoLayoutLine *line = (PangoLayoutLine *) l->data; | 418 PangoLayoutLine *line = (PangoLayoutLine *) l->data; |
407 GSList *layout_runs = line->runs; | 419 GSList *layout_runs = line->runs; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 return s; | 492 return s; |
481 } | 493 } |
482 | 494 |
483 SCM | 495 SCM |
484 Pango_font::font_file_name () const | 496 Pango_font::font_file_name () const |
485 { | 497 { |
486 return SCM_BOOL_F; | 498 return SCM_BOOL_F; |
487 } | 499 } |
488 | 500 |
489 #endif // HAVE_PANGO_FT2 | 501 #endif // HAVE_PANGO_FT2 |
OLD | NEW |