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-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.
@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
<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
Program reference: @internalsref{Tie}.
+Examples:
+@inputfileref{input/@/regression,tie-arpeggio.ly}
+@inputfileref{input/@/regression,tie-manual.ly}
+
+
+
@refbugs
PACKAGE_NAME=LilyPond
MAJOR_VERSION=2
MINOR_VERSION=7
-PATCH_LEVEL=27
+PATCH_LEVEL=28
MY_PATCH_LEVEL=
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.
+
+"
}
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 ();
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_)
{
score += score_configuration (ties[i]);
}
-
Real last_edge = 0.0;
Real last_center = 0.0;
for (int i = 0; i < ties.size (); i++)
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;
}
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 ++;
}
}
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 ()
ADD_INTERFACE (Tie,
"tie-interface",
- "A tie connecting two noteheads. \n\n"
+ "A horizontal curve connecting two noteheads. \n\n"
,
"details "
"direction "
"thickness "
- "x-gap ");
+ );
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 "
(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")
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.")
. (
(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)
(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