- Dictionary<SCM> option_dict;
- if (gh_pair_p (word))
- {
- SCM options = gh_cdr (word);
- word = gh_car (word);
- while (gh_pair_p (options))
- {
- SCM option = gh_car (options);
- if (option != SCM_UNDEFINED && option != SCM_BOOL_F
- && gh_pair_p (option))
- {
- SCM key = gh_car (option);
- SCM val = gh_cdr (option);
- String k;
- if (gh_symbol_p (key))
- k = ly_symbol2string (key);
- else if (gh_string_p (key))
- k = ly_scm2string (key);
- else
- continue;
- option_dict[k] = val;
- }
- options = gh_cdr (options);
- }
- }
- 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 ());