- Molecule acc = paper_l ()->lookup_l (-3)->afm_find
- (String ("accidentals-") + to_str (p.accidental_i_));
- // urg, howto get a good superscript_y?
- Real super_y = lookup_l ()->text ("", "x", paper_l ()).extent
- ()[Y_AXIS].length () / 2;
- super_y += -acc.extent ()[Y_AXIS][MIN];
- acc.translate_axis (super_y, Y_AXIS);
- mol.add_at_edge (X_AXIS, RIGHT, acc, 0.0);
- }
-
- return mol;
-}
-
-Musical_pitch
-diff_pitch (Musical_pitch tonic, Musical_pitch p)
-{
- Musical_pitch diff (p.notename_i_ - tonic.notename_i_,
- p.accidental_i_ - tonic.accidental_i_,
- p.octave_i_ - tonic.octave_i_);
-
- while (diff.notename_i_ >= 7)
- {
- diff.notename_i_ -= 7;
- diff.octave_i_ ++;
- }
- while (diff.notename_i_ < 0)
- {
- diff.notename_i_ += 7;
- diff.octave_i_ --;
- }
-
- diff.accidental_i_ -= (tonic.semitone_pitch () + diff.semitone_pitch ())
- - p.semitone_pitch ();
-
- return diff;
-}
-
-/*
- JUNKME
- */
-bool
-Chord_name::user_chord_name (Array<Musical_pitch> pitch_arr, Chord_mol* name_p) const
-{
- Array<Musical_pitch> chord_type = pitch_arr;
- Chord::rebuild_transpose (&chord_type, diff_pitch (pitch_arr[0], Musical_pitch (0)), false);
-
- SCM chord = SCM_EOL;
- for (int i= chord_type.size (); i--; )
- chord = gh_cons (chord_type[i].to_scm (), chord);
-
-
- SCM name = scm_eval (gh_list (ly_symbol2scm ("user-chord-name"),
- ly_quote_scm (chord),
- SCM_UNDEFINED));
- if (gh_pair_p (name))
- {
- name_p->modifier_mol = ly_text2molecule (gh_car (name));
- name_p->addition_mol = ly_text2molecule (gh_cdr (name));
- return true;
- }
- return false;
-}
-
-void
-Chord_name::banter (Array<Musical_pitch> pitch_arr, Chord_mol* name_p) const
-{
- Array<Musical_pitch> add_arr;
- Array<Musical_pitch> sub_arr;
- Chord::find_additions_and_subtractions (pitch_arr, &add_arr, &sub_arr);
-
- Array<Musical_pitch> scale;
- for (int i=0; i < 7; i++)
- scale.push (Musical_pitch (i));
+ /*
+ UGH. Should read from font metric structure.
+ */
+ Real ex = me->lookup_l ()->text ("", "x",
+ me->paper_l ()).extent (Y_AXIS).length ();
+ Real em = me->lookup_l ()->text ("", "m",
+ me->paper_l ()).extent (X_AXIS).length ();