+
+LY_DEFINE (ly_otf_glyph_count, "ly:otf-glyph-count", 1, 0, 0,
+ (SCM font),
+ "Return the number of glyphs in @var{font}.")
+{
+ Modified_font_metric *fm
+ = dynamic_cast<Modified_font_metric *> (Font_metric::unsmob (font));
+ Open_type_font *otf = fm
+ ? dynamic_cast<Open_type_font *> (fm->original_font ())
+ : dynamic_cast<Open_type_font *> (Font_metric::unsmob (font));
+
+ SCM_ASSERT_TYPE (otf, font, SCM_ARG1, __FUNCTION__, "OpenType font");
+
+ return scm_from_int ((int) otf->count ());
+}
+
+LY_DEFINE (ly_otf_glyph_list, "ly:otf-glyph-list", 1, 0, 0,
+ (SCM font),
+ "Return a list of glyph names for @var{font}.")
+{
+ Modified_font_metric *fm
+ = dynamic_cast<Modified_font_metric *> (Font_metric::unsmob (font));
+ Open_type_font *otf = fm
+ ? dynamic_cast<Open_type_font *> (fm->original_font ())
+ : dynamic_cast<Open_type_font *> (Font_metric::unsmob (font));
+
+ SCM_ASSERT_TYPE (otf, font, SCM_ARG1, __FUNCTION__, "OpenType font");
+
+ return otf->glyph_list ();
+}