diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ftfont.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ftfont.c b/src/ftfont.c index 7edf7f142b6..e8ef6a4871f 100644 --- a/src/ftfont.c +++ b/src/ftfont.c | |||
| @@ -913,6 +913,15 @@ ftfont_get_bitmap (font, code, bitmap, bits_per_pixel) | |||
| 913 | 913 | ||
| 914 | if (FT_Load_Glyph (ft_face, code, load_flags) != 0) | 914 | if (FT_Load_Glyph (ft_face, code, load_flags) != 0) |
| 915 | return -1; | 915 | return -1; |
| 916 | bitmap->bits_per_pixel | ||
| 917 | = (ft_face->glyph->bitmap.pixel_mode == FT_PIXEL_MODE_MONO ? 1 | ||
| 918 | : ft_face->glyph->bitmap.pixel_mode == FT_PIXEL_MODE_GRAY ? 8 | ||
| 919 | : ft_face->glyph->bitmap.pixel_mode == FT_PIXEL_MODE_LCD ? 8 | ||
| 920 | : ft_face->glyph->bitmap.pixel_mode == FT_PIXEL_MODE_LCD_V ? 8 | ||
| 921 | : -1); | ||
| 922 | if (bitmap->bits_per_pixel < 0) | ||
| 923 | /* We don't suport that kind of pixel mode. */ | ||
| 924 | return -1; | ||
| 916 | bitmap->rows = ft_face->glyph->bitmap.rows; | 925 | bitmap->rows = ft_face->glyph->bitmap.rows; |
| 917 | bitmap->width = ft_face->glyph->bitmap.width; | 926 | bitmap->width = ft_face->glyph->bitmap.width; |
| 918 | bitmap->pitch = ft_face->glyph->bitmap.pitch; | 927 | bitmap->pitch = ft_face->glyph->bitmap.pitch; |