+LY_DEFINE (ly_otf_font_table_data, "ly:otf-font-table-data", 2, 0, 0,
+ (SCM font, SCM tag),
+ "Extract a table @var{tag} from @var{font}. Return empty string"
+ " for non-existent @var{tag}.")
+{
+ 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");
+ LY_ASSERT_TYPE (scm_is_string, tag, 2);
+
+ char ctag [5] = " ";
+
+ string tag_string = ly_scm2string (tag);
+ strncpy (ctag, tag_string.c_str (), tag_string.length ());
+
+ string tab = otf->get_otf_table (string (ctag));