if (! face)
return NULL;
font_info = malloc (sizeof (FontInfoOTF));
- font_info->font.get_glyph_id = get_glyph_id;
- font_info->font.get_metric = get_metric;
- font_info->font.drive_otf = drive_otf;
font_info->face = face;
font_info->otf = OTF_open_ft_face (face);
return ((MFLTFont *) font_info);
if (! face)
return NULL;
font_info = calloc (1, sizeof (FontInfoHB));
- font_info->font.get_glyph_id = get_glyph_id;
- font_info->font.get_metric = get_metric;
- font_info->font.drive_otf = drive_otf;
font_info->face = face;
font_info->hb_font.klass = &hb_fontClass;
font_info->hb_font.faceData = face;
get_glyph_id (MFLTFont *font, MFLTGlyph *g)
{
FontInfoPango *font_info = (FontInfoPango *) font;
- PangoGlyph glyph = pango_fc_font_get_glyph (font_info->pango_font, g->c);
- return (glyph ? (int) glyph : -1);
+ g->code = pango_fc_font_get_glyph (font_info->pango_font, g->c);
+ return (g->code ? 0 : -1);
}
int
}
}
+#ifndef PANGO_OT_DEFAULT_LANGUAGE
+#define PANGO_OT_DEFAULT_LANGUAGE ((guint) 0xFFFF)
+#endif
+#ifndef PANGO_OT_ALL_GLYPHS
+#define PANGO_OT_ALL_GLYPHS ((guint) 0xFFFF)
+#endif
+
void
setup_features (PangoOTTableType type, FontInfoPango *font_info,
MFLTOtfSpec *spec, FeatureInfo *info)
font_info->fontmap = fontmap;
font_info->context = context;
font_info->pango_font = PANGO_FC_FONT (pango_font);
+ font_info->otf_spec_cache = mplist ();
}
else
{
fprintf (stderr, "Font error: %s: %s\n", argv[1], err);
exit (1);
}
+ font->get_glyph_id = get_glyph_id;
+ font->get_metric = get_metric;
+ font->drive_otf = drive_otf;
mt = mconv_decode_stream (msymbol ("utf-8"), stdin);
len = mtext_len (mt);