]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/parser.yy (assignment): allow SCM expression as assignment.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 12 Oct 2002 22:46:46 +0000 (22:46 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 12 Oct 2002 22:46:46 +0000 (22:46 +0000)
* lily/include/music-output-def.hh (class Music_output_def):
* lily/music-output-def.cc:
* lily/paper-def.cc:
* scm/font.scm (markup-to-properties):
* lily/parser.yy (music_output_def_body):
remove style_sheet_

20 files changed:
ChangeLog
lily/bar-line.cc
lily/bar-number-engraver.cc
lily/font-interface.cc
lily/include/music-output-def.hh
lily/music-output-def.cc
lily/my-lily-lexer.cc
lily/parser.yy
lily/text-item.cc
lilypond-font-lock.el
ly/paper-as5-init.ly
ly/paper11-init.ly
ly/paper13-init.ly
ly/paper16-init.ly
ly/paper19.ly
ly/paper20-init.ly
ly/paper23-init.ly
ly/paper26-init.ly
ly/params-init.ly
scm/font.scm

index 93aa738f997b721a5b8a24f83344e26691de189f..35e18b21493dba2976ce01b9a8b8af18fa6a4cf0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2002-10-13  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
+
+       * lily/parser.yy (assignment): allow SCM expression as assignment.
+
+       * lily/include/music-output-def.hh (class Music_output_def):
+       * lily/music-output-def.cc: 
+       * lily/paper-def.cc: 
+       * scm/font.scm (markup-to-properties):
+       * lily/parser.yy (music_output_def_body): 
+       remove style_sheet_
+
 2002-10-12  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
 
        * ly/grace-init.ly (startGraceMusic): shorten default grace stem
 
 2002-09-30  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
 
-       * VERSION: 1.6.5 released
-
        * scripts/lilypond-book.py (make_pixmap): don't produce empty pages.
 
 2002-09-28  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
index 43137f1c4d444a984a96b77016f6b21c436612ce..717da932c181a846cf7db819fcbd92f0eab9ee09 100644 (file)
@@ -190,20 +190,18 @@ Bar_line::get_staff_bar_size (SCM smob)
 
 
 ADD_INTERFACE (Bar_line, "bar-line-interface",
-  "Bar line.
-
-Print a special bar symbol. It replaces the 
-regular bar symbol with a special
-symbol.  The argument @var{bartype} is a string which specifies the
-kind of bar to print.  Options are @code{:|},
-@code{|:}, @code{:|:},
-@code{||}, @code{|.},
-@code{.|}, and @code{.|.}. 
-
-These produce, respectively, a right repeat, a left repeat, a double
-repeat, a double bar, a start bar, an end bar, and a thick double bar.
-If @var{bartype} is set to @code{empty} then nothing is printed,
-but a line break is allowed at that spot.
-"
-,
+  "Bar line.\n"
+"\n"
+"Print a special bar symbol. It replaces the \n"
+"regular bar symbol with a special\n"
+"symbol.  The argument @var{bartype} is a string which specifies the\n"
+"kind of bar to print.  Options are @code{:|},\n"
+"@code{|:}, @code{:|:},\n"
+"@code{||}, @code{|.},\n"
+"@code{.|}, and @code{.|.}. \n"
+"\n"
+"These produce, respectively, a right repeat, a left repeat, a double\n"
+"repeat, a double bar, a start bar, an end bar, and a thick double bar.\n"
+"If @var{bartype} is set to @code{empty} then nothing is printed,\n"
+"but a line break is allowed at that spot.\n",
   "bar-size-procedure kern thin-kern hair-thickness thick-thickness glyph bar-size break-glyph-function");
index 8a4a0d85fd387513ad0dc574951878ea92fad82e..4e1a45d1801db680967ddcb0a0700f589127e865 100644 (file)
@@ -115,8 +115,8 @@ Bar_number_engraver::create_items ()
 }
 
 ENTER_DESCRIPTION(Bar_number_engraver,
-/* descr */       "A bar number is created whenever measurePosition is zero. It is
-put on top of all staves, and appears only at  left side of the staff.",
+/* descr */       "A bar number is created whenever measurePosition is zero. It is\n"
+"put on top of all staves, and appears only at  left side of the staff.",
 /* creats*/       "BarNumber",
 /* accepts */     "",
 /* acks  */      "break-aligned-interface",
index 417581fc3a6941030b285bc874dffb768786124c..0694a85ef88b4258df2cd3b7916fe63c61376104 100644 (file)
@@ -38,11 +38,9 @@ Font_interface::font_alist_chain (Grob *me)
   /*
     Ugh: why the defaults?
    */
-  SCM defaults = ly_cdr (scm_assoc (ly_symbol2scm ("font-defaults"),
-                                   me->get_paper ()->style_sheet_));
+  SCM defaults = me->get_paper ()->lookup_variable (ly_symbol2scm ("font-defaults"));
 
   SCM ch = me->get_property_alist_chain (defaults);
-  
   return ch;
 }
 
