From: handa Date: Thu, 22 Nov 2007 12:05:31 +0000 (+0000) Subject: (ft_drive_otf): Fix setting of g->g.from and g->g.to. X-Git-Tag: REL-1-5-0~36 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=86644cc6b5216c6efc604f398129599ff7692e63;p=m17n%2Fm17n-lib.git (ft_drive_otf): Fix setting of g->g.from and g->g.to. --- diff --git a/src/font-ft.c b/src/font-ft.c index 1c59534..364d64c 100644 --- a/src/font-ft.c +++ b/src/font-ft.c @@ -2330,20 +2330,30 @@ ft_drive_otf (MFLTFont *font, MFLTOtfSpec *spec, { MGlyph *g = out_glyphs + out->used; int j; + int min_from, max_to; *g = in_glyphs[from + otfg->f.index.from]; + min_from = g->g.from, max_to = g->g.to; g->g.c = 0; - for (j = from + otfg->f.index.from; j <= from + otfg->f.index.to; j++) - if (in_glyphs[j].g.code == otfg->glyph_id) + for (j = otfg->f.index.from; j <= otfg->f.index.to; j++) + if (in_glyphs[from + j].g.code == otfg->glyph_id) { - g->g.c = in_glyphs[j].g.c; + g->g.c = in_glyphs[from + j].g.c; break; } + for (j = otfg->f.index.from + 1; j <= otfg->f.index.to; j++) + { + if (min_from > in_glyphs[from + j].g.from) + min_from = in_glyphs[from + j].g.from; + if (max_to < in_glyphs[from + j].g.to) + max_to = in_glyphs[from + j].g.to; + } if (g->g.code != otfg->glyph_id) { g->g.code = otfg->glyph_id; g->g.measured = 0; } + g->g.from = min_from, g->g.to = max_to; out->used++; } }