]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.3.102
authorfred <fred>
Wed, 27 Mar 2002 00:01:59 +0000 (00:01 +0000)
committerfred <fred>
Wed, 27 Mar 2002 00:01:59 +0000 (00:01 +0000)
CHANGES
lily/font-interface.cc
lily/include/font-interface.hh
lily/include/text-item.hh
lily/local-key-engraver.cc
lily/multi-measure-rest.cc
lily/text-item.cc
lily/volta-engraver.cc
ly/generate-documentation.ly

diff --git a/CHANGES b/CHANGES
index 0c45c08fa7f2beeab5046bd5de615fdda2934d3f..cf3d221a5c795a1f4b76ba9bd9a77e610ed57d00 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,26 @@
+1.3.101.jcn2
+============
+
+* Fixed bracket, and made some other PostScript code fixes.
+
+* Silly font initialisation fix for paper19 non-feature.
+
+1.3.101.uu1
+===========
+
+* Automatic engraver/property documentation infrastructure. 
+
+* Fixed system-start braces
+
+* Fix for forgetAccidentals: do print accidentals, just don't remember
+them.
+
+* Bugfix: forced script directions for scripts that have relative stem-direction.
+
+* Bugfix: Tie_column doesn't force Tie directions ties that already
+have a direction.
+
+* Bugfix: multimeasure rest 
 
 1.3.101
 =======
index 01d9c5e1b7bf92fbd25e1fc5b1aade58fd19d6e4..dc6bd81d57117680f793c74021d18815d90095b1 100644 (file)
@@ -38,19 +38,42 @@ Font_interface::get_default_font (Score_element*me)
   if (fm)
     return fm;
 
+  fm = get_font (me,  font_alist_chain (me));
+  me->set_elt_property ("font", fm->self_scm ());
+  return fm;
+}
+
+Font_metric *
+Font_interface::get_font (Score_element *me, SCM chain)
+{
+  
   SCM ss = me->paper_l ()->style_sheet_;
 
   SCM proc = gh_cdr (scm_assoc (ly_symbol2scm ("properties-to-font"),
                                ss));
 
   SCM fonts = gh_cdr (scm_assoc (ly_symbol2scm ("fonts"), ss));
-  SCM defaults = gh_cdr (scm_assoc (ly_symbol2scm ("font-defaults"),
-                                   ss));
 
   assert (gh_procedure_p (proc));
-  SCM font_name = gh_call2 (proc, fonts, font_alist_chain (me));
+  SCM font_name = gh_call2 (proc, fonts, chain);
+
+  Font_metric *fm = me->paper_l ()->find_font (font_name, 1.0);
 
-  fm = me->paper_l ()->find_font (font_name, 1.0);
-  me->set_elt_property ("font", fm->self_scm ());
   return fm;
 }
+
+SCM
+Font_interface::add_style (Score_element* me, SCM style, SCM chain)
+{
+  assert (gh_symbol_p (style));
+  
+  SCM sheet = me->paper_l ()->style_sheet_;
+      
+  SCM style_alist = gh_cdr (scm_assoc (ly_symbol2scm ("style-alist"), sheet));
+  SCM entry = scm_assoc (style, style_alist);
+  if (gh_pair_p (entry))
+    {
+      chain = gh_cons (gh_cdr (entry), chain);
+    }
+  return chain;
+}
index 34f72a6a6ba25bc17f2e8025397cf0bbe1a85df4..935d866743f7d6e454d66008e03e1f2d92015685 100644 (file)
@@ -16,7 +16,9 @@
 struct Font_interface
 {
   static SCM font_alist_chain (Score_element*);
-  static Font_metric * get_default_font (Score_element*); 
+  static Font_metric * get_font (Score_element*, SCM alist_chain);
+  static Font_metric * get_default_font (Score_element*);
+  static SCM add_style (Score_element*, SCM style, SCM alist_chain);
 };
 
 #endif /* FONT_INTERFACE_HH */
index 507627b5a2b0e3558b6d1fcc1be02e76fcd74daf..8a021e004b27e2e0dc35105c3f8d9904f862094b 100644 (file)
@@ -10,6 +10,8 @@
 #ifndef TEXT_ITEM
 #define TEXT_ITEM
 
+
+#include "lily-proto.hh"
 #include "lily-guile.hh"
 #include "molecule.hh"
 
