From: handa Date: Fri, 31 Aug 2007 14:53:19 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a85bd34569ff2afdab5b8d9adf11f4ba149daed9;p=m17n%2Fm17n-test.git *** empty log message *** --- diff --git a/flt.c b/flt.c index 4b4a4f0..dbf6c88 100644 --- a/flt.c +++ b/flt.c @@ -531,9 +531,6 @@ open_font (char *fontname, char **err) 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); @@ -955,9 +952,6 @@ open_font (char *fontname, char **err) 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; @@ -1027,9 +1021,9 @@ int 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 @@ -1054,6 +1048,13 @@ get_metric (MFLTFont *font, MFLTGlyphString *gstring, int from, int to) } } +#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) @@ -1234,6 +1235,7 @@ open_font (char *fontname, char **err) font_info->fontmap = fontmap; font_info->context = context; font_info->pango_font = PANGO_FC_FONT (pango_font); + font_info->otf_spec_cache = mplist (); } else { @@ -1297,6 +1299,9 @@ main (int argc, char **argv) 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);