From: handa Date: Sun, 16 Sep 2007 11:01:04 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=874557fa6f54bf924a35fe9e50ea0929a76baa24;p=m17n%2Fm17n-test.git *** empty log message *** --- diff --git a/find-flt.c b/find-flt.c index 7c67c9d..c256d12 100644 --- a/find-flt.c +++ b/find-flt.c @@ -12,27 +12,19 @@ otf_tag (char *p) return (i < 4 ? 0 : tag); } - - int main (int argc, char **argv) { - MFLTGlyphString gstring; - MFLTGlyph g; + int c; MFLT *flt; M17N_INIT (); - gstring.glyph_size = sizeof (MFLTGlyph); - gstring.glyphs = &g; - gstring.allocated = gstring.used = 1; - gstring.script = otf_tag ("deva"); - gstring.langsys = 0; - - g.c = 0x915; - flt = mflt_find (&gstring, 0, NULL, NULL); + c = 0x915; + flt = mflt_find (c, NULL); if (! flt) exit (1); + printf ("%s\n", mflt_name (flt)); M17N_FINI (); exit (0); } diff --git a/flt.c b/flt.c index 70e6abe..5756bd3 100644 --- a/flt.c +++ b/flt.c @@ -119,7 +119,7 @@ struct _MFLTFont { int x_ppem, y_ppem; void (*get_glyph_id) (void); - void (*get_metric) (void); + void (*get_metrics) (void); void (*suitable_p) (void); void (*drive_otf) (void); MFont *font; @@ -127,7 +127,7 @@ struct _MFLTFont }; void get_glyph_id (void) {} -void get_metric (void) {} +void get_metrics (void) {} void suitable_p (void) {} void drive_otf (void) {} @@ -194,7 +194,7 @@ get_glyph_id (MFLTFont *font, MFLTGlyphString *gstring, int from, int to) } int -get_metric (MFLTFont *font, MFLTGlyphString *gstring, int from, int to) +get_metrics (MFLTFont *font, MFLTGlyphString *gstring, int from, int to) { FT_Face face = ((FontInfo *) font)->face; @@ -384,7 +384,11 @@ drive_otf (MFLTFont *font, MFLTOtfSpec *spec, g->c = in->glyphs[j].c; break; } - g->code = otfg->glyph_id; + if (g->code != otfg->glyph_id) + { + g->code = otfg->glyph_id; + g->measured = 0; + } out->used++; } } @@ -396,8 +400,6 @@ drive_otf (MFLTFont *font, MFLTOtfSpec *spec, out->glyphs[out->used++] = in->glyphs[from + i]; } - font->get_metric (font, out, gidx, out->used); - if (gpos_features) { FT_Face face; @@ -502,7 +504,7 @@ drive_otf (MFLTFont *font, MFLTOtfSpec *spec, return to; simple_copy: - font->get_metric (font, in, from, to); + font->get_metrics (font, in, from, to); for (i = 0; i < len; i++) { MFLTGlyph *g = in->glyphs + (from + i); @@ -912,7 +914,11 @@ drive_otf (MFLTFont *font, MFLTOtfSpec *spec, out->glyphs[out->used] = in->glyphs[hg->cluster]; g = out->glyphs + out->used++; if (g->code != hg->gindex) - g->c = 0, g->code = hg->gindex; + { + g->c = 0; + g->code = hg->gindex; + g->measured = 0; + } adjustment[i].set = gpos_applied; if (gpos_applied) { @@ -1029,7 +1035,7 @@ get_glyph_id (MFLTFont *font, MFLTGlyphString *gstring, int from, int to) #define PANGO_SCALE_TO_26_6 (PANGO_SCALE / (1<<6)) int -get_metric (MFLTFont *font, MFLTGlyphString *gstring, int from, int to) +get_metrics (MFLTFont *font, MFLTGlyphString *gstring, int from, int to) { FontInfoPango *font_info = (FontInfoPango *) font; int i; @@ -1199,7 +1205,11 @@ drive_otf (MFLTFont *font, MFLTOtfSpec *spec, out->glyphs[out->used] = in->glyphs[glyphs->log_clusters[i]]; g = out->glyphs + out->used++; if (g->code != glyph_info->glyph) - g->c = 0, g->code = glyph_info->glyph; + { + g->c = 0; + g->code = glyph_info->glyph; + g->measured = 0; + } g->xoff = glyph_info->geometry.x_offset / PANGO_SCALE_TO_26_6; g->yoff = glyph_info->geometry.y_offset / PANGO_SCALE_TO_26_6; g->xadv = glyph_info->geometry.width / PANGO_SCALE_TO_26_6; @@ -1366,7 +1376,7 @@ main (int argc, char **argv) exit (1); } font->get_glyph_id = get_glyph_id; - font->get_metric = get_metric; + font->get_metrics = get_metrics; font->drive_otf = drive_otf; mt = mconv_decode_stream (msymbol ("utf-8"), stdin);