@@ -107,12 +105,10 @@ Font_interface::get_font (Grob *me, SCM chain)
   
   if (!gh_string_p (name))
     {
-      SCM ss = me->get_paper ()->style_sheet_;
-
-      SCM proc = ly_cdr (scm_assoc (ly_symbol2scm ("properties-to-font"),
-                                   ss));
+      Paper_def * p =  me->get_paper ();
 
-      SCM fonts = ly_cdr (scm_assoc (ly_symbol2scm ("fonts"), ss));
+      SCM proc = p->lookup_variable (ly_symbol2scm ("properties-to-font"));
+      SCM fonts = p->lookup_variable (ly_symbol2scm ("fonts"));
 
       assert (gh_procedure_p (proc));
       name = gh_call2 (proc, fonts, chain);
@@ -129,10 +125,8 @@ SCM
 Font_interface::add_style (Grob* me, SCM style, SCM chain)
 {
   assert (gh_symbol_p (style));
-  
-  SCM sheet = me->get_paper ()->style_sheet_;
       
-  SCM style_alist = ly_cdr (scm_assoc (ly_symbol2scm ("style-alist"), sheet));
+  SCM style_alist = me->get_paper ()->lookup_variable (ly_symbol2scm ("style-alist"));
   SCM entry = scm_assoc (style, style_alist);
   if (gh_pair_p (entry))
     {
index b01a7e8a3f6313f2e088f72cd8e025152ba13e1f..6a7df0ff3c85478f10b4fcbb80e7d7cb87c3734b 100644 (file)
@@ -26,7 +26,6 @@ public:
 
   SCM scope_;
   SCM scaled_fonts_;
-  SCM style_sheet_;
   
   VIRTUAL_COPY_CONS (Music_output_def);
   Music_output_def (Music_output_def const&);
index ee064079abc4871182a7f854dc01316d08ea5168..2bfcaa075e87907c92f89e2ea534e35e5da67dc5 100644 (file)
@@ -28,12 +28,9 @@ Music_output_def::get_next_score_count () const
 
 Music_output_def::Music_output_def ()
 {
-  style_sheet_ = SCM_EOL;
   scaled_fonts_ = SCM_EOL;
-  
   translator_tab_ = new Scheme_hash_table;
   scope_ = SCM_EOL;
-  
   smobify_self ();
   scm_gc_unprotect_object (translator_tab_->self_scm ());
 
@@ -49,13 +46,11 @@ Music_output_def::Music_output_def (Music_output_def const &s)
   scope_ = SCM_EOL;
   translator_tab_ = new Scheme_hash_table (*s.translator_tab_);
 
-  style_sheet_ = SCM_EOL;
   scaled_fonts_ = SCM_EOL;
 
   smobify_self ();
   scm_gc_unprotect_object (translator_tab_->self_scm ());  
   
-  style_sheet_ = scm_list_copy (s.style_sheet_);
   scaled_fonts_ = scm_list_copy (s.scaled_fonts_);  
 
   scope_= ly_make_anonymous_module ();
@@ -71,7 +66,6 @@ SCM
 Music_output_def::mark_smob (SCM m)
 {
   Music_output_def * mo = (Music_output_def*) SCM_CELL_WORD_1 (m);
-  scm_gc_mark (mo->style_sheet_);
   scm_gc_mark (mo->translator_tab_->self_scm ());
   scm_gc_mark (mo->scope_);
 
index 2abbd0946e210eb4181c3664244dc0daad2566ad..edc49b7c5078f55587f777b00af01f8d28605ea8 100644 (file)
@@ -84,7 +84,6 @@ static Keyword_ent the_key_tab[]={
   {"partcombine", PARTCOMBINE},
   {"score", SCORE},
   {"script", SCRIPT},
-  {"stylesheet", STYLESHEET},
   {"skip", SKIP},
   {"tempo", TEMPO},
   {"translator", TRANSLATOR},
index 9bb82de2711f40d18ac2745dfa248a3d575da7a0..2492b91be2f7cca196b1d2b7ff3e89dba1d6a796 100644 (file)
@@ -351,9 +351,6 @@ toplevel_expression:
                else if (dynamic_cast<Midi_def*> ($1))
                        THIS->lexer_->set_identifier (scm_makfrom0str ("$defaultmidi"), $1->self_scm ());
        }
-       | embedded_scm {
-               // junk value
-       }       
        ;
 
 embedded_scm:
@@ -433,6 +430,7 @@ all objects can be unprotected as soon as they're here.
 
 */
        }
+       | embedded_scm { }
        ;
 
 
@@ -639,9 +637,6 @@ music_output_def_body:
        | music_output_def_body translator_spec_block   {
                $$->assign_translator ($2);
        }
-       | music_output_def_body STYLESHEET embedded_scm {
-               dynamic_cast<Paper_def*> ($$)-> style_sheet_ = $3;
-       }
        | music_output_def_body tempo_event  {
                /*
                        junk this ? there already is tempo stuff in
index 6e70076a55ce955313b5bc36e8aa2c2f37bfea4c..f503ab8592154256e35688ce328b72eca8782bf0 100644 (file)
@@ -111,13 +111,18 @@ Molecule
 Text_item::markup_text2molecule (Grob *me, SCM markup_text,
                                 SCM alist_chain)
 {
-  SCM sheet = me->get_paper ()->style_sheet_;
-  SCM f = ly_cdr (scm_assoc (ly_symbol2scm ("markup-to-properties"), sheet));
+  SCM f = me->get_paper ()->lookup_variable (ly_symbol2scm ("markup-to-properties"));
   
   SCM markup = ly_car (markup_text);
   SCM text = ly_cdr (markup_text);
 
-  SCM p = gh_cons (gh_call2 (f, sheet, markup), alist_chain);
+  /* ARGRGRRGRARGRA
+   */
+
+  SCM abbrev = me->get_paper ()->lookup_variable (ly_symbol2scm ("abbreviation-alist"));
+  SCM style = me->get_paper ()->lookup_variable (ly_symbol2scm ("style-alist"));
+  
+  SCM p = gh_cons (scm_call_3 (f, abbrev, style, markup), alist_chain);
 
   Real staff_space = Staff_symbol_referencer::staff_space (me);
 
index e2ff2655f5c1110fbcb3b6daa0a32e965645c7f4..8d34f5ded395b2f5fa3534fdee53e2a46fc7b7ee 100644 (file)
@@ -39,7 +39,7 @@
 "clipping" "[cm]m" "coda" "complex" 
 "\\(command\\)?spanrequest" "consists\\(end\\)?"
 "context" "contrabasso" "\\(de\\)?cr" "default" "denies" "different" "dirs"
-"down\\(bow\\|prall\\)?" "duration" "\\(dynamic\\|text\\)?script"
+"down\\(bow\\|prall\\)?" "duration" "\\(text\\)?script"
 "eccentric" "eg" "embeddedps" "elementdescriptions" "\\(end\\)?cresc"
 "ex\\(treme\\)?" "fermata" "f+" "figures" "font" "flageolet" "fp" "fragment" 
 "s?fz" "gliss\\(ando\\)?" "gg" "gmsus" "grace" "gr\\(and\\)?staff"
@@ -60,7 +60,7 @@
 "simultaneous" "singlepart" "skip" "small" "\\(smart\\)?transpose"
 "s[pf]+" "staccat\\(issim\\)?o" "staff\\(height\\|space\\)" "start" 
 "stop\\(ped\\)?"
-"st\\(paper\\|score\\)" "stuff" "stylesheet" "su" "tab" "tempo" "tenuto" 
+"st\\(paper\\|score\\)" "stuff" "su" "tab" "tempo" "tenuto" 
 "thenotes" "thrd" "threevoice" "thumb" "tilt\\(down\\|up\\)" 
 "timb" "times?" "tiny" "toeters" "touch" "translator" 
 "trill" "type" "t\\(wo\\(voice\\(steminvert\\)?\\)?\\)?" 
index c2fcfa84970f5235ccf51d5073a1061ad30187f2..18ff108c668f59ac86a978d37cb463f6848f2a99 100644 (file)
@@ -5,7 +5,7 @@
 paperAsFive = \paper {
        staffheight = 5.\char
 
-       \stylesheet #(as-make-style-sheet 'as5)
+       \stylesheet #(as-make-font-list 'as5)
        
        \translator { \StaffContext barSize = #5 }
 
index f92047ce1b2a1ba19e288442e897943af1323c12..dbd03094c175d2db471c51b01cf20b68d95afcf1 100644 (file)
@@ -4,7 +4,7 @@
 
 paperEleven = \paper {
        staffheight = 11.0\pt
-       \stylesheet #(make-style-sheet 'paper11)
+       #(define fonts (make-font-list 'paper11))
 
        \include "params-init.ly"
 }
index 8c557bfdadcfe29be4bb2bb8c73322b142f210d2..dbacf585dc90ea7038f04a98da7e6289ef430b3f 100644 (file)
@@ -6,7 +6,7 @@
 paperThirteen = \paper {
        staffheight = 13.0\pt
 
-       \stylesheet #(make-style-sheet 'paper13)
+       #(define fonts (make-font-list 'paper13))
        
        \include "params-init.ly"
 }
index 4b154bc867e64ea981fa0565e21e688cb4efdd0d..453c823d1dc4a4d7e95e69572131b8ba96101f9e 100644 (file)
@@ -4,7 +4,7 @@
 
 paperSixteen = \paper {
        staffheight = 16.0\pt
-       \stylesheet #(make-style-sheet 'paper16)
+       \stylesheet #(make-font-list 'paper16)
 
        \include "params-init.ly"
 }
index b1ae87e08d98d586104defc482b7302ea56d9ba3..89d4321bbc25d3f2bd7d5a4df9e2b6f33b4d2228 100644 (file)
@@ -5,8 +5,8 @@
 
 paperNineteen = \paper {
        staffheight = 19.0\pt
-       \stylesheet #(make-style-sheet 'paper19)
-       
+       #(define fonts (make-font-list 'paper19))
+
        \include "params-init.ly"
 }
 
index e32470b78168735960b61f73c6812ef52b9c592b..55f96135214b5cb912ee0b9fe23cff27d2fec58f 100644 (file)
@@ -5,7 +5,7 @@
 
 paperTwenty = \paper {
        staffheight = 20.0\pt
-       \stylesheet #(make-style-sheet 'paper20)
+       #(define fonts (make-font-list 'paper20))
        
        \include "params-init.ly"
 }
index 4e95f7edae77be4db92a7130f72f7fbb3a080a8f..40730e03168bd61b8d25d36a1a748ccabfcf5d41 100644 (file)
@@ -5,7 +5,7 @@
 
 paperTwentythree = \paper {
        staffheight = 23.0\pt
-       \stylesheet #(make-style-sheet 'paper23)
+       #(define fonts (make-font-list 'paper23))
        \include "params-init.ly"
 }
 
index 53c7bb6a227bee66b8dfae43693b5a4757d24206..0e5845ae10b1b116f9a56cc954fbe31586b219f9 100644 (file)
@@ -4,8 +4,7 @@
 
 paperTwentysix = \paper {
        staffheight = 26.0\pt
-       \stylesheet #(make-style-sheet 'paper26)        
-
+       #(define fonts (make-font-list 'paper26))
        \include "params-init.ly"
 }
 
index f35faf4ef466ba78404c2307151c3027c1e706fe..8e144cc9a762f6ca62ebb3a95511c9ae7efd061b 100644 (file)
@@ -54,3 +54,51 @@ interscoreline = 4. \mm
 
 
 
+#(define font-defaults
+      '((font-family . music)
+       (font-relative-size . 0)
+       (font-shape . upright)
+       (font-series . medium)
+       ))
+
+#(define style-alist
+      '((finger . ((font-family . number) (font-relative-size . -3)))
+       (volta . ((font-family . number) (font-relative-size . -2)))
+       (tuplet . ((font-family . roman) (font-shape . italic) (font-relative-size . -1)))
+
+       (timesig . ((font-family . number) ))
+       (timesig-symbol . ((font-family . music) ))
+       
+       (mmrest . ((font-family . number) ))
+       (mmrest-symbol . ((font-family . music) ))
+
+       (mark-number . ((font-family . number) (font-relative-size . 1)))
+       (mark-letter . ((font-family . roman)
+                       (font-series . bold)
+                       (font-shape . upright)
+                       (font-relative-size . 2)))
+       
+       (script . ((font-family . roman) (font-relative-size . -1)))
+       (large . ((font-family . roman) (font-relative-size . 1)))
+       (Large . ((font-series . bold) (font-family . roman)
+                 (font-relative-size . 2)))
+       (dynamic . ((font-family . dynamic) (font-relative-size . 0)))
+       ))
+#(define properties-to-font Font_interface::properties_to_font_name)
+#(define markup-to-properties markup-to-properties)
+#(define abbreviation-alist
+      '((columns . ((axis . 0)))
+       (lines . ((axis . 1)))
+       (roman . ((font-family . roman)))
+       (music . ((font-family . music) (lookup . name)))
+       (finger . ((font-style . finger)))
+       (bold . ((font-series . bold)))
+       (upright . ((font-shape . upright)))
+       (italic . ((font-shape . italic)))
+       (named . ((lookup . name)))
+       (overstrike . ((extent . (0 . 0))))
+       (super . ((raise . 1) (font-relative-size . -1) (extent . (0 . 0))))
+       (sub . ((raise . -1) (font-relative-size . -1) (extent . (0 . 0))))
+       (text . ((lookup . value)))
+       )
+     )
index e4d95ba338e6fa64bc92fe89741d7b5e2c67ab23..805d26cab997f82ce98e95c87aa71d16b779f8f0 100644 (file)
@@ -39,7 +39,8 @@
        font-descr-alist)
       )
 
