Real vertical_offset_needed () const;
-
- SCM ugly_scm () const;
Bezier_bow (Array<Offset> points, Direction dir);
void calculate ();
Bezier get_curve () const;
class Lookup
{
public:
+ String font_name_;
+ Adobe_font_metric * afm_l_;
+
+
Lookup ();
Lookup (Lookup const&);
Molecule simple_bar (String s, Real w, Paper_def*) const;
Molecule afm_find (String, bool warn=true) const;
Molecule bar (String, Real height, Paper_def*) const;
- Molecule beam (Real, Real, Real) const;
- Molecule dashed_slur (Bezier, Real thick, Real dash) const;
- Molecule ledger_line (Interval) const;
- Molecule fill (Box b) const;
- Molecule filledbox (Box b) const;
Molecule accordion (SCM arg, Real interline_f) const;
- Molecule slur (Bezier controls, Real cthick, Real thick) const;
- Molecule text (String style, String text, Paper_def*) const;
- Molecule staff_brace (Real dy, int) const;
- Molecule staff_bracket (Real height, Paper_def* paper_l) const;
- Molecule volta (Real h, Real w, Real thick, bool vert_start, bool vert_end) const;
- Molecule special_time_signature (String, int,int, Paper_def*) const;
- Molecule time_signature (int n,int d, Paper_def*) const;
- String font_name_;
- Adobe_font_metric * afm_l_;
+ static Molecule frame (Box b, Real thick);
+ static Molecule slur (Bezier controls, Real cthick, Real thick) ;
+ static Molecule beam (Real, Real, Real) ;
+ static Molecule dashed_slur (Bezier, Real thick, Real dash) ;
+ static Molecule fill (Box b) ;
+ static Molecule filledbox (Box b) ;
+ static Molecule text (String style, String text, Paper_def*) ;
+ static Molecule staff_brace (Real dy, int) ;
+ static Molecule staff_bracket (Real height, Paper_def* paper_l) ;
};
#endif // LOOKUP_HH
{
public:
static int compare (Note_head * const &a, Note_head *const &b) ;
+
+ Molecule ledger_line (Interval) const;
protected:
virtual void do_pre_processing();
+/*
+ build a ledger line for small pieces.
+ */
+Molecule
+Note_head::ledger_line (Interval xwid) const
+{
+ Drul_array<Molecule> endings;
+ endings[LEFT] = lookup_l()->afm_find ("noteheads-ledgerending");
+ Molecule * e = &endings[LEFT];
+ endings[RIGHT] = *e;
+
+ Real thick = e->dim_[Y_AXIS].length();
+ Real len = e->dim_[X_AXIS].length () - thick;
+
+ Molecule total;
+ Direction d = LEFT;
+ do {
+ endings[d].translate_axis (xwid[d] - endings[d].dim_[X_AXIS][d], X_AXIS);
+ total.add_molecule (endings[d]);
+ } while ((flip(&d)) != LEFT);
+
+ Real xpos = xwid [LEFT] + len;
+
+ while (xpos + len + thick /2 <= xwid[RIGHT])
+ {
+ e->translate_axis (len, X_AXIS);
+ total.add_molecule (*e);
+ xpos += len;
+ }
+
+ return total;
+}
+
void
Note_head::do_pre_processing ()
Interval hd = out->dim_[X_AXIS];
Real hw = hd.length ()/4;
- Molecule ledger
- = lookup_l ()->ledger_line (Interval (hd[LEFT] - hw,
- hd[RIGHT] + hw));
+ Molecule ledger (ledger_line (Interval (hd[LEFT] - hw,
+ hd[RIGHT] + hw)));
int parity = abs(int (p)) % 2;
/*
should protect because smobify_self () might trigger GC.
*/
- element_property_alist_ = scm_protect_object (ly_deep_copy (s.element_property_alist_));
+ SCM onstack = ly_deep_copy (s.element_property_alist_);
+ element_property_alist_ = onstack;
output_p_ =0;
status_i_ = s.status_i_;
void
Score_element::do_smobify_self ()
{
- scm_unprotect_object (element_property_alist_); // ugh
}
SCM
#include "stem.hh"
#include "dimension-cache.hh"
#include "group-interface.hh"
+#include "atom.hh"
+
Volta_spanner::Volta_spanner ()
{
Real dx = half_staff_space;
Real w = spanner_length() - dx - get_broken_left_end_align ();
Real h = paper_l()->get_var ("volta_spanner_height");
- Molecule volta (lookup_l ()->volta (h, w, t, no_vertical_start, no_vertical_end));
+ Molecule volta;
+
+ Atom *at = new Atom(gh_list (ly_symbol2scm ("volta"),
+ gh_double2scm (h),
+ gh_double2scm (w),
+ gh_double2scm (t),
+ gh_int2scm (no_vertical_start),
+ gh_int2scm (no_vertical_end),
+ SCM_UNDEFINED));
+
+ volta.dim_[Y_AXIS] = Interval (- h/2, h/2);
+ volta.dim_[X_AXIS] = Interval (0, w);
+ volta.add_atom (at->self_scm_);
Molecule num (lookup_l ()->text ("volta",
ly_scm2string (get_elt_property("text")),