From 17c3beea2ee4d42b600138a400e988589c6bc449 Mon Sep 17 00:00:00 2001 From: handa Date: Tue, 23 Mar 2004 00:57:42 +0000 Subject: [PATCH] (xfont_render): If rface->rfont is null, draw a rectangle. --- src/m17n-X.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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++) { -- 1.7.10.4