-(define paper-style-sheet-alist
+
+(define size-independent-fonts
   `(
     ((* * * braces *) . ("feta-braces0"
                         "feta-braces1"
             paper20-style-sheet-alist))
        font-list-alist)))
 
-(define-public (make-style-sheet sym)
-  `((fonts . ,(append paper-style-sheet-alist
-                     (cdr (assoc sym font-list-alist))))
-    (font-defaults
-     . ((font-family . music)
-       (font-relative-size . 0)
-       (font-shape . upright)
-       (font-series . medium)
-       ))
-    (style-alist
-     . ((finger . ((font-family . number) (font-relative-size . -3)))
-       (volta . ((font-family . number) (font-relative-size . -2)))
-       (tuplet . ((font-family . roman) (font-shape . italic) (font-relative-size . -1)))
-
-       (timesig . ((font-family . number) ))
-       (timesig-symbol . ((font-family . music) ))
-       
-       (mmrest . ((font-family . number) ))
-       (mmrest-symbol . ((font-family . music) ))
-
-       (mark-number . ((font-family . number) (font-relative-size . 1)))
-       (mark-letter . ((font-family . roman)
-                       (font-series . bold)
-                       (font-shape . upright)
-                       (font-relative-size . 2)))
-       
-       (script . ((font-family . roman) (font-relative-size . -1)))
-       (large . ((font-family . roman) (font-relative-size . 1)))
-       (Large . ((font-series . bold) (font-family . roman)
-                 (font-relative-size . 2)))
-       (dynamic . ((font-family . dynamic) (font-relative-size . 0)))
-       ))
-    (properties-to-font .
-                       ,Font_interface::properties_to_font_name)
-
-    (markup-to-properties . ,markup-to-properties)
-    (abbreviation-alist
-     . ((columns . ((axis . 0)))
-       (lines . ((axis . 1)))
-       (roman . ((font-family . roman)))
-       (music . ((font-family . music) (lookup . name)))
-       (finger . ((font-style . finger)))
-       (bold . ((font-series . bold)))
-       (upright . ((font-shape . upright)))
-       (italic . ((font-shape . italic)))
-       (named . ((lookup . name)))
-       (overstrike . ((extent . (0 . 0))))
-       (super . ((raise . 1) (font-relative-size . -1) (extent . (0 . 0))))
-       (sub . ((raise . -1) (font-relative-size . -1) (extent . (0 . 0))))
-       (text . ((lookup . value)))
-       )
-     )
-    
-    )
-  )
+(define-public (make-font-list sym)
+  (append size-independent-fonts
+         (cdr (assoc sym font-list-alist))))
 
 (define (qualifiers-to-fontnames  qualifiers font-descr-alist)
   " reduce the font list by successively applying a font-qualifier."
@@ -374,7 +323,8 @@ and warn if the selected font is not unique.
        selected)       ; return the topmost.
     ))
 
