-
- /*
- UGH. Should read from font metric structure.
- */
- Real ex = lookup_l ()->text ("", "x", paper_l ()).extent(Y_AXIS).length ();
- if (gh_string_p (word))
- {
- String w = ly_scm2string (word);
- Molecule mol;
- Offset offset;
-
- int size = 0;
- if (option_dict.elem_b ("size"))
- size = gh_scm2int (option_dict["size"]);
-
- String style;
- if (option_dict.elem_b ("style"))
- style = ly_scm2string (option_dict["style"]);
-
- if (option_dict.elem_b ("type")
- && ly_scm2string (option_dict["type"]) == "super")
- {
- Real super_y = ex / 2;
- //super_y += -acc.extent (Y_AXIS)[MIN];
- offset = Offset (0, super_y);
- if (!size)
- size = -2;
- }
- if (option_dict.elem_b ("offset"))
- {
- // hmm
- SCM s = option_dict["offset"];
- if (gh_pair_p (s))
- offset = Offset (gh_scm2double (gh_car (s)),
- gh_scm2double (gh_cdr (s))) * ex;
- }
- if (option_dict.elem_b ("font")
- && ly_scm2string (option_dict["font"]) == "feta")
- mol = paper_l ()->lookup_l (size)->afm_find (w);
- else
- mol = paper_l ()->lookup_l (size)->text (style, w, paper_l ());
-
- mol.translate (offset);
- return mol;
- }
- return Molecule ();
-}
-
-/*
- ;; text: list of word
- ;; word: string + optional list of property
- ;; property: align, kern, font (?), size
- */
-Molecule
-Chord_name::ly_text2molecule (SCM text) const
-{
- Molecule mol;
- if (gh_list_p (text))
- {
- while (gh_cdr (text) != SCM_EOL)
- {
- Molecule m = ly_word2molecule (gh_car (text));
- if (!m.empty_b ())
- mol.add_at_edge (X_AXIS, RIGHT, m, 0);
- text = gh_cdr (text);
- }
- text = gh_car (text);
- }
- Molecule m = ly_word2molecule (text);
- if (!m.empty_b ())
- mol.add_at_edge (X_AXIS, RIGHT, m, 0);
- return mol;