From: handa Date: Tue, 23 Mar 2004 00:57:42 +0000 (+0000) Subject: (xfont_render): If rface->rfont is null, draw a rectangle. X-Git-Tag: REL-1-0-2~19 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=17c3beea2ee4d42b600138a400e988589c6bc449;p=m17n%2Fm17n-lib.git (xfont_render): If rface->rfont is null, draw a rectangle. --- diff --git a/src/m17n-X.c b/src/m17n-X.c index c821e72..9218881 100644 --- a/src/m17n-X.c +++ b/src/m17n-X.c @@ -885,9 +885,7 @@ xfont_render (MDrawWindow win, int x, int y, MGlyphString *gstring, if (region) gc = set_region (rface->frame, gc, region); - XSetFont (display, gc, ((MXFontInfo *) (rface->rfont->info))->f->fid); - - if (from->code == MCHAR_INVALID_CODE) + if (! rface->rfont || from->code == MCHAR_INVALID_CODE) { int x0 = x; @@ -901,6 +899,7 @@ xfont_render (MDrawWindow win, int x, int y, MGlyphString *gstring, return; } + XSetFont (display, gc, ((MXFontInfo *) (rface->rfont->info))->f->fid); code = (XChar2b *) alloca (sizeof (XChar2b) * (to - from)); for (i = 0, g = from; g < to; i++, g++) {