]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/framework-ps.scm (write-preamble): use it to pick exactly
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 21 Jan 2006 00:14:10 +0000 (00:14 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 21 Jan 2006 00:14:10 +0000 (00:14 +0000)
the right font from a Mac dfont.

* lily/ttf.cc (LY_DEFINE): ly:ttf-ps-name: new routine to extract
PS name from TTF font.

* input/regression/tie-manual.ly: document new feature.

* Documentation/topdocs/NEWS.tely (Top): add tie NEWS.

* VERSION (MY_PATCH_LEVEL): bump to .28

* Documentation/user/basic-notation.itely (Ties): add tie examples
refs.

* lily/tie-formatting-problem.cc (score_ties_configuration):
symmetry penalties for outer ties.

13 files changed:
ChangeLog
Documentation/topdocs/NEWS.tely
Documentation/user/basic-notation.itely
VERSION
input/regression/tie-manual.ly
lily/include/tie-formatting-problem.hh
lily/tie-formatting-problem.cc
lily/tie-helper.cc
lily/tie.cc
lily/ttf.cc
scm/define-grob-properties.scm
scm/define-grobs.scm
scm/framework-ps.scm

index 742d8a559eb0e7a9f72c4a953a2f1d811564b1e4..a7d758b776eb0590d0a14e04e8169f43c2682ad6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,30 @@
+2006-01-21  Han-Wen Nienhuys  <hanwen@xs4all.nl>
+
+       * scm/framework-ps.scm (write-preamble): use it to pick exactly
+       the right font from a Mac dfont.
+
+       * lily/ttf.cc (LY_DEFINE): ly:ttf-ps-name: new routine to extract
+       PS name from TTF font.
+
+       * input/regression/tie-manual.ly: document new feature.
+
+       * Documentation/topdocs/NEWS.tely (Top): add tie NEWS.
+
+       * VERSION (MY_PATCH_LEVEL): bump to .28
+
+       * Documentation/user/basic-notation.itely (Ties): add tie examples
+       refs.
+
+       * lily/tie-formatting-problem.cc (score_ties_configuration):
+       symmetry penalties for outer ties.
+
 2006-01-20  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
-       * lily/tie-formatting-problem.cc (generate_configuration): 
+       * lily/tie-formatting-problem.cc (generate_configuration) 
+       (set_manual_tie_configuration): skip non-pair manual
+       tie-configuration, so you can set individual ties as
+
+         #'tie-configuration = #'((7 . 1) #t (-3 . 1))
 
        * input/regression/tie-chord.ly: use generateTiePattern to
        simplify file.
index a72abdfeaf2d529f5a850756bfce963c78cb2bba..fdac7658575416cf1ca3c250fe1d55cc3926e4bf 100644 (file)
@@ -47,6 +47,12 @@ the @uref{../,LilyPond Documentation}
 
 @itemize @bullet
 
+@item The tie formatting for chords has been further polished. More
+cases are handled gracefully, and all scoring parameters may now be
+changed through the @code{details} property of the @code{Tie} grob.
+
+This refinement was sponsored by Steve Doonan.
+
 @item Positions of staff lines may now be set individually, for
 example
 
@@ -412,7 +418,7 @@ specify tie formatting
   <a c d f> ~ <a c d f>
   
   \override TieColumn #'tie-configuration =
-  #'((0 . -1)  (2 . -1) (5.5 . 1) (7 . 1))
+  #'((0 . -1) '() (5.5 . 1) (7 . 1))
   <b d f g> ~ <b d f g>
 @end lilypond
 
index 473c2b0e5f95f33ea41d337be39a4c92975cb7a2..7c342db00ea4437a12d441898dd34b2baaa6dcc1 100644 (file)
@@ -1528,6 +1528,12 @@ In this manual: @ref{Automatic note splitting}.
 
 Program reference: @internalsref{Tie}.
 
+Examples:
+@inputfileref{input/@/regression,tie-arpeggio.ly}
+@inputfileref{input/@/regression,tie-manual.ly}
+
+
+
 
 @refbugs
 
diff --git a/VERSION b/VERSION
index 14c743e705f7cab92d2d12e55547c70eb764bc54..4453cfda2d74c44dfda462c6bc99d732a01a4f1d 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,6 +1,6 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=2
 MINOR_VERSION=7
-PATCH_LEVEL=27
+PATCH_LEVEL=28
 MY_PATCH_LEVEL=
 
index c8d8d9dc89eea8252dc1304e2aa0a9fa4e8a07a8..6311da666036e293227866720ff282109b96ed08 100644 (file)
@@ -2,7 +2,12 @@
 
   texidoc = "Tie formatting may be adjusted manually, by setting the
 @code{tie-configuration} property. The override should be placed at
-the second note of the chord."
+the second note of the chord.
+
+You can leave a Tie alone by introducing a non-pair value
+(eg. @code{#t}) in the @code{tie-configuration} list.
+
+"
 
 }
 
index f311ef682cf9674d57aa00ff8571cb18cd9846ec..01b44cbef494532a9ba2d44cb0b8eaaca5a5af6f 100644 (file)
@@ -41,7 +41,9 @@ struct Tie_details
   Real horizontal_distance_penalty_factor_;
   Real vertical_distance_penalty_factor_;
   Real intra_space_threshold_;
-  
+  Real outer_tie_length_symmetry_penalty_factor_;
+  Real outer_tie_vertical_distance_symmetry_penalty_factor_;
+
   Grob *staff_symbol_referencer_;
   
   Tie_details ();
index f9d92bf61699ff029d660d6ac530a63f8d5b5b18..c0c31a31acb13fbe557efb008c1901b72d234b00 100644 (file)
@@ -323,7 +323,13 @@ Tie_formatting_problem::generate_configuration (int pos, Direction dir) const
   if (!conf->delta_y_)
     {
       /*
-       TODO: make sliding criterion?  
+       TODO:
+
+       - should make sliding criterion, should flatten ties if
+
+       - they're just the wrong (ie. touching line at top & bottom)
+       size.
+       
        */
       if (h < details_.intra_space_threshold_ * 0.5 * details_.staff_space_)
        {
@@ -550,7 +556,6 @@ Tie_formatting_problem::score_ties_configuration (Ties_configuration const &ties
       score += score_configuration (ties[i]);
     }
 
-
   Real last_edge = 0.0;
   Real last_center = 0.0;
   for (int i = 0; i < ties.size (); i++)
@@ -583,6 +588,19 @@ Tie_formatting_problem::score_ties_configuration (Ties_configuration const &ties
       last_center = center;
     }
 
+
+  score +=
+    details_.outer_tie_length_symmetry_penalty_factor_
+    * fabs (ties[0].attachment_x_.length () - ties.top().attachment_x_.length ());
+  
+  score +=
+    details_.outer_tie_vertical_distance_symmetry_penalty_factor_
+    * (fabs (specifications_[0].position_
+            - (ties[0].position_ * 0.5 * details_.staff_space_ + ties[0].delta_y_))
+       -
+       fabs (specifications_.top ().position_
+            - (ties.top().position_ * 0.5 * details_.staff_space_ + ties.top().delta_y_)));
+  
   return score;
 }
 
@@ -789,22 +807,21 @@ Tie_formatting_problem::set_manual_tie_configuration (SCM manual_configs)
        scm_is_pair (s) && k < specifications_.size(); s = scm_cdr (s))
     {
       SCM entry = scm_car (s);
-      if (!scm_is_pair (entry))
-       continue;
-
-      Tie_specification &spec = specifications_[k];
-
-      if (scm_is_number (scm_cdr (entry)))
+      if (scm_is_pair (entry))
        {
-         spec.has_manual_dir_ = true;
-         spec.manual_dir_ = Direction (scm_to_int (scm_cdr (entry)));
-       }
-      if (scm_is_number (scm_car (entry)))
-       {
-         spec.has_manual_position_ = true;
-         spec.manual_position_ = scm_to_double (scm_car (entry));
-       }
-         
+         Tie_specification &spec = specifications_[k];
+
+         if (scm_is_number (scm_cdr (entry)))
+           {
+             spec.has_manual_dir_ = true;
+             spec.manual_dir_ = Direction (scm_to_int (scm_cdr (entry)));
+           }
+         if (scm_is_number (scm_car (entry)))
+           {
+             spec.has_manual_position_ = true;
+             spec.manual_position_ = scm_to_double (scm_car (entry));
+           }
+       }         
       k ++;
     }
 }
