Archived

This topic is now archived and is closed to further replies.

freetype2: italic or bold style

This topic is 5312 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello! Where do I use FT_STYLE_FLAG_ITALIC or FT_STYLE_FLAG_BOLD in freetype 2 to ge italic or bold styles? I am using this sample rendering code from freetype tutorial
FT_GlyphSlot  slot = face->glyph;  // a small shortcut

       FT_UInt       glyph_index;
       int           pen_x, pen_y, n;

       .. initialise library ..
       .. create face object ..
       .. set character size ..
       
       pen_x = 300;
       pen_y = 200;
       
       for ( n = 0; n < num_chars; n++ )
       {
         // load glyph image into the slot (erase previous one)

         error = FT_Load_Char( face, text[n], FT_LOAD_RENDER );
         if (error) continue;  // ignore errors

         
         // now, draw to our target surface

         my_draw_bitmap( &slot->bitmap,
                         pen_x + slot->bitmap_left,
                         pen_y - slot->bitmap_top );
                         
         // increment pen position 

         pen_x += slot->advance.x >> 6;
       }
I''v searched documentation, but can''t find function that takes style as parameter Thanks!!

Share this post


Link to post
Share on other sites