Commit b51e5112 authored by Kenichi Handa's avatar Kenichi Handa
Browse files

(ftfont_get_bitmap): Set bitmap->bits_per_pixel.

parent feb0416d
......@@ -913,6 +913,15 @@ ftfont_get_bitmap (font, code, bitmap, bits_per_pixel)
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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment