delete symtables_p_;
}
-Atom
-Lookup::accidental (int j) const
+Molecule
+Lookup::accidental (int j, bool cautionary) const
{
- return afm_find (String ("accidentals") + String ("-") + to_str (j));
+ Molecule m(afm_find (String ("accidentals") + String ("-") + to_str (j)));
+ if (cautionary)
+ {
+ m.add_at_edge(X_AXIS, LEFT,
+ Molecule(afm_find (String ("accidentals") + String ("-("))))
+;
+ m.add_at_edge(X_AXIS, RIGHT,
+ Molecule(afm_find (String ("accidentals") + String ("-)"))))
+;
+ }
+ return m;
}
void
}
Atom
-Lookup::afm_find (String s) const
+Lookup::afm_find (String s, bool warn) const
{
if (!afm_p_)
{
*mlog << "]" << flush ;
DOUT << this->afm_p_->str ();
}
- Adobe_font_char_metric m = afm_p_->find_char (s);
+ Adobe_font_char_metric m = afm_p_->find_char (s, warn);
Atom a;
if (m.code () < 0)
Array<Real> arr;
arr.push (m.code ());
a.lambda_ = (lambda_scm ("char", arr));
+ a.str_ = "afm_find: " + s;
a.font_ = font_;
return a;
}
arr.push (h);
Atom a = (*symtables_p_) ("bars")->lookup (str);
a.lambda_ = (lambda_scm (a.str_, arr));
+ a.str_ = "bar";
a.dim_.y () = Interval (-h/2, h/2);
a.font_ = font_;
return a;
Atom a;
a.lambda_ = (lambda_scm ("beam", arr));
+ a.str_ = "beam";
a.dim_[X_AXIS] = Interval (0, width);
a.dim_[Y_AXIS] = Interval (min_y, max_y);
return a;
gh_cons (ly_list2 (gh_double2scm (controls[0].x ()), gh_double2scm (controls[0].y ())),
SCM_EOL))))))))))));
+ a.str_ = "dashed_slur";
return a;
}
Lookup::flag (int j, Direction d) const
{
char c = (d == UP) ? 'u' : 'd';
- return afm_find (String ("flags") + String ("-") + to_str (c) + to_str (j));
+ Atom a = afm_find (String ("flags") + String ("-") + to_str (c) + to_str (j));
+ return a;
}
void
Atom
Lookup::rule_symbol (Real height, Real width) const
{
- Atom bs= (*symtables_p_) ("param")->lookup ("rule");
- Array<Real> args;
- args.push (height);
- args.push (width);
- bs.lambda_ = (lambda_scm (bs.str_, args));
- bs.dim_.x () = Interval (0, width);
- bs.dim_.y () = Interval (0, height);
- return bs;
+ Atom a = (*symtables_p_) ("param")->lookup ("rule");
+ Array<Real> arr;
+ arr.push (height);
+ arr.push (width);
+ a.lambda_ = (lambda_scm (a.str_, arr));
+ a.str_ = "rule_symbol";
+ a.dim_.x () = Interval (0, width);
+ a.dim_.y () = Interval (0, height);
+ return a;
}
Atom
}
Atom
-Lookup::special_time_signature (String s, Array<Real> arr) const
+Lookup::special_time_signature (String s, Array<int> arr) const
{
- String symbolname = "timesig-" + s;
- if (!arr.empty ())
- symbolname += to_str (arr[0]);
- if (arr.size () >1)
- symbolname += "/" + to_str (arr[1]);
+ // First guess: s contains only the signature style
+ assert (arr.size () >1);
+ String symbolname = "timesig-" + s + to_str (arr[0]) + "/" + to_str (arr[1]);
- Atom a = afm_find (symbolname);
+ Atom a = afm_find (symbolname, false);
if (!a.empty ())
return a;
-#if 0 //guess we covered this
- // Try if the full name was given
- a = afm_find ("timesig-"+s);
+ // Second guess: s contains the full signature name
+ a = afm_find ("timesig-"+s, false);
if (!a.empty ())
return a;
-#endif
// Resort to default layout with numbers
return time_signature (arr);
y1 = y2;
y2 = t;
}
- Atom s;
+ Atom a;
- s.dim_.x () = Interval (0,0);
- s.dim_.y () = Interval (y1,y2);
+ a.dim_.x () = Interval (0,0);
+ a.dim_.y () = Interval (y1,y2);
- Array<Real> a;
+ Array<Real> arr;
Real stem_width = paper_l_->get_var ("stemthickness");
- a.push (-stem_width /2);
- a.push (stem_width);
- a.push (y2);
- a.push (-y1);
+ arr.push (-stem_width /2);
+ arr.push (stem_width);
+ arr.push (y2);
+ arr.push (-y1);
- s.lambda_ = (lambda_scm ("stem", a));
- s.font_ = font_;
- return s;
+ a.lambda_ = (lambda_scm ("stem", arr));
+ a.str_ = "stem";
+ a.font_ = font_;
+ return a;
}
Atom
Atom
Lookup::text (String style, String text) const
{
- Array<Scalar> a;
+ Array<Scalar> arr;
- a.push (text);
- Atom s = (*symtables_p_) ("style")->lookup (style);
- s.lambda_ = (lambda_scm (s.str_, a));
- s.font_ = font_;
-
- return s;
+ arr.push (text);
+ Atom a = (*symtables_p_) ("style")->lookup (style);
+ a.lambda_ = lambda_scm (a.str_, arr);
+ a.str_ = "text";
+ a.font_ = font_;
+ return a;
+
}
+
Atom
-Lookup::time_signature (Array<Real> a) const
+Lookup::time_signature (Array<int> a) const
{
Atom s ((*symtables_p_) ("param")->lookup ("time_signature"));
s.lambda_ = (lambda_scm (s.str_, a));
Atom
Lookup::vbrace (Real &y) const
{
- Atom brace = (*symtables_p_) ("param")->lookup ( "brace");
- Interval ydims = brace.dim_[Y_AXIS];
+ Atom a = (*symtables_p_) ("param")->lookup ( "brace");
+ Interval ydims = a.dim_[Y_AXIS];
Real min_y = ydims[LEFT];
Real max_y = ydims[RIGHT];
Real step = 1.0 PT;
if (y < min_y)
{
warning (_ ("piano brace")
- + " " + _ ("too small") + " (" + print_dimen (y) + ")");
+ + " " + _ ("too small") + " (" + print_dimen (y) + ")");
y = min_y;
}
if (y > max_y)
{
warning (_ ("piano brace")
- + " " + _ ("too big") + " (" + print_dimen (y) + ")");
+ + " " + _ ("too big") + " (" + print_dimen (y) + ")");
y = max_y;
}
int idx = int (rint ( (y- min_y)/step)) + 1;
- Array<Real> a;
- a.push (idx);
- brace.lambda_ = (lambda_scm (brace.str_, a));
- brace.dim_[Y_AXIS] = Interval (-y/2,y/2);
-
- brace.font_ = font_;
-
- return brace;
+ Array<Real> arr;
+ arr.push (idx);
+ a.lambda_ = (lambda_scm (a.str_, arr));
+ a.str_ = "brace";
+ a.dim_[Y_AXIS] = Interval (-y/2,y/2);
+ a.font_ = font_;
+ return a;
}
Atom
Real height = paper_l_->staffheight_f () / 6;
String ps;
ps += to_str (width) + " "
- + to_str (height) + " "
+ + to_str (height) + " "
+ to_str (continued ? height/2 : 0) +
+ " draw_" + String (decresc ? "de" : "") + "cresc\n";
a.str_ = ps;
+ String_convert::int_str ( (int)dir) +
" draw_plet ";
- Atom s;
- s.str_ = ps;
- return s;
+ Atom a;
+ a.str_ = ps;
+ return a;
}
Atom
// (lambda (o) (slur o '((0.1 0.2) (1.1 1.2) (2.1 2.2) (3.1 3.2) .. )))
a.lambda_ = (
- ly_append (ly_lambda_o (),
- ly_list1 (ly_append (ly_func_o ("slur"),
- ly_list1 (ly_list2 (ly_quote (),
- gh_cons (ly_list2 (gh_double2scm (controls[5].x ()), gh_double2scm (controls[5].y ())),
- gh_cons (ly_list2 (gh_double2scm (controls[6].x ()), gh_double2scm (controls[6].y ())),
- gh_cons (ly_list2 (gh_double2scm (controls[7].x ()), gh_double2scm (controls[7].y ())),
- gh_cons (ly_list2 (gh_double2scm (controls[4].x ()), gh_double2scm (controls[4].y ())),
- gh_cons (ly_list2 (gh_double2scm (controls[1].x ()), gh_double2scm (controls[1].y ())),
- gh_cons (ly_list2 (gh_double2scm (controls[2].x ()), gh_double2scm (controls[2].y ())),
- gh_cons (ly_list2 (gh_double2scm (controls[3].x ()), gh_double2scm (controls[3].y ())),
- gh_cons (ly_list2 (gh_double2scm (controls[0].x ()), gh_double2scm (controls[0].y ())),
- SCM_EOL))))))))))))));
+ ly_append (ly_lambda_o (),
+ ly_list1 (ly_append (ly_func_o ("slur"),
+ ly_list1 (ly_list2 (ly_quote (),
+ gh_cons (ly_list2 (gh_double2scm (controls[5].x ()), gh_double2scm (controls[5].y ())),
+ gh_cons (ly_list2 (gh_double2scm (controls[6].x ()), gh_double2scm (controls[6].y ())),
+ gh_cons (ly_list2 (gh_double2scm (controls[7].x ()), gh_double2scm (controls[7].y ())),
+ gh_cons (ly_list2 (gh_double2scm (controls[4].x ()), gh_double2scm (controls[4].y ())),
+ gh_cons (ly_list2 (gh_double2scm (controls[1].x ()), gh_double2scm (controls[1].y ())),
+ gh_cons (ly_list2 (gh_double2scm (controls[2].x ()), gh_double2scm (controls[2].y ())),
+ gh_cons (ly_list2 (gh_double2scm (controls[3].x ()), gh_double2scm (controls[3].y ())),
+ gh_cons (ly_list2 (gh_double2scm (controls[0].x ()), gh_double2scm (controls[0].y ())),
+ SCM_EOL))))))))))))));
+ a.str_ = "slur";
a.dim_[X_AXIS] = Interval (0, dx);
a.dim_[Y_AXIS] = Interval (0 <? dy, 0 >? dy);
if (y < min_y)
{
warning (_ ("bracket")
- + " " + _ ("too small") + " (" + print_dimen (y) + ")");
-// y = min_y;
+ + " " + _ ("too small") + " (" + print_dimen (y) + ")");
+ // y = min_y;
}
Array<Real> arr;
arr.push (y);
a.lambda_ = (lambda_scm ("bracket", arr));
+ a.str_ = "vbracket";
a.dim_[Y_AXIS] = Interval (-y/2,y/2);
a.dim_[X_AXIS] = Interval (0,4 PT);
return a;