]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/score-engraver.cc
* lily/kpath.cc:
[lilypond.git] / lily / score-engraver.cc
index 3dea667878e96f8bb71528eeaa163f03978c29d2..514f800c94677d0c5338554bf640622be32cb8de 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #include "all-font-metrics.hh"
@@ -20,6 +20,7 @@
 #include "staff-spacing.hh"
 #include "note-spacing.hh"
 #include "global-context.hh"
+#include "open-type-font.hh"
 
 /*
   TODO: the column creation logic is rather hairy. Revise it.
@@ -85,25 +86,32 @@ Score_engraver::prepare (Moment m)
 void
 Score_engraver::finish ()
 {
-  if ((breaks_%8))
+  if ((breaks_ % 8))
     progress_indication ("[" + to_string (breaks_) + "]");
 
   recurse_over_translators (context (), &Translator::finalize, UP);
 }
 
+#define MUSIC_FONT "emmentaler-20"
+
 /*
   use start/finish?
  */
 void
 Score_engraver::initialize ()
 {
-  Font_metric *fm = all_fonts_global->find_afm ("feta20");
+  Font_metric *fm = all_fonts_global->find_otf (MUSIC_FONT);
   if (!fm)
-    error (_f ("cannot find `%s'", "feta20.afm")
-          + "\n"
-          + _ ("Music font has not been installed properly.")
-          + _ ("Aborting"));
-
+    {
+      error (_f ("cannot find `%s'", MUSIC_FONT ".otf")
+            + "\n"
+            + _ ("Music font has not been installed properly.")
+            + "\n"
+            + _f ("Search path `%s'", global_path.to_string ().to_str0())
+            + "\n"
+            + _ ("Aborting"));       
+    }
+  
   if (!scm_is_string (ly_kpathsea_find_file (scm_makfrom0str ("ecrm10.pfa")))
       && (!scm_is_string (ly_kpathsea_find_file (scm_makfrom0str ("lmr10.pfb")))))
       error (_f ("cannot find `%s'", "ecrm10.pfa")
@@ -123,8 +131,8 @@ Score_engraver::initialize ()
   Object_key const *sys_key = context()->get_grob_key ("System");
   pscore_->typeset_line (new System (props, sys_key));
   
-  make_columns ();
   system_ = pscore_->system_;
+  make_columns ();
   system_->set_bound (LEFT, command_column_);
   command_column_->set_property ("breakable", SCM_BOOL_T);
 
@@ -209,9 +217,6 @@ Score_engraver::stop_translation_timestep ()
        progress_indication ("[" + to_string (breaks_) + "]");
     }
 
-
-  system_->add_column (command_column_);
-  system_->add_column (musical_column_);
   
   command_column_ = 0;
   musical_column_ = 0;
@@ -234,6 +239,9 @@ Score_engraver::set_columns (Paper_column *new_command,
     {
       context ()->set_property ("currentMusicalColumn", new_musical->self_scm ());
     }
+
+  system_->add_column (command_column_);
+  system_->add_column (musical_column_);
 }
 
 Music_output*