]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/include/main.hh: lose _b hungarian suffixes for global
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 7 Jan 2005 14:29:58 +0000 (14:29 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 7 Jan 2005 14:29:58 +0000 (14:29 +0000)
variables.

* lily/font-select.cc (get_font_by_design_size): retrieve
PangoFont for (designsize . "pango-descr") entries.

* lily/lily-parser-scheme.cc: new file.

* scm/font.scm (add-cmr-fonts): use real dimens in font selection.

30 files changed:
ChangeLog
lily/all-font-metrics.cc
lily/context-property.cc
lily/context.cc
lily/font-select.cc
lily/global-context-scheme.cc
lily/gourlay-breaking.cc
lily/grob-property.cc
lily/grob.cc
lily/includable-lexer.cc
lily/include/main.hh
lily/kpath.cc
lily/lexer.ll
lily/lily-guile.cc
lily/lily-lexer.cc
lily/lily-parser-scheme.cc
lily/main.cc
lily/music.cc
lily/pango-select.cc
lily/paper-score.cc
lily/parser.yy
lily/performance.cc
lily/scm-option.cc
lily/spacing-spanner.cc
lily/system.cc
lily/text-item.cc
ly/paper-defaults.ly
scm/font.scm
scm/lily.scm
scm/paper.scm

index b15e4d832140b1e02cce2e10291d3a25d2daef2f..87c4d1b333a401d1e2eca7a151f3c35d36afb372 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2005-01-07  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * lily/include/main.hh: lose _b hungarian suffixes for global
+       variables.
+
        * lily/include/lily-guile-macros.hh: new file.
 
        * lily/pango-select-scheme.cc (LY_DEFINE): new file.
index 5425542816d4104014d12565ee21b464dfc9260d..11c799e3970bca5dfe5ef2a49a51836b91b2fba6 100644 (file)
@@ -68,7 +68,7 @@ All_font_metrics::find_pango_font (PangoFontDescription*description)
   SCM val;
   if (!pango_dict_->try_retrieve (key, &val))
     {
-      if (verbose_global_b)
+      if (be_verbose_global)
        progress_indication ("[" + String (fn));
       Pango_font *pf = new Pango_font (pango_ft2_fontmap_,
                                       RIGHT,
@@ -77,7 +77,7 @@ All_font_metrics::find_pango_font (PangoFontDescription*description)
       pango_dict_->set (key, val);
       scm_gc_unprotect_object (val);
 
-      if (verbose_global_b)
+      if (be_verbose_global)
        progress_indication ("]");
 
       pf->description_ = scm_cons (SCM_BOOL_F,
@@ -118,7 +118,7 @@ All_font_metrics::find_afm (String name)
       if (file_name.is_empty ())
        return 0;
       
-      if (verbose_global_b)
+      if (be_verbose_global)
        progress_indication ("[" + file_name);
       val = read_afm_file (file_name);
       unsmob_metrics (val)->file_name_ = file_name;
@@ -126,7 +126,7 @@ All_font_metrics::find_afm (String name)
       unsmob_metrics (val)->description_ = scm_cons (name_string, 
                                                     scm_make_real (1.0));
 
-      if (verbose_global_b)
+      if (be_verbose_global)
        progress_indication ("]");
 
       afm_dict_->set (sname, val);
@@ -184,12 +184,12 @@ All_font_metrics::find_otf (String name)
       if (file_name.is_empty ())
        return 0;
 
-      if (verbose_global_b)
+      if (be_verbose_global)
        progress_indication ("[" + file_name);
       
       val = Open_type_font::make_otf (file_name);
 
-      if (verbose_global_b)
+      if (be_verbose_global)
        progress_indication ("]");
 
       unsmob_metrics (val)->file_name_ = file_name;
@@ -226,12 +226,12 @@ All_font_metrics::find_tfm (String name)
       if (file_name.is_empty ())
        return 0;
 
-      if (verbose_global_b)
+      if (be_verbose_global)
        progress_indication ("[" + file_name);
       
       val = Tex_font_metric::make_tfm (file_name);
 
-      if (verbose_global_b)
+      if (be_verbose_global)
        progress_indication ("]");
 
       unsmob_metrics (val)->file_name_ = file_name;
index 496b9b120b3e35d42c614878066aae77a6527575..b5bff1664c1184b0a37918122cc924ba4a1468d6 100644 (file)
@@ -112,7 +112,7 @@ execute_pushpop_property (Context * trg,
   else
     {
       warning ("Need symbol arguments for \\override and \\revert");
-      if (internal_type_checking_global_b)
+      if (do_internal_type_checking_global)
        assert (false);
     }
 }
index 4cad8ea641f59e266a9f0db88297490e87afb1c3..56cad82dc5106dad111de3acdf1ee63435ab3c63 100644 (file)
@@ -379,7 +379,7 @@ void
 Context::internal_set_property (SCM sym, SCM val)
 {
 #ifndef NDEBUG
-  if (internal_type_checking_global_b)
+  if (do_internal_type_checking_global)
     assert (type_check_assignment (sym, val, ly_symbol2scm ("translation-type?")));
 #endif
   
index 5f8ca95b2f6ed7739dafa72e7919e3e3eda2042d..9e55cd2c503bc7c648625a9875866481508c0040 100644 (file)
@@ -14,6 +14,7 @@
 #include "font-interface.hh"
 #include "warn.hh"
 #include "pango-font.hh"
+#include "main.hh"
 
 
 bool
@@ -117,7 +118,8 @@ select_encoded_font (Output_def *layout, SCM chain)
   else
     name = scm_cdr (name);
 
-  if (scm_is_string (name))
+  if (scm_is_string (name)
+      && is_pango_format_global)
     {
       SCM mag = ly_chain_assoc (ly_symbol2scm ("font-magnification"), chain);
       Real rmag = (scm_is_pair (mag)
index c0f919f2e732ec1ebe521c901d1998f7abd92bbd..375af3645ec893cb09abdad06ceb1b8c1071680b 100644 (file)
@@ -87,7 +87,7 @@ LY_DEFINE (ly_run_translator, "ly:run-translator",
   scm_remember_upto_here_1 (protected_iter);
   trans->finish ();
 
-  if (verbose_global_b)
+  if (be_verbose_global)
     progress_indication (_f ("elapsed time: %.2f seconds",  timer.read ()));
   
   return scm_gc_unprotect_object (trans->self_scm ());
index 6632d06bfe7d6195feb0908cb77661cbce4a28b6..713ffa823c22fa3050e09129d0936fdfaf372324 100644 (file)
@@ -195,7 +195,7 @@ Gourlay_breaking::do_solve () const
       i = prev;
     }
 
-  if (verbose_global_b)
+  if (be_verbose_global)
     {
       progress_indication (_f ("Optimal demerits: %f",
                               optimal_paths.top ().demerits_) + "\n");
index ddba069a2e4f60d46e150fb0e3140bff7765686c..bfe2eb5aa4c16c4cd4e7bf0856c895a45e96b7a1 100644 (file)
@@ -71,7 +71,7 @@ Grob::internal_set_property (SCM s, SCM v)
   if (!is_live ())
     return;
 
-  if (internal_type_checking_global_b)
+  if (do_internal_type_checking_global)
     {
       if (!type_check_assignment (s, v, ly_symbol2scm ("backend-type?")))
        abort ();
@@ -91,7 +91,7 @@ Grob::internal_get_property (SCM sym) const
 
   s = scm_sloppy_assq (sym, immutable_property_alist_);
   
-  if (internal_type_checking_global_b && scm_is_pair (s))
+  if (do_internal_type_checking_global && scm_is_pair (s))
     {
       if (!type_check_assignment (sym, scm_cdr (s),
                                  ly_symbol2scm ("backend-type?")))
index 888e6836db9511097a1ae04989189b582b03486c..de24181a4363356a9fe8dd25e67a58ef7e0d3363 100644 (file)
@@ -69,10 +69,10 @@ Grob::Grob (SCM basicprops,
       SCM ifs = scm_assoc (ly_symbol2scm ("interfaces"), meta);
 
       /* Switch off interface checks for the moment.  */
-      bool itc = internal_type_checking_global_b;
-      internal_type_checking_global_b = false;
+      bool itc = do_internal_type_checking_global;
+      do_internal_type_checking_global = false;
       internal_set_property (ly_symbol2scm ("interfaces"), scm_cdr (ifs));
-      internal_type_checking_global_b = itc;
+      do_internal_type_checking_global = itc;
     }
 
   /* TODO:
index d58b31ced3b1c5b5723947acae1cda43d3445537..a87da4a2ed73b13c8e8a555a01f8c9e44c7fff7f 100644 (file)
@@ -68,7 +68,7 @@ Includable_lexer::new_input (String name, Sources *sources)
   if (yy_current_buffer)
     state_stack_.push (yy_current_buffer);
 
-  if (verbose_global_b)
+  if (be_verbose_global)
     progress_indication (String ("[") + name);
        
   include_stack_.push (file);
@@ -91,7 +91,7 @@ Includable_lexer::new_input (String name, String data, Sources *sources)
   if (yy_current_buffer)
     state_stack_.push (yy_current_buffer);
 
-  if (verbose_global_b)
+  if (be_verbose_global)
     progress_indication (String ("[") + name);
   include_stack_.push (file);
 
@@ -106,7 +106,7 @@ Includable_lexer::close_input ()
 {
   include_stack_.pop ();
   char_count_stack_.pop ();
-  if (verbose_global_b)
+  if (be_verbose_global)
     progress_indication ("]");
   yy_delete_buffer (yy_current_buffer);
 #if HAVE_FLEXLEXER_YY_CURRENT_BUFFER  
index 23fad330302c0fce3ba12b752e5bf45c981d4b05..e5553eb40fe97efabc9a87e1582a8fb3e5bcd05d 100644 (file)
@@ -27,13 +27,14 @@ extern String init_name_global;
 
 /* options */
 extern Array<String> dump_header_fieldnames_global;
-extern bool no_layout_global_b;
+extern bool skip_layout_global;
 extern String output_backend_global;
 extern String output_name_global;
-extern bool safe_global_b;
-extern bool verbose_global_b;
-extern bool store_locations_global_b;
-extern bool internal_type_checking_global_b;
+extern bool be_safe_global;
+extern bool be_verbose_global;
+extern bool store_locations_global;
+extern bool do_internal_type_checking_global;
+extern bool is_pango_format_global;
 
 /*
   todo: collect in Output_option struct? 
index 2757cf3508ca691450a62a60136021e3702e460e..ca73ae052f995b1ae977e0790d032fc374a4988c 100644 (file)
@@ -128,7 +128,7 @@ kpathsea_gulp_file_to_string (String name)
   if (file_name.is_empty ())
     error (_f ("can't find file: `%s'", name));
 
-  if (verbose_global_b)
+  if (be_verbose_global)
     progress_indication ("[" + file_name);
 
   int filesize;
@@ -136,7 +136,7 @@ kpathsea_gulp_file_to_string (String name)
   String string (str);
   delete[] str;
   
-  if (verbose_global_b)
+  if (be_verbose_global)
     progress_indication ("]");
 
   return string;
index b4049350e15da715d5b6031ff4b4b258c78e33d8..0a209abf20761e78d73683c511a51f205f14e6f0 100644 (file)
@@ -276,7 +276,7 @@ HYPHEN              --
        char const* s = here_str0 ();
        int n = 0;
        SCM sval = ly_parse_scm (s, &n, here_input (),
-               safe_global_b && main_input_b_);
+               be_safe_global && main_input_b_);
 
        if (sval == SCM_UNDEFINED)
        {
index b39b56600731a801c82c62004fe20f509a035752..3b21744973b60f5943d6b0794cecb69b451cb834 100644 (file)
@@ -96,7 +96,7 @@ gulp_file_to_string (String fn, bool must_exist)
       return s;
     }
 
-  if (verbose_global_b)
+  if (be_verbose_global)
     progress_indication ("[" + s);
 
   int n;
@@ -104,7 +104,7 @@ gulp_file_to_string (String fn, bool must_exist)
   String result ((Byte*) str, n);
   delete[] str;
   
-  if (verbose_global_b)
+  if (be_verbose_global)
     progress_indication ("]");
 
   return result;
@@ -191,7 +191,7 @@ ly_init_ly_module (void *)
   for (int i = scm_init_funcs_->size () ; i--;)
     (scm_init_funcs_->elem (i)) ();
 
-  if (verbose_global_b)
+  if (be_verbose_global)
     progress_indication ("\n");
   
   scm_primitive_load_path (scm_makfrom0str ("lily.scm"));
@@ -481,7 +481,7 @@ type_check_assignment (SCM sym, SCM val,  SCM type_symbol)
                 + "  " + _ ("Perhaps you made a typing error?"));
 
        /* Be strict when being anal :) */
-       if (internal_type_checking_global_b)
+       if (do_internal_type_checking_global)
          abort ();
        
        warning (_ ("Doing assignment anyway."));
index 446600c805175e6635f575d4ad3ba8fb4c31055d..4fdfcd508823adb05ada55ad8275d6343af2e942 100644 (file)
@@ -191,7 +191,7 @@ Lily_lexer::start_main_input ()
   new_input (main_input_name_, sources_);
   
   /* Do not allow \include in --safe-mode */
-  allow_includes_b_ = allow_includes_b_ && !safe_global_b;
+  allow_includes_b_ = allow_includes_b_ && !be_safe_global;
 
   scm_module_define (scm_car (scopes_),
                     ly_symbol2scm ("input-file-name"),
index 1195294023207db50a8e2fd66de5b94ef9b1761f..cc328a122562ebdb7038fa9c55975c9d7018c514 100644 (file)
@@ -24,7 +24,7 @@
 /*
   junkme?
  */
-bool store_locations_global_b;
+bool store_locations_global;
 
 /* Do not append `!' suffix, since 1st argument is not modified. */
 LY_DEFINE (ly_set_point_and_click, "ly:set-point-and-click",
@@ -42,7 +42,7 @@ LY_DEFINE (ly_set_point_and_click, "ly:set-point-and-click",
 
   scm_module_define (global_lily_module, ly_symbol2scm ("point-and-click"),
                     val);
-  store_locations_global_b = ly_c_procedure_p (val);
+  store_locations_global = ly_c_procedure_p (val);
   return SCM_UNSPECIFIED;
 }
 
index c8f0b12d64d27ccc434f6b4c46ba360baa6f574d..225779a68b8079961b03e59df80d8de05b03f5cb 100644 (file)
@@ -41,22 +41,23 @@ Array<String> dump_header_fieldnames_global;
 String init_name_global;
 
 /* Do not calculate and write layout output? */
-bool no_layout_global_b = false;
+bool skip_layout_global = false;
 
 /* Selected output format.
    One of tex, ps, scm, as.
 */
 String output_backend_global = "ps";
 String output_format_global = "pdf";
+bool is_pango_format_global;
 
 /* Current output name. */
 String output_name_global;
 
 /* Run in safe mode? */
-bool safe_global_b = false;
+bool be_safe_global = false;
 
 /* Verbose progress indication? */
-bool verbose_global_b = false;
+bool be_verbose_global = false;
 
 /* Scheme code to execute before parsing, after .scm init
    This is where -e arguments are appended to.
@@ -263,7 +264,7 @@ main_with_guile (void *, int, char **)
       prepend_load_path (String (prefix_directory[i]) + "/scm");
     }
 
-  if (verbose_global_b)
+  if (be_verbose_global)
     dir_info (stderr);
 
   ly_c_init_guile ();
@@ -377,6 +378,8 @@ parse_argv (int argc, char **argv)
          break;
        case 'b':
          output_backend_global = option_parser->optional_argument_str0_;
+         is_pango_format_global = (output_backend_global != "tex"
+                                   &&output_backend_global != "texstr");
          break;
 
        case 'f':
@@ -397,13 +400,13 @@ parse_argv (int argc, char **argv)
          help_b = true;
          break;
        case 'V':
-         verbose_global_b = true;
+         be_verbose_global = true;
          break;
        case 's':
-         safe_global_b = true;
+         be_safe_global = true;
          break;
        case 'm':
-         no_layout_global_b = true;
+         skip_layout_global = true;
          break;
        case 'p':
          make_preview = true;
@@ -420,7 +423,7 @@ parse_argv (int argc, char **argv)
     {
       identify (stdout);
       usage ();
-      if (verbose_global_b)
+      if (be_verbose_global)
        dir_info (stdout);
       exit (0);
     }
index 5889b8e46e305e53868a39a60a61036ddb9a7fd3..5183763f8ded12f58ec7a3bc73d6360763cfcff2 100644 (file)
@@ -214,7 +214,7 @@ Music::internal_get_property (SCM sym) const
 void
 Music::internal_set_property (SCM s, SCM v)
 {
-  if (internal_type_checking_global_b)
+  if (do_internal_type_checking_global)
     if (!type_check_assignment (s, v, ly_symbol2scm ("music-type?")))
       abort ();
 
index 3fa18f2de97a7bd25e815b20d37811085af9f2f4..10a7b182cb3b7e684a8f6a4629f890aacacad0c6 100644 (file)
@@ -43,8 +43,7 @@ properties_to_pango_description (SCM chain, Real text_size)
     }
 
   Real step = robust_scm2double (ly_symbol2scm ("font-size"), 0.0);
-  Real size = text_size
-    * pow (2.0, step / 6.0) * point_constant;
+  Real size = text_size * pow (2.0, step / 6.0);
   
   pango_font_description_set_size (description,
                                   gint (size * PANGO_SCALE));
@@ -55,8 +54,8 @@ Font_metric *
 select_pango_font (Output_def *layout, SCM chain)
 {
   PangoFontDescription *pfd =properties_to_pango_description (chain,
-                                  layout->get_dimension (ly_symbol2scm ("text-font-size")));
-
+                                                             point_constant * layout->get_dimension (ly_symbol2scm ("text-font-size")));
+  
   Font_metric * fm = all_fonts_global->find_pango_font (pfd);
 
   return find_scaled_font (layout, fm, 1.0);
@@ -152,9 +151,12 @@ symbols_to_pango_font_description(SCM family,
 {
   PangoFontDescription * description = pango_font_description_new ();
 
-  String family_str = scm_is_symbol (family)
-    ? ly_symbol2string (family)
-    : String("roman");
+  String family_str = "roman";
+  if (scm_is_symbol (family))
+    family_str = ly_symbol2string (family);
+  else if (scm_is_string (family))
+    family_str = ly_scm2string (family);
+
   pango_font_description_set_family (description,
                                     family_str.to_str0 ());
   pango_font_description_set_style (description,
index 366dba50cce47cac07770ff34f02356f435d2f76..cab9e144453832a3ffd95b874f2e23f442cc99e9 100644 (file)
@@ -62,7 +62,7 @@ Paper_score::calc_breaking ()
 SCM
 Paper_score::process (String)
 {
-  if (verbose_global_b)
+  if (be_verbose_global)
     progress_indication (_f ("Element count %d (spanners %d) ",
                             system_->element_count (),
                             system_->spanner_count ()));
index 10f2108283a5acd2ae9d897baa033ffea80a0407..82ff06d3b8f75059a46b8a8d8d624b8701beaba4 100644 (file)
@@ -530,7 +530,7 @@ embedded_scm:
 
 lilypond_header_body:
        {
-               $$ = ly_make_anonymous_module (safe_global_b);
+               $$ = ly_make_anonymous_module (be_safe_global);
                THIS->lexer_->add_scope ($$);
        }
        | lilypond_header_body assignment  {
@@ -2716,15 +2716,15 @@ property_op_to_music (SCM op)
 
        if (grob_sym != SCM_UNDEFINED)
                {
-               bool itc = internal_type_checking_global_b;
+               bool itc = do_internal_type_checking_global;
                /* UGH.
                */
                bool autobeam = ly_c_equal_p (symbol, ly_symbol2scm ("autoBeamSettings"));
                if (autobeam)
-                       internal_type_checking_global_b = false;
+                       do_internal_type_checking_global = false;
                m->set_property ("grob-property", grob_sym);
                if (autobeam)
-                       internal_type_checking_global_b = itc;
+                       do_internal_type_checking_global = itc;
                }
 
        if (tag == ly_symbol2scm ("poppush"))
index 0fde4b3e52f4dbca5ccde9e44e721d5ca3a960c1..c8052dc0b787afc9c82f04a112e407b26a12ff8b 100644 (file)
@@ -51,7 +51,7 @@ Performance::output (Midi_stream& midi_stream)
   for (int i = 0; i < audio_staffs_.size (); i++)
     {
       Audio_staff *s = audio_staffs_[i];
-      if (verbose_global_b)
+      if (be_verbose_global)
        progress_indication ("[" + to_string (i)) ;
 
       /*
@@ -74,7 +74,7 @@ Performance::output (Midi_stream& midi_stream)
        }
       
       s->output (midi_stream, channel++);
-      if (verbose_global_b)
+      if (be_verbose_global)
        progress_indication ("]");
     }
 }
index dac63fde4404009a0c34012d9577a913043eecd8..a316b886e64b482432f580787fdf8fee181aa024 100644 (file)
@@ -47,7 +47,7 @@ bool lily_1_8_compatibility_used = false;
 /*
   crash if internally the wrong type is used for a grob property.
  */
-bool internal_type_checking_global_b;
+bool do_internal_type_checking_global;
 
 
 /*
@@ -118,7 +118,7 @@ LY_DEFINE (ly_set_option, "ly:set-option", 1, 1, 0, (SCM var, SCM val),
   else if (var == ly_symbol2scm ("parse-protect" ))
     parse_protect_global = to_boolean (val);
   else if (var == ly_symbol2scm ("internal-type-checking"))
-    internal_type_checking_global_b = to_boolean (val);
+    do_internal_type_checking_global = to_boolean (val);
   else if (var == ly_symbol2scm ("old-relative"))
     {
       lily_1_8_relative = true;
@@ -156,13 +156,13 @@ LY_DEFINE (ly_get_option, "ly:get-option", 1, 0, 0, (SCM var),
   SCM o = SCM_UNSPECIFIED;
   
   if (var == ly_symbol2scm ("safe")) // heavily used; put in front. 
-    o = ly_bool2scm (safe_global_b);
+    o = ly_bool2scm (be_safe_global);
   else  if (var == ly_symbol2scm ("old-relative-used"))
     o = ly_bool2scm (lily_1_8_compatibility_used);
   else if (var == ly_symbol2scm ("old-relative"))
     o = ly_bool2scm (lily_1_8_relative);
   else if (var == ly_symbol2scm ("verbose"))
-    o = ly_bool2scm (verbose_global_b);
+    o = ly_bool2scm (be_verbose_global);
   else if ( var == ly_symbol2scm ("resolution"))
     o = scm_from_int (preview_resolution_global);
   else
index 505a87ede29c27966714d455a8297a31321088ea..52bcd81032f4e0af643aa5ae77364e8f0e2f870b 100644 (file)
@@ -382,7 +382,7 @@ Spacing_spanner::set_springs (SCM smob)
   else
     {
       global_shortest = find_shortest (me, all);
-      if (verbose_global_b)
+      if (be_verbose_global)
        progress_indication (_f ("Global shortest duration is %s", global_shortest.to_string ()) + "\n");
     }
   prune_loose_columns (me, &all, global_shortest);
index d2b33e8369480863ce0ad39d9aa53d7f17a6c756..6203abff7023eb0a8d0f245ec56c765ec42f0d59 100644 (file)
@@ -145,7 +145,7 @@ System::get_lines ()
     }
 #endif
   
-  if (verbose_global_b)
+  if (be_verbose_global)
     progress_indication (_f ("Element count %d.",  count + element_count ()));
 
   int line_count = broken_intos_.size ();
@@ -153,14 +153,14 @@ System::get_lines ()
   
   for (int i = 0; i < line_count; i++)
     {
-      if (verbose_global_b)
+      if (be_verbose_global)
        progress_indication ("[");
 
       System *system = dynamic_cast<System*> (broken_intos_[i]);
       system->post_processing ();
       scm_vector_set_x (lines, scm_int2num (i), system->get_line ());
 
-      if (verbose_global_b)
+      if (be_verbose_global)
        progress_indication (to_string (i) + "]");
     }
   return lines;
@@ -298,7 +298,7 @@ System::pre_processing ()
   for (SCM s = get_property ("all-elements"); scm_is_pair (s); s = scm_cdr (s))
     unsmob_grob (scm_car (s))->discretionary_processing ();
 
-  if (verbose_global_b)
+  if (be_verbose_global)
     progress_indication (_f ("Grob count %d", element_count ()));
   
   for (SCM s = get_property ("all-elements"); scm_is_pair (s); s = scm_cdr (s))
index 78aecd437f7c4de14a8eec1a80223320f2ad3fe4..3bcab30fc9f79aa068c3f44b3f80399c4f476d58 100644 (file)
@@ -36,15 +36,6 @@ Text_interface::interpret_string (SCM layout_smob,
 
   String str = ly_scm2string (markup);
 
-#if HAVE_PANGO_FT2
-  if (output_backend_global != "tex"
-      && output_backend_global != "texstr")
-    {
-      Font_metric *fm = select_pango_font (layout, props);
-      return fm->text_stencil (str).smobbed_copy ();
-    }
-#endif
-  
   Font_metric *fm = select_encoded_font (layout, props);
   return fm->text_stencil (str).smobbed_copy();
 }
index 95d6b039fdc866b4facea2915c222b13b7e9639b..e64ef6c8aad7309fc042e0857920b55a4ab51a87 100644 (file)
     %% use lmodern in latin1 (cork) flavour if EC is not available.
     #(define text-font-defaults
       `((font-encoding .
-;        cork-lm
-       Extended-TeX-Font-Encoding---Latin
-;        ,(if (and (not (ly:kpathsea-find-file "ecrm10.pfa"))
-;              (ly:kpathsea-find-file "cork-lm.enc")) 'cork-lm 'Extended-TeX-Font-Encoding---Latin)
-       )
+        ,(cond
+          (tex-backend? 'Extended-TeX-Font-Encoding---Latin)
+          (else 'latin1)))
+       ;; add to taste here.
+       
        (baseline-skip . 2)
        (word-space . 0.6)))
 
index 64a3e37f8f7647bf8b31149026817589ce3bf4fa..b6a533dba6c279570e2e40618d17f1f96d91331b 100644 (file)
                  ,(delay (ly:font-load "ectt10"))
                  ,(delay (ly:font-load "ectt12"))))))))
 
-;; (display (make-font-tree 1.0))
-
-;; Century Schoolbook fonts file names on Debian/Sid
-(define-public (add-century-schoolbook-fonts node factor)
-  (add-font node
-           '((font-family . roman)
-             (font-shape . upright)
-             (font-series . medium)
-             (font-encoding . latin1))
-           `(,(ly:pt 10.0) . #(,(delay (ly:font-load "uncr8a")))))
-  (add-font node
-           '((font-family . roman)
-             (font-shape . italic)
-             (font-series . medium)
-             (font-encoding . latin1))
-           `(,(ly:pt 10.0) . #(,(delay (ly:font-load "uncri8a")))))
-  (add-font node
-           '((font-family . roman)
-             (font-shape . upright)
-             (font-series . bold)
-             (font-encoding . latin1))
-           `(,(ly:pt 10.0) . #(,(delay (ly:font-load "uncb8a")))))
-  (add-font node
-           '((font-family . roman)
-             (font-shape . italic)
-             (font-series . bold)
-             (font-encoding . latin1))
-           `(,(ly:pt 10.0) . #(,(delay (ly:font-load "uncbi8a"))))))
+(define-public (add-pango-fonts node family factor)
+  (define (add-node shape series)
+    (add-font node
+             `((font-family . ,family)
+               (font-shape . ,shape)
+               (font-series . ,series)
+               (font-encoding . latin1) ;; ugh.
+               )
+             
+             `(,(ly:pt (* factor 12.0))
+               . #(,(cons
+                    (ly:pt 12)
+                    (ly:make-pango-description-string
+                      `(((font-family . ,family)
+                         (font-series . ,series)
+                         (font-shape . ,shape)))
+                      (ly:pt 12)))))))
+
+  (add-node 'upright 'medium) 
+  (add-node 'upright 'bold) 
+  (add-node 'italic 'bold) 
+  (add-node 'italic 'medium))
 
 (define-public (make-cmr-tree factor)
   (let ((n (make-font-tree-node 'font-encoding 'fetaMusic)))
 (define-public (make-century-schoolbook-tree factor)
   (let ((n (make-font-tree-node 'font-encoding 'fetaMusic)))
     (add-music-fonts n factor)
-    (add-century-schoolbook-fonts n factor)
+    (add-pango-fonts n "Century Schoolbook L" factor)
     n))
 
 (define-public (magstep x)
index f763340f34b0668921e7504d195adda04f95e176..5b431730e1adb8c66ed9af882663254f6ed51718 100644 (file)
@@ -46,6 +46,9 @@
 
 (define-public point-and-click #f)
 
+(define-public tex-backend?
+  (memq (ly:output-backend) '("texstr" "tex")))
+
 (define-public parser #f)
 
 (define-public (lilypond-version)
index 3f997b08852d55b59500fd8aac83e8a3385ce3c6..cdcebe690807b9009ee29387c7a5e16bcd25d112 100644 (file)
     (module-define! m 'text-font-size (* 12 (/ sz (* 20 pt))))
     
     (module-define! m 'outputscale ss)
-    (module-define! m 'fonts (make-cmr-tree (/  sz (* 20 pt))))
+    (module-define! m 'fonts
+                   (if tex-backend?
+                       (make-cmr-tree (/  sz (* 20 pt)))
+                       (make-century-schoolbook-tree
+                        (/  sz (* 20 pt)))))
     (module-define! m 'staffheight sz)
     (module-define! m 'staff-space ss)
     (module-define! m 'staffspace ss)