freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ft] pixel_mode


From: Jeremy Mordkoff
Subject: [ft] pixel_mode
Date: Tue, 19 Jun 2012 12:10:16 +0000

When I set the char size to certain values, I get back a bitmap instead of a grayscale image and many of the values in the slot struct make no sense.

 

How can I force the system to always return a bitmap with the pixel_mode of FT_PIXEL_MODE_GRAY  ?

 

 

  for ( n = 0; n < text.length(); n++ )

  {

                char c = text.at(n);

                FT_Set_Transform( font, NULL, &pen );

                FT_UInt index = FT_Get_Char_Index(font, c);

                if ( index == 0 ) {

                                ZLOG_CRIT("char " << c << " index is zero");

                                continue;

                }

                error = FT_Load_Glyph(font, index, FT_LOAD_RENDER | FT_RENDER_MODE_NORMAL );

                if ( error ) {

                                  ZLOG_CRIT("error " << error << " loading char " << c );

                                continue;

                }

                slot = font->glyph;

                if (c != ' ' ) draw_char( &slot->bitmap, slot->bitmap_left, m_height - slot->bitmap_top, color);

                pen.x += slot->advance.x; 

 }

 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]