From 86644cc6b5216c6efc604f398129599ff7692e63 Mon Sep 17 00:00:00 2001 From: handa Date: Thu, 22 Nov 2007 12:05:31 +0000 Subject: [PATCH] (ft_drive_otf): Fix setting of g->g.from and g->g.to. --- src/font-ft.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) 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++; } } -- 1.7.10.4