From f859588498869fb18312f4f2c0bfa23f49cda673 Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Mon, 1 Apr 2002 16:31:15 +0000
Subject: [PATCH] * input/mozart-hrn-3.ly: Mimic Breitkopf fonts and padding.

* scm/grob-property-description.scm (number-threshold): Add
description.

* lily/multi-measure-rest.cc (brew_molecule): Only put number over
rest if #measures > number-threshold.  Use padding (well, fake
using it, anyway).

* scm/font.scm (make-style-sheet): New styles: mark-number,
mark-letter.
(paper20-style-sheet-alist): Add bigger bold fonts.

* lily/mark-engraver.cc (process_music): Use style mark-number or
mark-letter.
---
 .cvsignore                        |  1 +
 ChangeLog                         | 16 ++++++++++++
 input/mozart-hrn-3.ly             | 43 +++++++++++++++++++++++++------
 input/mozart-hrn3-allegro.ly      |  4 +--
 lily/beam.cc                      | 19 ++++++++++----
 lily/mark-engraver.cc             |  4 +--
 lily/multi-measure-rest.cc        |  9 ++++---
 scm/font.scm                      | 11 ++++++--
 scm/grob-description.scm          |  6 ++---
 scm/grob-property-description.scm |  3 +++
 10 files changed, 90 insertions(+), 26 deletions(-)

diff --git a/.cvsignore b/.cvsignore
index 4345ae3630..773081c5e1 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -25,6 +25,7 @@ configure
 *.tex
 *.txt
 *[0-9]pk
+ly2dvi.dir
 out
 out-www
 afm
diff --git a/ChangeLog b/ChangeLog
index 056ee9a85f..b455b24401 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -22,6 +22,22 @@
 	
 2002-04-01  Jan Nieuwenhuizen  <janneke@gnu.org>
 
+	* input/mozart-hrn-3.ly: Mimic Breitkopf fonts and padding.
+
+	* scm/grob-property-description.scm (number-threshold): Add
+	description.
+
+	* lily/multi-measure-rest.cc (brew_molecule): Only put number over
+	rest if #measures > number-threshold.  Use padding (well, fake
+	using it, anyway).
+
+	* scm/font.scm (make-style-sheet): New styles: mark-number,
+	mark-letter.
+	(paper20-style-sheet-alist): Add bigger bold fonts.
+
+	* lily/mark-engraver.cc (process_music): Use style mark-number or
+	mark-letter.
+
 	* .cvsignore: Ignore all kinds of lilypond input and output.
 
 	* lily/beam.cc (ADD_INTERFACE): Add concaveness-gap.
diff --git a/input/mozart-hrn-3.ly b/input/mozart-hrn-3.ly
index 6543c0813d..2e06c75424 100644
--- a/input/mozart-hrn-3.ly
+++ b/input/mozart-hrn-3.ly
@@ -38,18 +38,45 @@ ritenuto = \textscript #'(italic  "rit.")
 
 \version "1.5.47"
 
+#(define italic-bf '((font-shape . italic) (font-series . bold)))
+
+%% burp
+%% the very idea of a style sheet, is that it's easy to override
+#(define (set-style! sheet name style)
+  (set-cdr! (assoc 'mark-letter (cdr (assoc 'style-alist sheet))) style))
+
+#(define my-sheet (make-style-sheet 'paper20))
+#(set-style! my-sheet 'mark-letter '((font-family . roman)
+				     (font-series . bold)
+				     (font-shape . upright)
+				     (font-relative-size . 3)))
+  
+cresc = \notes {
+    \commandspanrequest \start "crescendo" 
+    \property Voice.crescendoText = #`(,italic-bf "cresc.")
+    \property Voice.crescendoSpanner = #'dashed-line
+}
+
 \paper{
- \translator { \ScoreContext
+    \stylesheet #my-sheet
+    \translator {
+	\ScoreContext
     	skipBars = ##t
 	midiInstrument = #"french horn"
-	RehearsalMark \override #'font-series = #'bold
+	%% try to mimic Breitkopf
+	RehearsalMark \override #'padding = #1
+	MultiMeasureRest \override #'padding = #0.5
+	MultiMeasureRest \override #'number-threshold = #1
 	Stem \override #'thickness = #1.3
-  }
- \translator { \StaffContext
-	       MinimumVerticalExtent = #'(-4.5 . 4.5)
-	       }
-  indent = 10. \mm
-  linewidth = 189. \mm
+	Beam \override #'thickness = #0.6
+	Beam \override #'beam-space = #0.8
+    }
+    \translator {
+	\StaffContext
+	MinimumVerticalExtent = #'(-4.5 . 4.5)
+    }
+    indent = 10. \mm
+    linewidth = 189. \mm
 }
 
 \include "mozart-hrn3-allegro.ly"
