From b7b68363b15a8f723b55338b613de077ce5e1bdd Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Tue, 4 Jan 2005 22:21:40 +0000 Subject: [PATCH] * lily/include/main.hh: rename format to backend. * scm/translation-functions.scm (format-mark-box-numbers): add. patch by Erlend Aasland --- ChangeLog | 7 +++++++ THANKS | 1 + lily/include/main.hh | 2 +- lily/include/pango-font.hh | 2 +- lily/lily-parser.cc | 2 +- lily/main.cc | 10 +++++----- lily/modified-font-metric.cc | 2 +- lily/pango-font.cc | 15 +++++---------- lily/paper-book.cc | 4 ++-- lily/text-item.cc | 4 ++-- scm/translation-functions.scm | 5 +++++ 11 files changed, 31 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index 046552ddd8..7766add75a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-01-04 Han-Wen Nienhuys + + * lily/include/main.hh: rename format to backend. + + * scm/translation-functions.scm (format-mark-box-numbers): add. + patch by Erlend Aasland + 2005-01-03 Han-Wen Nienhuys * lily/pango-font.cc (text_stencil): dump string as (utf-8-string diff --git a/THANKS b/THANKS index b2b930fa54..c0d3c6986e 100644 --- a/THANKS +++ b/THANKS @@ -25,6 +25,7 @@ Jonathan Walther BUG HUNTERS/SUGGESTIONS +Erlend Aasland Johannes Schindelin Andreas Scherer Arjan Bos diff --git a/lily/include/main.hh b/lily/include/main.hh index 02d8e1fa39..3ff399afc5 100644 --- a/lily/include/main.hh +++ b/lily/include/main.hh @@ -28,7 +28,7 @@ extern String init_name_global; /* options */ extern Array dump_header_fieldnames_global; extern bool no_layout_global_b; -extern String output_format_global; +extern String output_backend_global; extern String output_name_global; extern bool safe_global_b; extern bool verbose_global_b; diff --git a/lily/include/pango-font.hh b/lily/include/pango-font.hh index 77139c08b8..750515b648 100644 --- a/lily/include/pango-font.hh +++ b/lily/include/pango-font.hh @@ -22,7 +22,7 @@ class Pango_font : public Font_metric { PangoContext *context_; - PangoFontDescription *description_; + PangoFontDescription *pango_description_; PangoAttrList *attribute_list_; Real scale_; SCM subfonts_; diff --git a/lily/lily-parser.cc b/lily/lily-parser.cc index feb9943a7c..456702e079 100644 --- a/lily/lily-parser.cc +++ b/lily/lily-parser.cc @@ -86,7 +86,7 @@ Lily_parser::print_smob (SCM s, SCM port, scm_print_state*) void Lily_parser::parse_file (String init, String name, String out_name) { - if (output_format_global == "tex") + if (output_backend_global == "tex") { try_load_text_metrics (out_name); } diff --git a/lily/main.cc b/lily/main.cc index c75826be29..85de1661a9 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -46,7 +46,7 @@ bool no_layout_global_b = false; /* Selected output format. One of tex, ps, scm, as. */ -String output_format_global = "ps"; +String output_backend_global = "ps"; /* Current output name. */ String output_name_global; @@ -254,9 +254,9 @@ prepend_load_path (String dir) static void determine_output_options () { - bool found_gnome = (output_format_global == "gnome"); - bool found_svg = (output_format_global == "svg"); - bool found_tex = (output_format_global == "tex"); + bool found_gnome = (output_backend_global == "gnome"); + bool found_svg = (output_backend_global == "svg"); + bool found_tex = (output_backend_global == "tex"); if (make_pdf || make_png) @@ -416,7 +416,7 @@ parse_argv (int argc, char **argv) printf (_ ("Read the sources for more information.").to_str0 ()); exit (0); } - output_format_global = option_parser->optional_argument_str0_; + output_backend_global = option_parser->optional_argument_str0_; break; case 'H': dump_header_fieldnames_global diff --git a/lily/modified-font-metric.cc b/lily/modified-font-metric.cc index 67f30b3f4f..fce72a1aba 100644 --- a/lily/modified-font-metric.cc +++ b/lily/modified-font-metric.cc @@ -187,7 +187,7 @@ Modified_font_metric::text_dimension (String text) const return b; } - if (output_format_global == "tex") + if (output_backend_global == "tex") { b = tex_kludge (text); return b; diff --git a/lily/pango-font.cc b/lily/pango-font.cc index fbdf13ba05..dbd41e443b 100644 --- a/lily/pango-font.cc +++ b/lily/pango-font.cc @@ -12,6 +12,7 @@ #include +#include "main.hh" #include "lookup.hh" #include "dimensions.hh" #include "pango-font.hh" @@ -31,7 +32,7 @@ Pango_font::Pango_font (PangoFT2FontMap *fontmap, context_ = pango_ft2_get_context (PANGO_RESOLUTION, PANGO_RESOLUTION); - description_ = pango_font_description_copy (description); + pango_description_ = pango_font_description_copy (description); // context_ = pango_ft2_font_map_create_context (fontmap); attribute_list_= pango_attr_list_new(); @@ -49,7 +50,7 @@ Pango_font::Pango_font (PangoFT2FontMap *fontmap, Pango_font::~Pango_font () { - pango_font_description_free (description_); + pango_font_description_free (pango_description_); g_object_unref (context_); pango_attr_list_unref (attribute_list_); } @@ -133,12 +134,6 @@ Pango_font::pango_item_string_stencil (PangoItem *item, String str, Real dx) con return item_stencil; } -Stencil -Pango_font::direct_pango_text_stencil (String str) const -{ - - -} Stencil Pango_font::text_stencil (String str) const @@ -164,14 +159,14 @@ Pango_font::text_stencil (String str) const ptr = ptr->next; } - if (output_format_global != "ps") + if (output_backend_global != "ps") { /* For Pango based backends, we take a shortcut. */ SCM exp = scm_list_3 (ly_symbol2scm ("utf-8-string"), - scm_makfrom0str (pango_font_description_to_filename (description_)), + scm_makfrom0str (pango_font_description_to_filename (pango_description_)), scm_makfrom0str (str.to_str0 ())); diff --git a/lily/paper-book.cc b/lily/paper-book.cc index 8ce6188fa5..353d28572c 100644 --- a/lily/paper-book.cc +++ b/lily/paper-book.cc @@ -139,7 +139,7 @@ Paper_book::output (String outname) /* Generate all stencils to trigger font loads. */ pages (); - String format = output_format_global; + String format = output_backend_global; String file_name = outname; if (file_name != "-") @@ -207,7 +207,7 @@ Paper_book::classic_output (String outname) scopes = scm_cons (score_systems_[0].header_, scopes); //end ugh - String format = output_format_global; + String format = output_backend_global; String mod_nm = "scm framework-" + format; SCM mod = scm_c_resolve_module (mod_nm.to_str0 ()); diff --git a/lily/text-item.cc b/lily/text-item.cc index 9e32dba959..066789fad8 100644 --- a/lily/text-item.cc +++ b/lily/text-item.cc @@ -38,8 +38,8 @@ Text_interface::interpret_string (SCM layout_smob, String str = ly_scm2string (markup); #if HAVE_PANGO_FT2 - if (output_format_global != "tex" - && output_format_global != "texstr") + if (output_backend_global != "tex" + && output_backend_global != "texstr") { Font_metric *fm = select_pango_font (layout, props); return fm->text_stencil (str).smobbed_copy (); diff --git a/scm/translation-functions.scm b/scm/translation-functions.scm index a4228e8fd9..8d8a5fcbf2 100644 --- a/scm/translation-functions.scm +++ b/scm/translation-functions.scm @@ -34,3 +34,8 @@ (define-public (format-mark-numbers mark context) (make-bold-markup (number->string mark))) +(define-public (format-mark-box-letters mark context) + (make-bold-markup (make-box-markup (make-markletter-markup (1- mark))))) + +(define-public (format-mark-box-numbers mark context) + (make-bold-markup (make-box-markup (make-markletter-markup (1- mark))))) -- 2.39.2