From: handa Date: Fri, 9 Nov 2007 11:59:59 +0000 (+0000) Subject: (ft_render): Fix handling of baseline_offset. X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f649f029321fb0922c54395a42b2bc884c6602d5;p=m17n%2Fm17n-lib.git (ft_render): Fix handling of baseline_offset. (ft_encapsulate): Set metrics in 26.6 fixed pixel. (ft_render): Check pixel_mode to determine anti_alias. --- diff --git a/src/font-ft.c b/src/font-ft.c index cd97ecf..6452b49 100644 --- a/src/font-ft.c +++ b/src/font-ft.c @@ -1749,6 +1749,7 @@ ft_render (MDrawWindow win, int x, int y, int i, j; MPointTable point_table[8]; int baseline_offset; + int pixel_mode = -1; if (from == to) return; @@ -1779,16 +1780,14 @@ ft_render (MDrawWindow win, int x, int y, int width, pitch; FT_Load_Glyph (ft_face, (FT_UInt) g->g.code, load_flags); + if (pixel_mode < 0) + pixel_mode = ft_face->glyph->bitmap.pixel_mode; yoff = y - ft_face->glyph->bitmap_top + g->g.yoff; bmp = ft_face->glyph->bitmap.buffer; width = ft_face->glyph->bitmap.width; pitch = ft_face->glyph->bitmap.pitch; - if (! gstring->anti_alias) - pitch *= 8; - if (width > pitch) - width = pitch; - if (gstring->anti_alias) + if (pixel_mode != FT_PIXEL_MODE_MONO) for (i = 0; i < ft_face->glyph->bitmap.rows; i++, bmp += ft_face->glyph->bitmap.pitch, yoff++) { @@ -1839,7 +1838,7 @@ ft_render (MDrawWindow win, int x, int y, } } - if (gstring->anti_alias) + if (pixel_mode != FT_PIXEL_MODE_MONO) { for (i = 1; i < 8; i++) if (point_table[i].p != point_table[i].points)