From: hanwen Date: Fri, 16 Jan 2004 19:25:35 +0000 (+0000) Subject: * scm/paper.scm (set-staff-size): new function: set default X-Git-Tag: release/2.1.11~10 X-Git-Url: https://git.donarmstrong.com/lilypond.git?a=commitdiff_plain;h=1602c06924435ca21b00010d60341312f630d519;p=lilypond.git * scm/paper.scm (set-staff-size): new function: set default staff-size. * scm/paper.scm: new file. (set-staff-size): new function (set-paper-size): new function * Documentation/user/refman.itely (Fermatas): document \lyricsto --- diff --git a/Documentation/topdocs/NEWS.texi b/Documentation/topdocs/NEWS.texi index f85b750578..8794234d05 100644 --- a/Documentation/topdocs/NEWS.texi +++ b/Documentation/topdocs/NEWS.texi @@ -17,6 +17,27 @@ Version 2.1.9 @end ignore @itemize @bullet +@item Default staff sizes are now scalable. There are two new mechanisms for +setting staff sizes is, both demonstrated in this fragment + +@example + #(set-staff-size 15) + \paper { + #(paper-set-staff-size (* 15 pt)) + } +@end example + +@noindent +Both have the same effect on the global layout of a +piece. Similarly, the paper size may be changed as follows + +@example + #(set-paper-size "a4") +@end example + +@item + The black note head was made a little rounder, which causes a less + frantic graphic impression. @item A more concise syntax for checking octaves was introduced. A note may diff --git a/Documentation/user/refman.itely b/Documentation/user/refman.itely index 61f9ac868b..581b0afeea 100644 --- a/Documentation/user/refman.itely +++ b/Documentation/user/refman.itely @@ -8450,8 +8450,9 @@ There is no convenient mechanism to manually override spacing. @cindex @code{paper} file The Feta font provides musical symbols at eight seven different -sizes. Each font is tuned for a different staff size, which are listed -in the following table: +sizes. Each font is tuned for a different staff size: at smaller sizes +the font gets heavier, to match the relatively heavier staff lines. +The recommended font sizes are listed in the following table: @multitable @columnfractions .3 .3 .4 @@ -8503,32 +8504,19 @@ in the following table: @end multitable -These standard sizes can be used by including the file @file{paperSZ.ly}, where -@code{SZ} is one of 11, 13, 16, 20, 23 and 26. If you include any -of these files, the variables @code{paperEleven}, -@code{paperThirteen}, @code{paperSixteen}, @code{paperEightteen}, -@code{paperTwenty}, @code{paperTwentythree}, and @code{paperTwentysix} -are defined respectively. The default @code{\paper} block is also -set. These files should be imported at toplevel, i.e. +These fonts are available in any sizes. The context property +@code{fontSize} and the layout property @code{staff-space} (in +@internalsref{StaffSymbol}) can be used to tune size for individual +staffs. The size of individual staffs are relative to the global size, +which can be set in the following manner: + @example - \include "paper26.ly" - \score @{ ... @} + #(set-staff-size 14) @end example -Sizes can also be - - -The default font size settings for each staff heights are generated -from the 20pt style sheet. For more details, see the file -@file{scm/font.scm}. - +This sets the global default size to 14pt staff height, and scales all +fonts accordingly. - of starting from 11 point -(. These fonts are 11 point, 13 point, 16 point, 20 point, 23 point, -and 26 point. The point size of a font is the height of the -corresponding staff (excluding line thicknesses). - -Definitions for these sizes are the files @node Line breaking @@ -8637,21 +8625,13 @@ The predefined command @code{\newpage} also does this. @cindex page size @cindex @code{papersize} -To change the paper size, you must first set the @code{papersize} paper -variable variable as in the example below. Set it to -the strings @code{a4}, @code{letter}, or @code{legal}. After this -specification, you must set the font as described above. If you want -the default font, then use the 20 point font. - +To change the paper size, use the following Scheme code: @example - \paper@{ papersize = "a4" @} - \include "paper16.ly" + \paper@{ + #(set-paper-size "a4") + @} @end example -The file @code{paper16.ly} will now include a file named @file{a4.ly}, which -will set the paper variables @code{hsize} and @code{vsize} (used by -@code{lilypond-book} and @code{lilypond}). - @refcommands diff --git a/input/ascii-art/as-email.ly b/input/ascii-art/as-email.ly index 41c2418e14..cc6cb7d451 100644 --- a/input/ascii-art/as-email.ly +++ b/input/ascii-art/as-email.ly @@ -1,5 +1,5 @@ #(ly:set-option 'old-relative) -\version "2.1.7" +\version "2.1.11" % ASCII Art output % % Process as: diff --git a/input/ascii-art/as2.ly b/input/ascii-art/as2.ly index f9ec2a1389..bce52f6846 100644 --- a/input/ascii-art/as2.ly +++ b/input/ascii-art/as2.ly @@ -1,5 +1,5 @@ #(ly:set-option 'old-relative) -\version "2.1.7" +\version "2.1.11" % test for ascii-art output diff --git a/input/ascii-art/asciiscript5.ly b/input/ascii-art/asciiscript5.ly index ae4c9715a7..4055f90a9b 100644 --- a/input/ascii-art/asciiscript5.ly +++ b/input/ascii-art/asciiscript5.ly @@ -1,5 +1,5 @@ #(ly:set-option 'old-relative) -\version "2.1.7" +\version "2.1.11" % ASCII Art output % % Process as: diff --git a/input/ascii-art/asciiscript9.ly b/input/ascii-art/asciiscript9.ly index 900e93acdd..c5b211e1c4 100644 --- a/input/ascii-art/asciiscript9.ly +++ b/input/ascii-art/asciiscript9.ly @@ -1,5 +1,5 @@ #(ly:set-option 'old-relative) -\version "2.1.7" +\version "2.1.11" % ASCII Art output % % Process as: diff --git a/input/ascii-art/r-as.ly b/input/ascii-art/r-as.ly index f098bfa4f5..d5ac0c9ad1 100644 --- a/input/ascii-art/r-as.ly +++ b/input/ascii-art/r-as.ly @@ -1,5 +1,5 @@ #(ly:set-option 'old-relative) -\version "2.1.7" +\version "2.1.11" % ASCII Art output % % Process as: diff --git a/input/ascii-art/standchen-as5.ly b/input/ascii-art/standchen-as5.ly index 1b94836dc5..5f5739c14f 100644 --- a/input/ascii-art/standchen-as5.ly +++ b/input/ascii-art/standchen-as5.ly @@ -1,5 +1,5 @@ #(ly:set-option 'old-relative) -\version "2.1.7" +\version "2.1.11" % ASCII Art output % % Process as: diff --git a/input/ascii-art/standchen-as9.ly b/input/ascii-art/standchen-as9.ly index 3bd6706447..18a7044f2b 100644 --- a/input/ascii-art/standchen-as9.ly +++ b/input/ascii-art/standchen-as9.ly @@ -1,5 +1,5 @@ #(ly:set-option 'old-relative) -\version "2.1.7" +\version "2.1.11" % ASCII Art output % Process as: diff --git a/input/ascii-art/twinkle-as5.ly b/input/ascii-art/twinkle-as5.ly index ebf0bbf5de..75e962f04b 100644 --- a/input/ascii-art/twinkle-as5.ly +++ b/input/ascii-art/twinkle-as5.ly @@ -1,5 +1,5 @@ #(ly:set-option 'old-relative) -\version "2.1.7" +\version "2.1.11" % ASCII Art output % % Process as: diff --git a/input/mutopia/F.Schubert/standchen.ly b/input/mutopia/F.Schubert/standchen.ly index 4532361861..0576ff65a2 100644 --- a/input/mutopia/F.Schubert/standchen.ly +++ b/input/mutopia/F.Schubert/standchen.ly @@ -42,12 +42,12 @@ instrument = "Piano" footer = "Mutopia-2001/04/27-xx" } -\version "2.1.10" +\version "2.1.11" dynamicUp = \property Voice.DynamicLineSpanner \override #'direction = #1 dynamicRevert = \property Voice.DynamicLineSpanner \revert #'direction -\include "paper16.ly" +#(set-staff-size 16) vocalVerse = \notes\relative c''{ \dynamicUp diff --git a/input/mutopia/J.S.Bach/wtk1-fugue2.ly b/input/mutopia/J.S.Bach/wtk1-fugue2.ly index 14dfc673ed..8fdf10a48a 100644 --- a/input/mutopia/J.S.Bach/wtk1-fugue2.ly +++ b/input/mutopia/J.S.Bach/wtk1-fugue2.ly @@ -1,4 +1,3 @@ -#(ly:set-option 'old-relative) \header { title = "Fuga a 3 voci" opus = "BWV 847-Fuga" @@ -34,7 +33,6 @@ the few forced linebreaks were an earlier attempt to get the spacing to match up. -%\include "paper19.ly" %} diff --git a/input/mutopia/R.Schumann/romanze-op28-2.ly b/input/mutopia/R.Schumann/romanze-op28-2.ly index 34b0565b49..f86b26c693 100644 --- a/input/mutopia/R.Schumann/romanze-op28-2.ly +++ b/input/mutopia/R.Schumann/romanze-op28-2.ly @@ -3,8 +3,8 @@ \include "deutsch.ly" -\include "paper16.ly" -\version "2.1.7" +#(set-staff-size 16) +\version "2.1.11" \header { title = "Romanzen" diff --git a/input/no-notation/denneboom.ly b/input/no-notation/denneboom.ly index 7902dd4de3..254efb8aee 100644 --- a/input/no-notation/denneboom.ly +++ b/input/no-notation/denneboom.ly @@ -1,4 +1,4 @@ -\version "2.1.7" +\version "2.1.11" \header{ filename = "denneboom.ly" enteredby = "jcn" @@ -6,7 +6,7 @@ copyright = "public domain" } %{ file tests silly line shapes %} -\include "paper20.ly" +#(set-staff-size 20) diff --git a/input/no-notation/midi-volume-equaliser.ly b/input/no-notation/midi-volume-equaliser.ly index be41ad5ac5..6e5bd7ec5f 100644 --- a/input/no-notation/midi-volume-equaliser.ly +++ b/input/no-notation/midi-volume-equaliser.ly @@ -1,12 +1,12 @@ #(ly:set-option 'old-relative) -\version "2.1.7" +\version "2.1.11" \header { texidoc = "@cindex Midi Volume Equaliser The full orchestra plays a notes, where groups stop one after another. Use this to tune equalizer settings. " } -\include "paper16-init.ly" +#(set-staff-size 16) %{ diff --git a/input/puer-fragment.ly b/input/puer-fragment.ly index e0b87021b9..c53c8e5912 100644 --- a/input/puer-fragment.ly +++ b/input/puer-fragment.ly @@ -1,4 +1,4 @@ -\version "2.1.7" +\version "2.1.11" \header { title = "Puer natus est nobis (excerptum)" subtitle = "Antiphona ad introitum VII" @@ -17,7 +17,7 @@ before the ligature (not demonstrated in this example)." } -\include "paper26.ly" +#(set-staff-size 26) \include "gregorian-init.ly" %%% N.B.: Yes, I know, the formatting of the following looks awful, diff --git a/input/regression/size11.ly b/input/regression/size11.ly index a5515b365c..e48b728fc5 100644 --- a/input/regression/size11.ly +++ b/input/regression/size11.ly @@ -1,4 +1,4 @@ -\version "2.1.7" +\version "2.1.11" \header{ texidoc=" @@ -14,5 +14,5 @@ foollilypondbook = " -\include "paper11.ly" +#(set-staff-size 11) \include "allfontstyle.lyinc" diff --git a/input/regression/size13.ly b/input/regression/size13.ly index 2c2f95f101..d73d433728 100644 --- a/input/regression/size13.ly +++ b/input/regression/size13.ly @@ -1,4 +1,4 @@ -\version "2.1.7" +\version "2.1.11" foollilypondbook = " \score " @@ -7,5 +7,5 @@ foollilypondbook = " texidoc ="Staff height 13 pt." } -\include "paper13.ly" +#(set-staff-size 13) \include "allfontstyle.lyinc" diff --git a/input/regression/size16.ly b/input/regression/size16.ly index ffbbe417ba..6c7cea8f11 100644 --- a/input/regression/size16.ly +++ b/input/regression/size16.ly @@ -1,4 +1,4 @@ -\version "2.1.7" +\version "2.1.11" foollilypondbook = " \score " @@ -9,5 +9,5 @@ foollilypondbook = " -\include "paper16.ly" +#(set-staff-size 16) \include "allfontstyle.lyinc" diff --git a/input/regression/size20.ly b/input/regression/size20.ly index 80369be245..32f631b0ac 100644 --- a/input/regression/size20.ly +++ b/input/regression/size20.ly @@ -1,4 +1,4 @@ -\version "2.1.7" +\version "2.1.11" foollilypondbook = " \score " @@ -9,5 +9,5 @@ foollilypondbook = " -\include "paper20.ly" +#(set-staff-size 20) \include "allfontstyle.lyinc" diff --git a/input/regression/size23.ly b/input/regression/size23.ly index 6d8634c5a1..880a54c7f0 100644 --- a/input/regression/size23.ly +++ b/input/regression/size23.ly @@ -1,4 +1,4 @@ -\version "2.1.7" +\version "2.1.11" foollilypondbook = " \score " @@ -8,5 +8,5 @@ foollilypondbook = " } -\include "paper23.ly" +#(set-staff-size 23) \include "allfontstyle.lyinc" diff --git a/input/regression/size26.ly b/input/regression/size26.ly index b36fa9ef56..959fca5afd 100644 --- a/input/regression/size26.ly +++ b/input/regression/size26.ly @@ -1,4 +1,4 @@ -\version "2.1.7" +\version "2.1.11" foollilypondbook = " \score " @@ -9,5 +9,5 @@ foollilypondbook = " -\include "paper26.ly" +#(set-staff-size 26) \include "allfontstyle.lyinc" diff --git a/input/template/jazz-combo.ly b/input/template/jazz-combo.ly index 5590889cf9..16892572f5 100644 --- a/input/template/jazz-combo.ly +++ b/input/template/jazz-combo.ly @@ -1,4 +1,4 @@ -\version "2.1.7" +\version "2.1.11" \header { title = "Song" subtitle = "(tune)" @@ -9,7 +9,7 @@ texidoc = "Jazz tune for combo (horns, piano, drums, bass, guitar)." } -\include "paper16.ly" +#(set-staff-size 16) \include "english.ly" %%%%%%%%%%%% Some macros %%%%%%%%%%%%%%%%%%% diff --git a/input/test/coriolan-margin.ly b/input/test/coriolan-margin.ly index de1ace728f..28c03c601a 100644 --- a/input/test/coriolan-margin.ly +++ b/input/test/coriolan-margin.ly @@ -1,5 +1,5 @@ -\version "2.1.7" +\version "2.1.11" % Ugh, we need to override some LaTeX titling stuff @@ -16,7 +16,7 @@ texidoc = "@cindex Orchestra Score Demonstration of how to set up an orchestral score (Beethoven's Coriolan overture). " } -\include "paper16.ly" +#(set-staff-size 16) raisedFlat = \markup { \raise #0.4 \smaller \smaller \musicglyph #"accidentals--1" } diff --git a/input/test/fill-a4.ly b/input/test/fill-a4.ly index ffdb9f4aaf..937e2a12b5 100644 --- a/input/test/fill-a4.ly +++ b/input/test/fill-a4.ly @@ -1,4 +1,4 @@ -\version "2.1.7" +\version "2.1.11" %possible rename to paper-fill-a4.ly -gp % candidate for reg -gp % Han says no, but keeping this comment temporarily so that I don't @@ -16,7 +16,7 @@ This should fill a4 paper. " } -\include "paper13.ly" +#(set-staff-size 13) \score{ \context Voice \notes\relative c'{ diff --git a/ly/book-init-init.ly b/ly/book-init-init.ly index 512e52ccdb..f07ec86ee5 100644 --- a/ly/book-init-init.ly +++ b/ly/book-init-init.ly @@ -1,10 +1,10 @@ % Toplevel initialisation file. -\version "1.9.8" +\version "2.1.11" \include "declarations-init.ly" -\include "paper16-init.ly" +#(set-staff-size 16) \paper{ \paperSixteen diff --git a/ly/center-init.ly b/ly/center-init.ly index 2e6d56af77..c2eaea4742 100644 --- a/ly/center-init.ly +++ b/ly/center-init.ly @@ -1,10 +1,10 @@ % Toplevel initialisation file. -\version "1.9.8" +\version "2.1.11" \include "declarations-init.ly" -\include "paper16-init.ly" +#(set-staff-size 16) \paper { \paperSixteen diff --git a/scm/paper.scm b/scm/paper.scm index b42e988c68..7987d8f021 100644 --- a/scm/paper.scm +++ b/scm/paper.scm @@ -17,6 +17,7 @@ (module-define! m 'fonts (scale-font-list (/ sz (* 20 pt)))) (module-define! m 'staffheight sz) (module-define! m 'staff-space ss) + (module-define! m 'staffspace ss) (module-define! m 'linethickness (* 0.5 pt)) (module-define! m 'outputscale ss) (module-define! m 'ledgerlinethickness (+ (* 0.5 pt) (/ ss 10))) @@ -48,6 +49,19 @@ ;; todo: take dimension arguments. + +(define (set-paper-dimensions m h w) + (let* + ( (mm (eval 'mm m)) ) + + (module-define! m 'hsize w) + (module-define! m 'vsize h) + (module-define! m 'linewidth (- w (* 20 mm))) + (module-define! m 'raggedright #f) + (module-define! m 'packed #f) + (module-define! m 'indent (/ w 14)) )) + + (define-public (set-paper-size name) (let* ((entry (assoc name paper-alist)) @@ -58,13 +72,7 @@ (if (pair? entry) (begin (set! entry (eval (cdr entry) m)) - (module-define! m 'papersize name) - (module-define! m 'papersizename name) - (module-define! m 'hsize (car entry)) - (module-define! m 'vsize (cdr entry)) - (module-define! m 'linewidth (- (car entry) (* 20 mm))) - (module-define! m 'raggedright #f) - (module-define! m 'packed #f) - (module-define! m 'indent (/ (car entry) 4)) ) + (set-paper-dimensions m (car entry) (cdr entry)) + ) (ly:warning (string-append "Unknown papersize: " name)) ))) diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index f6358cc133..10b5863d74 100644 --- a/scripts/lilypond-book.py +++ b/scripts/lilypond-book.py @@ -726,7 +726,8 @@ def compose_full_body (body, opts): body = r''' %% Generated automatically by: lilypond-book.py %% options are %s -\include "paper%d.ly" +#(set-staff-size %d) + \paper { %s %s