index 2e3f4b826cfefa7f2afca6de29a1fdf9ca771c4d..66afbc42298ba813e5eb645e90732e1dec201cd5 100644 (file)
@@ -52,6 +52,9 @@ Tie_details::from_grob (Grob *me)
   horizontal_distance_penalty_factor_ = get_real_detail ("horizontal-distance-penalty-factor", 5);
   vertical_distance_penalty_factor_ = get_real_detail ("vertical-distance-penalty-factor", 5);
   intra_space_threshold_ = get_real_detail ("intra-space-threshold", 1.0);
+  outer_tie_length_symmetry_penalty_factor_ = get_real_detail ("outer-tie-length-symmetry-penalty-factor", 3.0);
+  outer_tie_vertical_distance_symmetry_penalty_factor_ = get_real_detail ("outer-tie-vertical-distance-symmetry-penalty-factor", 3.0);
+  
 }
 
 Tie_details::Tie_details ()
index e67ed6b3e15edb68769461dbe2f719a8f1142672..9cf7468d6c8544054c6a80a465580c83c2cf8d83 100644 (file)
@@ -242,7 +242,7 @@ Tie::print (SCM smob)
 ADD_INTERFACE (Tie,
               "tie-interface",
               
-              "A tie connecting two noteheads. \n\n"
+              "A horizontal curve connecting two noteheads. \n\n"
               ,
               
 
@@ -254,7 +254,7 @@ ADD_INTERFACE (Tie,
               "details "
               "direction "
               "thickness "
-              "x-gap ");
+              );
 
 
 
