# HG changeset patch # User Kenichi Handa # Date 1195448569 0 # Node ID 6da57551efb7ef1e88fe48473f14d01d7157407e # Parent 55753e191b466fd493f6a9159711ea240b4a8ae8 (ftfont_get_bitmap): Set bitmap->bits_per_pixel. diff -r 55753e191b46 -r 6da57551efb7 src/ftfont.c --- a/src/ftfont.c Sun Nov 18 14:52:50 2007 +0000 +++ b/src/ftfont.c Mon Nov 19 05:02:49 2007 +0000 @@ -913,6 +913,15 @@ if (FT_Load_Glyph (ft_face, code, load_flags) != 0) return -1; + bitmap->bits_per_pixel + = (ft_face->glyph->bitmap.pixel_mode == FT_PIXEL_MODE_MONO ? 1 + : ft_face->glyph->bitmap.pixel_mode == FT_PIXEL_MODE_GRAY ? 8 + : ft_face->glyph->bitmap.pixel_mode == FT_PIXEL_MODE_LCD ? 8 + : ft_face->glyph->bitmap.pixel_mode == FT_PIXEL_MODE_LCD_V ? 8 + : -1); + if (bitmap->bits_per_pixel < 0) + /* We don't suport that kind of pixel mode. */ + return -1; bitmap->rows = ft_face->glyph->bitmap.rows; bitmap->width = ft_face->glyph->bitmap.width; bitmap->pitch = ft_face->glyph->bitmap.pitch;