From: handa Date: Tue, 10 Nov 2009 11:33:57 +0000 (+0000) Subject: (run_flt): Update category code of each glyph. X-Git-Tag: merge-to-XML~41 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=31b3f7a03ec2e6a1763922e1a4f7fe0ef950c9b1;p=m17n%2Fm17n-lib.git (run_flt): Update category code of each glyph. --- diff --git a/src/draw.c b/src/draw.c index f35d058..fc59bf9 100644 --- a/src/draw.c +++ b/src/draw.c @@ -278,6 +278,7 @@ run_flt (MGlyphString *gstring, int from, int to, MRealizedFace *rface) MFLT *flt; int from_pos = MGLYPH (from)->g.from; int len = to - from; + int catcode; int i; flt = mflt_get (layouter); @@ -308,7 +309,7 @@ run_flt (MGlyphString *gstring, int from, int to, MRealizedFace *rface) } if (from + len != to) gstring->used += to - (from + len); - for (i = from; i < to; i++) + for (i = from, catcode = -1; i < to; i++) { MGlyph *g = MGLYPH (i); @@ -323,6 +324,17 @@ run_flt (MGlyphString *gstring, int from, int to, MRealizedFace *rface) g->g.xoff >>= 6; g->g.yoff >>= 6; g->rface = rface; + if (catcode < 0 || g->g.from != g[-1].g.from) + { + MSymbol category = mchar_get_prop (g->g.c, Mcategory); + + catcode = (category == McatCf + ? GLYPH_CATEGORY_FORMATTER + : category != Mnil && MSYMBOL_NAME (category)[0] == 'M' + ? GLYPH_CATEGORY_MODIFIER + : GLYPH_CATEGORY_NORMAL); + } + g->category = catcode; } return to; }