diff --git a/input/mozart-hrn3-allegro.ly b/input/mozart-hrn3-allegro.ly
index 2d7c95dc28..1569568c01 100644
--- a/input/mozart-hrn3-allegro.ly
+++ b/input/mozart-hrn3-allegro.ly
@@ -41,7 +41,7 @@ allegro =
 	[ )fis8( e16 )d] d4-. r2 | 
 	\mark "B"
 	R1*3
-	r2 r4 [d8(_#'(italic "con espressione") )b ]
+	r2 r4 [d8(_#`(,italic-bf "con espressione") )b ]
 	[a( )g d'( )b] [a( )g e'( )c ]
 	[b8( )a] a4 r4 [a8-. a-.]
 	[a( \< b c \!cis\> ]  d4 \! )c
@@ -120,7 +120,7 @@ allegro =
 	[dis()e] r e-. [e()f] r f-. |
 	g4-.-\f e-. c-. bes-. |
 	g-.\ff e-. c-. r |
-	a'2 ~ [a8_#'((font-shape . italic) "sempre " (dynamic "f")) b16 c] [d( e d )e]%TODO
+	a'2 ~ [a8_#`(,italic-bf "sempre " (dynamic "f")) b16 c] [d( e d )e]%TODO
 
 	f4. () d8 [f8 ()d f d]
 	[c (e] )g2 \grace  { \longgrace f16(  \endlonggrace }  [)e8( d16 )c]
diff --git a/lily/beam.cc b/lily/beam.cc
index a5453ac1aa..f5ce479bbd 100644
--- a/lily/beam.cc
+++ b/lily/beam.cc
@@ -74,12 +74,21 @@ Beam::add_stem (Grob *me, Grob *s)
 Real
 Beam::get_interbeam (Grob *me)
 {
-  Real slt = me->paper_l ()->get_var ("linethickness");
+  int multiplicity = get_multiplicity (me);
   Real ss = Staff_symbol_referencer::staff_space (me);
-  Real thickness = gh_scm2double (me->get_grob_property ("thickness"))
-    * ss;
+  
+  SCM s = me->get_grob_property ("beam-space");
+  if (gh_number_p (s))
+    return gh_scm2double (s) * ss;
+  else if (gh_list_p (s))
+    return gh_scm2double (scm_list_ref (s,
+					gh_int2scm (multiplicity - 1
+						    <? scm_ilength (s) - 1)))
+      * ss;
+  
+  Real slt = me->paper_l ()->get_var ("linethickness");
+  Real thickness = gh_scm2double (me->get_grob_property ("thickness")) * ss;
 
-  int multiplicity = get_multiplicity (me);
   Real interbeam = multiplicity < 4
     ? (2*ss + slt - thickness) / 2.0
     : (3*ss + slt - thickness) / 3.0;
@@ -1382,5 +1391,5 @@ the ideal slope, how close the result is to the ideal stems, etc.). We
 take the best scoring combination.
 
 ",
-  "concaveness-gap concaveness-threshold dir-function quant-score auto-knee-gap gap chord-tremolo beamed-stem-shorten shorten least-squares-dy direction damping flag-width-function neutral-direction positions thickness");
+  "beam-space concaveness-gap concaveness-threshold dir-function quant-score auto-knee-gap gap chord-tremolo beamed-stem-shorten shorten least-squares-dy direction damping flag-width-function neutral-direction positions thickness");
 
diff --git a/lily/mark-engraver.cc b/lily/mark-engraver.cc
index 4130dcbfd9..a3123f1168 100644
--- a/lily/mark-engraver.cc
+++ b/lily/mark-engraver.cc
@@ -174,12 +174,12 @@ Mark_engraver::process_music ()
 	  text_p_->set_grob_property ("text",
 				      ly_str02scm (t.ch_C ()));
 
-	  String style = "mark";
+	  String style = "mark-number";
 	  for (int i=0; i < t.length_i (); i++)
 	    {
 	      if (!isdigit (t[i])) 
 		{
-		  style = "large";
+		  style = "mark-letter";
 		  break;
 		}
 	    }
diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc
index 0d0c3d6d2e..2659274f81 100644
--- a/lily/multi-measure-rest.cc
+++ b/lily/multi-measure-rest.cc
@@ -117,15 +117,16 @@ Multi_measure_rest::brew_molecule (SCM smob)
       measures = gh_scm2int (m);
     }
 