@@ -20,8 +22,10 @@ public:
   static Molecule text2molecule (Score_element *me, SCM text, SCM properties);
   static Molecule string2molecule (Score_element *me, SCM text, SCM properties);
   static Molecule markup_sentence2molecule (Score_element *me, SCM markup_sentence, SCM properties);
-  static Molecule lookup_character (Score_element *me, SCM font_name, SCM text);
-  static Molecule lookup_text (Score_element *me, SCM font_name, SCM char_name);
+
+private:
+  static Molecule lookup_character (Score_element *me, Font_metric*, SCM char_name);
+  static Molecule lookup_text (Score_element *me, Font_metric*, SCM text);
 };
 
 #endif /* TEXT_ITEM */
index 89e1a6f7f4f48b5d921666c601418d4427758fae..866e1c2d9bd107bd321eb7d71669863a54003f6f 100644 (file)
 #include "arpeggio.hh"
 
 /**
-   Make accidentals.  Catches note heads, ties and notices key-change
-   events.  Due to interaction with ties (which don't come together
-   with note heads), this needs to be in a context higher than Tie_engraver.
-   (FIXME).
+
 
    FIXME: should not compute vertical positioning of accidentals, but
    get them from the noteheads
@@ -81,8 +78,6 @@ Local_key_engraver::process_acknowledged ()
     {
       SCM localsig = get_property ("localKeySignature");
   
-      SCM f = get_property ("forgetAccidentals");
-      bool forget = to_boolean (f);
       for (int i=0; i  < mel_l_arr_.size(); i++) 
        {
          Score_element * support_l = support_l_arr_[i];
@@ -103,9 +98,7 @@ Local_key_engraver::process_acknowledged ()
          bool different = prev_acc != a;
          
          bool tie_changes = tied_l_arr_.find_l (support_l) && different;
-         if (!forget
-             && (note_l->forceacc_b_ || different)
-             && !tie_changes)
+         if ((note_l->forceacc_b_ || different) && !tie_changes)
            {
              if (!key_item_p_) 
                {
@@ -137,6 +130,7 @@ Local_key_engraver::process_acknowledged ()
            always do the correct thing?
 
           */
