From: handa Date: Tue, 16 Mar 2004 23:20:47 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=edc900619f262e10d8b90a5d39bd7bd8e112f60c;p=m17n%2Fm17n-lib.git *** empty log message *** --- diff --git a/src/font-ft.c b/src/font-ft.c index 34bfea1..0733afe 100644 --- a/src/font-ft.c +++ b/src/font-ft.c @@ -467,7 +467,7 @@ ft_encode_char (MRealizedFont *rfont, int c, unsigned ignored) struct { int size, inc, used; MDrawPoint *points; -} point_table[7]; +} point_table[8]; static void ft_render (MDrawWindow win, int x, int y, @@ -501,7 +501,7 @@ ft_render (MDrawWindow win, int x, int y, ft_info = (MFTInfo *) rface->rfont->info; ft_face = ft_info->ft_face; - for (i = 0; i < 7; i++) + for (i = 0; i < 8; i++) MLIST_RESET (point_table + i); for (g = from; g < to; x += g++->width) @@ -509,7 +509,7 @@ ft_render (MDrawWindow win, int x, int y, FT_UInt code; unsigned char *bmp; MDrawPoint p; - int intensity = reverse ? 0 : 7; + int intensity; if (g->otf_encoded) code = g->code; @@ -517,40 +517,54 @@ ft_render (MDrawWindow win, int x, int y, code = FT_Get_Char_Index (ft_face, (FT_ULong) g->code); FT_Load_Glyph (ft_face, code, load_flags); bmp = ft_face->glyph->bitmap.buffer; - if (! gstring->control.anti_alias) + if (gstring->control.anti_alias) { for (i = 0; i < ft_face->glyph->bitmap.rows; i++, bmp += ft_face->glyph->bitmap.pitch) for (j = 0; j < ft_face->glyph->bitmap.width; j++) - if (bmp[j / 8] & (1 << (7 - (j % 8)))) - { - p.x = x + ft_face->glyph->bitmap_left + g->xoff + j; - p.y = y - ft_face->glyph->bitmap_top + g->yoff + i; - MLIST_APPEND1 (point_table + intensity - 1, points, p, - MERROR_FONT_FT); - } + { + intensity = bmp[j] >> 5; + if (intensity) + { + p.x = x + ft_face->glyph->bitmap_left + g->xoff + j; + p.y = y - ft_face->glyph->bitmap_top + g->yoff + i; + MLIST_APPEND1 (point_table + intensity, points, p, + MERROR_FONT_FT); + } + } } else { for (i = 0; i < ft_face->glyph->bitmap.rows; i++, bmp += ft_face->glyph->bitmap.pitch) for (j = 0; j < ft_face->glyph->bitmap.width; j++) - if (bmp[j]) - { - intensity = reverse ? (7 - (bmp[j] >> 5)) : (bmp[j] >> 5); - - p.x = x + ft_face->glyph->bitmap_left + g->xoff + j; - p.y = y - ft_face->glyph->bitmap_top + g->yoff + i; - MLIST_APPEND1 (point_table + intensity - 1, points, p, - MERROR_FONT_FT); - } + { + intensity = bmp[j / 8] & (1 << (7 - (j % 8))); + if (intensity) + { + p.x = x + ft_face->glyph->bitmap_left + g->xoff + j; + p.y = y - ft_face->glyph->bitmap_top + g->yoff + i; + MLIST_APPEND1 (point_table, points, p, + MERROR_FONT_FT); + } + } } } - for (i = 0; i < 7; i++) - if (point_table[i].used) - mwin__draw_points (frame, win, rface, i + 1, - point_table[i].points, point_table[i].used); + if (gstring->control.anti_alias) + { + for (i = 1; i < 8; i++) + if (point_table[i].used) + mwin__draw_points (frame, win, rface, reverse ? 7 - i : i, + point_table[i].points, point_table[i].used, + gstring->control.anti_alias); + } + else + { + mwin__draw_points (frame, win, rface, reverse ? 7 : 0, + point_table[0].points, point_table[0].used, + gstring->control.anti_alias); + } } @@ -589,7 +603,7 @@ mfont__ft_init () mfont__driver_list[MFONT_TYPE_FT] = &ft_driver; - for (i = 0; i < 7; i++) + for (i = 0; i < 8; i++) MLIST_INIT1 (point_table + i, points, 0x1000); return 0; diff --git a/src/internal-gui.h b/src/internal-gui.h index efd15df..bda0e20 100644 --- a/src/internal-gui.h +++ b/src/internal-gui.h @@ -238,7 +238,8 @@ extern void mwin__draw_box (MFrame *frame, MDrawWindow win, extern void mwin__draw_points (MFrame *frame, MDrawWindow win, MRealizedFace *rface, - int intensity, MDrawPoint *points, int num); + int intensity, MDrawPoint *points, int num, + int pixmap); extern void mwin__draw_bitmap (MFrame *frame, MDrawWindow win, MRealizedFace *rface, int reverse,