freetype
[Top][All Lists]
Advanced

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

Re: [ft] Drawing chinese text with FreeType on OpenGL


From: googoo
Subject: Re: [ft] Drawing chinese text with FreeType on OpenGL
Date: Wed, 11 Mar 2009 21:21:57 -0700 (PDT)

        //Load the Glyph for our character.
        //if(FT_Load_Glyph( face, FT_Get_Char_Index( face, ch ), 
FT_LOAD_DEFAULT ))
        if(FT_Load_Glyph( face, FT_Get_Char_Index( face, 49896 ), 
FT_LOAD_DEFAULT
))
                throw std::runtime_error("FT_Load_Glyph failed");

        //Move the face's glyph into a Glyph object.
    FT_Glyph glyph;
    if(FT_Get_Glyph( face->glyph, &glyph ))
                throw std::runtime_error("FT_Get_Glyph failed");

        //Convert the glyph to a bitmap.
        FT_Glyph_To_Bitmap( &glyph, ft_render_mode_normal, 0, 1 );
    FT_BitmapGlyph bitmap_glyph = (FT_BitmapGlyph)glyph;

        //This reference will make accessing the bitmap easier
        FT_Bitmap& bitmap=bitmap_glyph->bitmap;

everything was fine with the above code, but when i draw it on opengl
screen, all i see is a square/rectangle




Werner LEMBERG wrote:
> 
> 
>> I am using simhei.ttf.  I tried to use the unicode charmap but all i
>> see is a square on my screen.
> 
> Use ftstring from the ft2demos bundle as a template -- this program
> supports UTF8 encoded input strings.
> 
> 
>     Werner
> 
> 
> _______________________________________________
> Freetype mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/freetype
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Drawing-chinese-text-with-FreeType-on-OpenGL-tp22396018p22469680.html
Sent from the Freetype - User mailing list archive at Nabble.com.





reply via email to

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