index 1c6f7881798a59430ac2040bd37e04214123f643..14d58411f7e0693a0b0b9367da6af3b37e5e5ef4 100644 (file)
@@ -161,6 +161,25 @@ create_type42_font (void *out, String name)
   print_trailer (out, face);
 }
 
+LY_DEFINE (ly_ttf_ps_name, "ly:ttf-ps-name",
+          1, 0, 0, (SCM ttf_file_name),
+          "Extract the PostScript name from a TrueType font.")
+{
+  SCM_ASSERT_TYPE (scm_is_string (ttf_file_name), ttf_file_name,
+                  SCM_ARG1, __FUNCTION__, "string");
+  String file_name = ly_scm2string (ttf_file_name);
+  if (be_verbose_global)
+    progress_indication ("[" + file_name);
+
+  FT_Face face = open_ft_face (file_name);
+  char const *ps_name_str0 = FT_Get_Postscript_Name (face);
+  
+  if (be_verbose_global)
+    progress_indication ("]");
+
+  return scm_makfrom0str (ps_name_str0 ? ps_name_str0 : "");
+}
+
 LY_DEFINE (ly_ttf_to_pfa, "ly:ttf->pfa",
           1, 0, 0, (SCM ttf_file_name),
           "Convert the contents of a TTF file to Type42 PFA, returning it as "
index 21afb9af586ada434e8a27d9a6351176898efc9a..53ad479a5a076ca60b02e6d5c8803a11ca7a2ed0 100644 (file)
@@ -423,7 +423,8 @@ use LEFT.")
      (threshold ,number-pair? "(@var{min} . @var{max}), where
 @var{min} and @var{max} are dimensions in staff space.")
      (tie-configuration ,list? "List of (@var{position} . @var{dir})
-pairs, indicating the desired tie configuration.")
+pairs, indicating the desired tie configuration. A non-pair entry in
+the list will cause said tie to be formatted automatically. ")
      (transparent ,boolean? "This makes the grob invisible.")
      (uniform-stretching ,boolean? "If set, items stretch proportional
 to their durations. This looks better in complex polyphonic patterns")
@@ -432,7 +433,6 @@ to their durations. This looks better in complex polyphonic patterns")
 happen?")
      (word-space ,ly:dimension? "space to insert between words in texts.")
      (width ,ly:dimension? "The width of a grob measured in staff space.")
-     (x-gap ,ly:dimension? "The horizontal gap between note head and tie.")
      (zigzag-length ,ly:dimension? "The length of the lines of a
 zigzag, relative to @code{zigzag-width}. A value of 1 gives 60-degree
 zigzags.")
index 4eba1d8e238224cd3d41a62878c390f5c9887186..2284709184233e8e4eb2bd47aef7b7355cc8cd8a 100644 (file)
      . (
        (X-extent . #f)
        (Y-extent . #f)
-
        (positioning-done . ,Laissez_vibrer_tie_column::calc_positioning_done)
-       
        (meta . ((class . Item)
                 (interfaces . (laissez-vibrer-tie-column-interface))
                 ))
        (avoid-slur . inside)
        (direction . ,Tie::calc_direction)
        (stencil . ,Tie::print)
-       (details . ((ratio . 0.333)
+       (details . (
+                   ;; for a full list, see tie-helper.cc
+                   (ratio . 0.333)
                    (center-staff-line-clearance . 0.6)
                    (tip-staff-line-clearance . 0.45)
                    (note-head-gap . 0.2)
                    (tie-tie-collision-distance . 0.45) 
                    (tie-tie-collision-penalty . 25.0)
                    (intra-space-threshold . 1.25)
+                   (outer-tie-vertical-distance-symmetry-penalty-factor . 10)
+                   (outer-tie-length-symmetry-penalty-factor . 10)
                    (between-length-limit . 1.0)))
        (thickness . 1.0)
        (meta . ((class . Spanner)
index 54f0f1c7a25ffdf0095956bc9db23191fa104a43..d2092c8d67539123c9459ff91fa06386a7bace45 100644 (file)
         (status 0)
         (embed #f))
 
-
       (mkdir dir-name #o700)
-
       (set! status (ly:system
                    (format "cd ~a && fondu -force '~a'" dir-name filename)))
       
       (for-each
        (lambda (f)
         (if (and (not embed)
-                 (string-match (string-append name "\\.") f))
+                 (equal? name (ly:ttf-ps-name f)))
             (set! embed
                   (font-file-as-ps-string name (dir-join dir-name f))))
-            
+        
         (if (or (equal? "." f) 
                 (equal? ".." f))
             #t