From 915c58451431de16b55c0818da1dfec3d4604dba Mon Sep 17 00:00:00 2001 From: handa Date: Fri, 30 Apr 2004 05:25:22 +0000 Subject: [PATCH] (ft_list): Delete unused variable `result'. (ft_render): Fix for the case that bitmap.pitch < bitmap.width. --- src/font-ft.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/font-ft.c b/src/font-ft.c index 35a63a1..b1e092b 100644 --- a/src/font-ft.c +++ b/src/font-ft.c @@ -305,7 +305,6 @@ ft_list () char path[PATH_MAX]; DIR *dir = opendir (pathname); struct dirent *dp; - int result; if (dir) { @@ -630,6 +629,7 @@ ft_render (MDrawWindow win, int x, int y, int intensity; MPointTable *ptable; int xoff, yoff; + int width; if (g->otf_encoded) code = g->code; @@ -638,12 +638,16 @@ ft_render (MDrawWindow win, int x, int y, FT_Load_Glyph (ft_face, code, load_flags); yoff = y - ft_face->glyph->bitmap_top + g->yoff; bmp = ft_face->glyph->bitmap.buffer; + width = ft_face->glyph->bitmap.width; + if (ft_face->glyph->bitmap.pitch < ft_face->glyph->bitmap.width) + width = ft_face->glyph->bitmap.pitch; + if (gstring->anti_alias) for (i = 0; i < ft_face->glyph->bitmap.rows; i++, bmp += ft_face->glyph->bitmap.pitch, yoff++) { xoff = x + ft_face->glyph->bitmap_left + g->xoff; - for (j = 0; j < ft_face->glyph->bitmap.width; j++, xoff++) + for (j = 0; j < width; j++, xoff++) { intensity = bmp[j] >> 5; if (intensity) @@ -667,7 +671,7 @@ ft_render (MDrawWindow win, int x, int y, i++, bmp += ft_face->glyph->bitmap.pitch, yoff++) { xoff = x + ft_face->glyph->bitmap_left + g->xoff; - for (j = 0; j < ft_face->glyph->bitmap.width; j++, xoff++) + for (j = 0; j < width; j++, xoff++) { intensity = bmp[j / 8] & (1 << (7 - (j % 8))); if (intensity) -- 1.7.10.4