From: handa Date: Wed, 14 Jul 2004 05:12:07 +0000 (+0000) Subject: (compose_glyph_string): Be sure to set codes for glyphs X-Git-Tag: REL-1-1-0~109 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=b837938c583195514058f63d7ccd94531858f267;p=m17n%2Fm17n-lib.git (compose_glyph_string): Be sure to set codes for glyphs of type GLYPH_SPACE. --- diff --git a/src/draw.c b/src/draw.c index a4123b7..f4003eb 100644 --- a/src/draw.c +++ b/src/draw.c @@ -302,10 +302,9 @@ compose_glyph_string (MFrame *frame, MText *mt, int from, int to, || MGLYPH (last)->type != g_tmp.type) { g = MGLYPH (last); - if (g->type == GLYPH_CHAR) - while (g < gstring->glyphs + gstring->used) - g = mface__for_chars (script, language, charset, - g, gstring->glyphs + gstring->used, size); + while (g < gstring->glyphs + gstring->used) + g = mface__for_chars (script, language, charset, + g, gstring->glyphs + gstring->used, size); if (pos == to) break; last = gstring->used; @@ -353,14 +352,17 @@ compose_glyph_string (MFrame *frame, MText *mt, int from, int to, if ((c <= 32 || c == 127) && g_tmp.type == GLYPH_CHAR) { - g_tmp.c = '^'; - APPEND_GLYPH (gstring, g_tmp); - if (c < ' ') - g_tmp.c = c + 0x40; - else - g_tmp.c = '?'; + MGlyph ctrl[2]; + + ctrl[0] = ctrl[1] = g_tmp; + ctrl[0].c = '^'; + ctrl[1].c = c < ' ' ? c + 0x40 : '?'; + mface__for_chars (Mlatin, language, charset, ctrl, ctrl + 2, size); + APPEND_GLYPH (gstring, ctrl[0]); + APPEND_GLYPH (gstring, ctrl[1]); } - APPEND_GLYPH (gstring, g_tmp); + else + APPEND_GLYPH (gstring, g_tmp); if (c == '\n' && gstring->control.two_dimensional) break; @@ -2662,7 +2664,10 @@ mdraw_glyph_list (MFrame *frame, MText *mt, int from, int to, { info->from = g->pos; info->to = g->to; - info->glyph_code = (g->type == GLYPH_CHAR ? g->code : 0); + if (g->type == GLYPH_CHAR) + info->glyph_code = g->code; + else + info->glyph_code = mfont__encode_char (g->rface->rfont, ' '); info->x = g->xoff; info->y = g->yoff; info->this.x = g->lbearing;