-(define (markup-to-properties sheet markup)
+(define-public (markup-to-properties abbrev-alist style-alist markup)
+  "DOCME."
   ;; (display "markup: `")
   ;; (write markup)
   ;; (display "'\n")
@@ -389,19 +339,18 @@ and warn if the selected font is not unique.
               (or (not (pair? (cdr markup)))
                   (number? (cadr markup))))
          (if (equal? '() (cdr markup))
-             (markup-to-properties sheet (car markup))
+             (markup-to-properties abbrev-alist style-alist (car markup))
              (list markup))
          
          (if (equal? '() (cdr markup))
-             (markup-to-properties sheet (car markup))
-             (append (markup-to-properties sheet (car markup))
-                     (markup-to-properties sheet (cdr markup)))))
+             (markup-to-properties abbrev-alist style-alist (car markup))
+             (append (markup-to-properties abbrev-alist style-alist (car markup))
+                     (markup-to-properties abbrev-alist style-alist (cdr markup)))))
       
       ;; markup is single abbreviation
       (let ((entry (assoc markup
                          ;; assoc-chain?
-                         (append (cdr (assoc 'abbreviation-alist sheet))
-                                 (cdr (assoc 'style-alist sheet))))))
+                         (append abbrev-alist style-alist))))
        (if entry
            (cdr entry)
            (list (cons markup #t))))))