+ char *nm_str = (char *) nm.c_str ();
+ if (FT_UInt idx = FT_Get_Name_Index (face_, nm_str))
+ return (size_t) idx;
+
+ return (size_t) -1;
+}
+
+size_t
+Open_type_font::index_to_charcode (size_t i) const
+{
+ map<FT_UInt, FT_ULong>::const_iterator iter;
+ iter = index_to_charcode_map_.find (FT_UInt (i));
+
+ if (iter != index_to_charcode_map_.end ())
+ return (size_t) iter->second;
+ else
+ {
+ programming_error ("Invalid index for character");
+ return 0;
+ }
+}
+
+size_t
+Open_type_font::count () const
+{
+ return index_to_charcode_map_.size ();
+}
+
+Real
+Open_type_font::design_size () const
+{
+ SCM entry = scm_hashq_ref (lily_global_table_,
+ ly_symbol2scm ("design_size"),
+
+ /*
+ Hmm. Design size is arbitrary for
+ non-design-size fonts. I vote for 1 -
+ which will trip errors more
+ quickly. --hwn.
+ */
+ scm_from_unsigned_integer (1));
+ return scm_to_double (entry) * Real (point_constant);
+}
+
+SCM
+Open_type_font::sub_fonts () const
+{
+ return lily_subfonts_;
+}
+
+SCM
+Open_type_font::get_char_table () const
+{
+ return lily_character_table_;
+}
+
+SCM
+Open_type_font::get_subfonts () const
+{
+ return lily_subfonts_;
+}
+
+SCM
+Open_type_font::get_global_table () const
+{
+ return lily_global_table_;
+}
+
+string
+Open_type_font::font_name () const
+{
+ return FT_Get_Postscript_Name (face_);
+}
+
+SCM
+Open_type_font::glyph_list () const
+{
+ SCM retval = SCM_EOL;
+ SCM *tail = &retval;
+
+ for (int i = 0; i < face_->num_glyphs; i++)
+ {
+ const size_t len = 256;
+ char name[len];
+ FT_Error code = FT_Get_Glyph_Name (face_, i, name, len);
+ if (code)
+ warning (_f ("FT_Get_Glyph_Name () error: %s",
+ freetype_error_string (code).c_str ()));
+
+ *tail = scm_cons (scm_from_locale_string (name), SCM_EOL);
+ tail = SCM_CDRLOC (*tail);
+ }
+
+ return retval;