-Font_interface::properties_to_font_name (SCM fonts, SCM alist_chain)
-{
- SCM shape = SCM_BOOL_F;
- SCM family = SCM_BOOL_F;
- SCM series = SCM_BOOL_F;
-
-
- SCM point_sz = ly_assoc_chain (design_sz_sym, alist_chain);
- SCM rel_sz = SCM_BOOL_F;
-
- shape = ly_assoc_chain (shape_sym, alist_chain);
- family = ly_assoc_chain (family_sym, alist_chain);
- series = ly_assoc_chain (series_sym, alist_chain);
-
- if (gh_pair_p (shape))
- shape = ly_cdr (shape);
- if (gh_pair_p (family))
- family = ly_cdr (family);
- if (gh_pair_p (series))
- series = ly_cdr (series);
-
-
- if (gh_pair_p (point_sz))
- point_sz = ly_cdr (point_sz);
- else
- {
- rel_sz = ly_assoc_chain (rel_sz_sym, alist_chain);
- if (gh_pair_p (rel_sz))
- rel_sz = ly_cdr (rel_sz);
- }
-
- for (SCM s = fonts ; gh_pair_p (s); s = ly_cdr (s))
- {
- SCM qlist = ly_caar (s);
-
- if (!wild_compare (scm_list_ref (qlist, gh_int2scm (1)), series))
- continue;
- if (!wild_compare (scm_list_ref (qlist, gh_int2scm (2)), shape))
- continue;
- if (!wild_compare (scm_list_ref (qlist, gh_int2scm (3)), family))
- continue;
-
- if (point_sz == SCM_BOOL_F && !wild_compare (ly_car (qlist), rel_sz))
- continue;
-
- SCM qname = ly_cdar (s);
- return qname;
- }
-
- warning (_ ("couldn't find any font satisfying "));
- scm_write (scm_list_n (point_sz, shape, series , family, rel_sz, SCM_UNDEFINED), scm_current_error_port ());
- scm_flush (scm_current_error_port ());
-
- return ly_str02scm ("cmr10");
-
-}
-
-
-
-ADD_INTERFACE (Font_interface, "font-interface",
- "Any symbol that is typeset through fixed sets of glyphs (ie. fonts)",
- "font-magnification font-style font font-series font-shape font-family font-name font-design-size font-relative-size");
+Font_interface::text_font_alist_chain (Grob *g)
+{
+ SCM defaults
+ = g->layout ()->lookup_variable (ly_symbol2scm ("text-font-defaults"));
+ if (defaults == SCM_UNDEFINED)
+ defaults = SCM_EOL;
+ return g->get_property_alist_chain (defaults);
+}
+
+ADD_INTERFACE (Font_interface,
+ "Any symbol that is typeset through fixed sets of glyphs, "
+ " (ie. fonts)",
+
+ "font "
+ "font-encoding "
+ "font-family "
+ "font-name "
+ "font-series "
+ "font-shape "
+ "font-size "
+ );