+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>
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");
}
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",
/*
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;
}
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);
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))
{
SCM scope_;
SCM scaled_fonts_;
- SCM style_sheet_;
VIRTUAL_COPY_CONS (Music_output_def);
Music_output_def (Music_output_def 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 ());
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 ();
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_);
{"partcombine", PARTCOMBINE},
{"score", SCORE},
{"script", SCRIPT},
- {"stylesheet", STYLESHEET},
{"skip", SKIP},
{"tempo", TEMPO},
{"translator", TRANSLATOR},
else if (dynamic_cast<Midi_def*> ($1))
THIS->lexer_->set_identifier (scm_makfrom0str ("$defaultmidi"), $1->self_scm ());
}
- | embedded_scm {
- // junk value
- }
;
embedded_scm:
*/
}
+ | embedded_scm { }
;
| 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
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);
"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"
"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\\)?\\)?\\)?"
paperAsFive = \paper {
staffheight = 5.\char
- \stylesheet #(as-make-style-sheet 'as5)
+ \stylesheet #(as-make-font-list 'as5)
\translator { \StaffContext barSize = #5 }
paperEleven = \paper {
staffheight = 11.0\pt
- \stylesheet #(make-style-sheet 'paper11)
+ #(define fonts (make-font-list 'paper11))
\include "params-init.ly"
}
paperThirteen = \paper {
staffheight = 13.0\pt
- \stylesheet #(make-style-sheet 'paper13)
+ #(define fonts (make-font-list 'paper13))
\include "params-init.ly"
}
paperSixteen = \paper {
staffheight = 16.0\pt
- \stylesheet #(make-style-sheet 'paper16)
+ \stylesheet #(make-font-list 'paper16)
\include "params-init.ly"
}
paperNineteen = \paper {
staffheight = 19.0\pt
- \stylesheet #(make-style-sheet 'paper19)
-
+ #(define fonts (make-font-list 'paper19))
+
\include "params-init.ly"
}
paperTwenty = \paper {
staffheight = 20.0\pt
- \stylesheet #(make-style-sheet 'paper20)
+ #(define fonts (make-font-list 'paper20))
\include "params-init.ly"
}
paperTwentythree = \paper {
staffheight = 23.0\pt
- \stylesheet #(make-style-sheet 'paper23)
+ #(define fonts (make-font-list 'paper23))
\include "params-init.ly"
}
paperTwentysix = \paper {
staffheight = 26.0\pt
- \stylesheet #(make-style-sheet 'paper26)
-
+ #(define fonts (make-font-list 'paper26))
\include "params-init.ly"
}
+#(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)))
+ )
+ )
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."
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")
(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))))))