+         bool forget = to_boolean (get_property ("forgetAccidentals"));
          if (!forget && !tie_changes)
            {
              /*
index e3748f89f8da69f33c6b714e1b747b9267808a5e..16c6a56e578fd098bced3bec8faf6aacae1676d7 100644 (file)
@@ -42,6 +42,17 @@ Multi_measure_rest::brew_molecule (SCM smob)
 {
   Score_element *me = unsmob_element (smob);
   Spanner * sp = dynamic_cast<Spanner*> (me);
+
+  SCM alist_chain = Font_interface::font_alist_chain (me);
+
+  
+  SCM style_chain =
+    Font_interface::add_style (me, ly_symbol2scm ("mmrest-symbol"),
+                              alist_chain);
+
+  Font_metric *musfont
+    = Font_interface::get_font (me,style_chain);
+                       
   Real staff_space = Staff_symbol_referencer::staff_space (me);
 
   Interval sp_iv;
@@ -111,7 +122,7 @@ Multi_measure_rest::brew_molecule (SCM smob)
          Real pad = s.empty_b ()
            ? 0.0 : gh_scm2double (me->get_elt_property ("padding")) * staff_space;
 
-         Molecule r (Font_interface::get_default_font (me)->find_by_name ("rests-" + to_str (k)));
+         Molecule r (musfont->find_by_name ("rests-" + to_str (k)));
          if (k == 0)
            r.translate_axis (staff_space, Y_AXIS);
          
@@ -124,17 +135,16 @@ Multi_measure_rest::brew_molecule (SCM smob)
   else 
     {
       String idx =  ("rests-") + to_str (-4);
-      s = Font_interface::get_default_font (me)->find_by_name (idx);
+      s = musfont->find_by_name (idx);
     }
   
   mol.add_molecule (s);
 
   if (measures > 1)
     {
-      SCM properties = Font_interface::font_alist_chain (me);
       Molecule s = Text_item::text2molecule (me,
                                             ly_str02scm (to_str (measures).ch_C ()),
-                                            properties);
+                                            alist_chain);
       s.align_to (X_AXIS, CENTER);
       s.translate_axis (3.0 * staff_space, Y_AXIS);
       mol.add_molecule (s);
index b9207108a4f3199dc46fd55bae5ba7070f31bf4d..3cec390b494a312b3c83b2d4294063d00cdc83a8 100644 (file)
@@ -88,71 +88,55 @@ Text_item::string2molecule (Score_element *me, SCM text, SCM alist_chain)
 {
   SCM style = ly_assoc_chain (ly_symbol2scm ("font-style"),
                              alist_chain);
-  if  (gh_pair_p (style))
-    style = gh_cdr (style);
-  
-  SCM sheet = me->paper_l ()->style_sheet_;
-  
-  if (gh_symbol_p (style))
-    {
-      SCM style_alist = gh_cdr (scm_assoc (ly_symbol2scm ("style-alist"), sheet));
-      SCM entry = scm_assoc (style, style_alist);
-      entry = gh_pair_p (entry) ? gh_cdr (entry) : SCM_EOL;
-      alist_chain = gh_cons (entry, alist_chain);
-    }
-
-  SCM fonts = gh_cdr (scm_assoc (ly_symbol2scm ("fonts"), sheet));
-  SCM proc  = gh_cdr (scm_assoc (ly_symbol2scm ("properties-to-font"), sheet));
-  SCM font_name = gh_call2 (proc, fonts, alist_chain);
+  if  (gh_pair_p (style) && gh_symbol_p (gh_cdr (style)))
+    alist_chain = Font_interface::add_style (me, gh_cdr(style), alist_chain);
 
+  Font_metric *fm = Font_interface::get_font (me, alist_chain);
+  
   SCM lookup = ly_assoc_chain (ly_symbol2scm ("lookup"), alist_chain);
-
+    
   Molecule mol;
-  if (gh_pair_p (lookup) && ly_symbol2string (gh_cdr (lookup)) == "name")
-    mol = lookup_character (me, font_name, text);
+  if (gh_pair_p (lookup) && gh_cdr (lookup) ==ly_symbol2scm ("name"))
+    mol = lookup_character (me, fm, text);
   else
-    mol = lookup_text (me, font_name, text);
+    mol = lookup_text (me, fm, text);
   
   return mol;
 }
 
 Molecule
-Text_item::lookup_character (Score_element *, SCM font_name, SCM char_name)
+Text_item::lookup_character (Score_element *, Font_metric*fm, SCM char_name)
 {
-  Adobe_font_metric *afm = all_fonts_global_p->find_afm (ly_scm2string (font_name));
-  
-  if (!afm)
-    {
-      warning (_f ("can't find font: `%s'", ly_scm2string (font_name)));
-      warning (_f ("(search path: `%s')", global_path.str ().ch_C()));
-      error (_ ("Aborting"));
-    }
-  Font_metric * fm = afm;
-  
   return fm->find_by_name (ly_scm2string (char_name));
 }
 
 
 Molecule
-Text_item::lookup_text (Score_element *me, SCM font_name, SCM text)
+Text_item::lookup_text (Score_element *me, Font_metric*fm, SCM text)
 {
+#if 0
+  /*
+    Fixme; should be done differently, move to font-interface?
+   */
+
   SCM magnification = me->get_elt_property ("font-magnification");
+
   Font_metric* metric = 0;
   if (gh_number_p (magnification))
     {
-#if 0
+
       Real realmag = pow (1.2, gh_scm2int (magnification));
       metric = all_fonts_global_p->find_scaled (ly_scm2string (font_name), realmag);
-#endif
+
       assert (false);
     }
-  else
-    metric = me->paper_l ()->find_font (font_name, 1.0);
-  
+
+#endif
+
   SCM list = gh_list (ly_symbol2scm ("text"), text, SCM_UNDEFINED);
-  list = fontify_atom (metric, list);
+  list = fontify_atom (fm, list);
   
-  return Molecule (metric->text_dimension (ly_scm2string (text)), list);
+  return Molecule (fm->text_dimension (ly_scm2string (text)), list);
 }
 
 Molecule
index d208b44a105a241e4915c50214987086125c0b4b..2d8d6e6e9199e2f0c1040ae03c359af1faabbc8c 100644 (file)
@@ -104,7 +104,6 @@ Volta_engraver::do_process_music ()
 
            }
 
-                    
          end_volta_span_p_ = volta_span_p_;
          volta_span_p_ = 0;
        }
index 03399af21a1317e4a0d1a8615a0981a1019e7654..924715843e9d0dc874c14db459fed7dd6b28432c 100644 (file)
@@ -1,2 +1,3 @@
 
-#(eval-string (ly-gulp-file "generate-documentation.scm"))
+#(eval-string (ly-gulp-file "generate-engraver-documentation.scm"))
+#(eval-string (ly-gulp-file "generate-backend-documentation.scm"))