freetype-devel
[Top][All Lists]
Advanced

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

[ft-devel] freetype stroker function usage


From: Yuri Talya
Subject: [ft-devel] freetype stroker function usage
Date: Thu, 25 Oct 2007 11:47:44 +0400

Good day.

I try to use FT_Glyph_Stroke function for add contour for arail font.

I want draw font with white letter and black border  and custom background on tv screen in my custom dsp application.

But my letters are white on custom background without border.

FT_Glyph_Stroke not work correctly in my case.

 

void bitmap_create()

{

            int i;

            FT_Library ft;

            FT_Face face_text[NumOfTextLetters];

FT_Stroker stroker;

            extern const char data3[];

            FT_Error error = FT_Init_FreeType (&ft);

            if(error)haltError("11000");

            for(i = 0; i < NumOfTextLetters; i++)

            {

FT_UInt  glyph_index;

FT_Glyph glyph;

                        error = FT_New_Memory_Face (ft,(const FT_Byte*)data3,134200,0,&face_text[i]);

                        if(error)haltError("11001");

error = FT_Stroker_New (ft, &stroker);

if(error)haltError("11001");

FT_Stroker_Set (stroker, 50, FT_STROKER_LINECAP_ROUND, FT_STROKER_LINEJOIN_ROUND, 0);

            error = FT_Set_Char_Size(face_text[i],char_width, char_height,100,100); 

                        if(error)haltError("11001");

            glyph_index = FT_Get_Char_Index( face_text[i], i );

            error = FT_Load_Glyph( face_text[i], glyph_index, FT_LOAD_DEFAULT );

                        FT_Get_Glyph (face_text[i]->glyph, &glyph);      

            error = FT_Glyph_Stroke(&glyph, stroker,1);

//error = FT_Glyph_StrokeBorder(&glyph, stroker,0,1);

if(error)haltError("11001");

                        error = FT_Render_Glyph( face_text[i]->glyph, FT_RENDER_MODE_NORMAL );

                        slot_text[i] = face_text[i]->glyph;           

                        FT_Done_Glyph(glyph);

            }

}

 

Thanks.

Yuri Talia, Sankt_Petrerburg, Russia

 


reply via email to

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