-  if (measures > 1)
+  SCM s = me->get_grob_property ("number-threshold");
+  if (measures > gh_scm2int (s))
     {
       Molecule s = Text_item::text2molecule (me,
 					     ly_str02scm (to_str (measures).ch_C ()),
 					     alist_chain);
 
-      
       s.align_to (X_AXIS, CENTER);
-      s.translate_axis (3.0, Y_AXIS);
+      s.translate_axis (gh_scm2double (me->get_grob_property ("padding")) + 2,
+			Y_AXIS);
 
       s.translate_axis (mol.extent (X_AXIS).center (),  X_AXIS);
       mol.add_molecule (s);
@@ -338,4 +339,4 @@ numbers, fields from font-interface may be used.
 
 
 ",
-  "thickness measure-count expand-limit");
+  "expand-limit measure-count number-threshold padding thickness");
diff --git a/scm/font.scm b/scm/font.scm
index 93fd56addf..1adcf54c14 100644
--- a/scm/font.scm
+++ b/scm/font.scm
@@ -90,7 +90,9 @@
     ((-2 medium italic roman 7) . "cmti7")
     ((-3 medium italic roman 7) . "cmti7")    
 
-    ((2 bold upright roman 12) . "cmbx12")
+    ((4 bold upright roman 17) . "cmbx17")
+    ((3 bold upright roman 17) . "cmbx17")
+    ((2 bold upright roman 14) . "cmbx14")
     ((1 bold upright roman 12) . "cmbx12")
     ((0 bold upright roman 10) . "cmbx10")
     ((-1 bold upright roman 8) . "cmbx8")
@@ -218,7 +220,12 @@
 	(mmrest . ((font-family . number) ))
 	(mmrest-symbol . ((font-family . music) ))
 
-	(mark . ((font-family . number) (font-relative-size . 1)))
+	(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)
diff --git a/scm/grob-description.scm b/scm/grob-description.scm
index f319e97de8..d48295cd4e 100644
--- a/scm/grob-description.scm
+++ b/scm/grob-description.scm
@@ -418,9 +418,6 @@
 
 	(direction . 1)
 	(breakable . #t)
-	(font-family . roman)
-	(font-shape . upright)
-	(font-relative-size . 1)
 	(visibility-lambda . ,end-of-line-invisible)
 	(padding . 0.8)
 	(meta . ((interfaces . (text-interface font-interface mark-interface side-position-interface))))
@@ -433,8 +430,11 @@
 	(Y-offset-callbacks . (,Staff_symbol_referencer::callback))
 	(staff-position . 0)
 	(expand-limit . 10)
+	(number-threshold . 0)
+	(padding . 1)
 	(thickness . 6.6)
 	(font-family . number)
+	(padding . 1)
 	(meta . ((interfaces . (multi-measure-rest-interface rest-interface font-interface staff-symbol-referencer-interface))))
 	))
 
diff --git a/scm/grob-property-description.scm b/scm/grob-property-description.scm
index 3d64f306ff..7e6fca5c61 100644
--- a/scm/grob-property-description.scm
+++ b/scm/grob-property-description.scm
@@ -68,6 +68,7 @@ In the case of alignment grobs, this should contain only one number.")
 (grob-property-description 'bass list? " musical-pitch, optional.")
 (grob-property-description 'beam ly-grob? "pointer to the beam, if applicable.")
 (grob-property-description 'beam-thickness number? "thickness, measured in staffspace.")
+(grob-property-description 'beam-space (or number? list?) "the vertical distance between two beams, indexed by multiplicity")
 (grob-property-description 'beam-width number? "width of the tremolo sign.")
 (grob-property-description 'beamed-lengths list? "list of stem lengths given beam multiplicity .")
 (grob-property-description 'beamed-minimum-lengths list? "list of minimum stem lengths given beam multiplicity.")
@@ -256,6 +257,8 @@ FIXME: also pair? (cons LEFT RIGHT)
 (grob-property-description 'non-default boolean? "not set because of existence of a bar?.")
 (grob-property-description 'note-width number? "unit for horizontal translation, measured in staff-space.")
 (grob-property-description 'note-heads list? "List of note head grobs")
+(grob-property-description 'number-gap number? "size of the gap for tohe number in a tuplet.")
+(grob-property-description 'number-threshold number? "only put numbers bigger than this threshold over multi measuer rest.")
 (grob-property-description 'old-accidentals list? "list of (pitch, accidental) pairs.")
 (grob-property-description 'padding number? "add this much extra space between objects that are next to each other.")
 (grob-property-description 'paren-cautionaries boolean? "Whether to add parenthesis around cautionary accidentals.")
-- 
2.39.5