freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] freetype opengl texture


From: David Turner
Subject: Re: [ft-devel] freetype opengl texture
Date: Thu, 09 Aug 2007 23:18:16 +0200

Hello,

I thought the documentation made it clear that FT_RENDER_MODE_NORMAL corresponds
to 8-bit gray maps with 256 levels of "gray"

see: 

http://www.freetype.org/freetype2/docs/reference/ft2-base_interface.html#FT_Render_Mode

hope this helps,
- David

On Thu, 9 Aug 2007 10:00:28 -0700 (PDT), "zill" <address@hidden> said:
> 
> I loaded the glyph exactly how freetype explains:
> 
> FT_UInt glyph_index = FT_Get_Char_Index(ft_face, c);
> FT_UInt error = FT_Load_Glyph(ft_face, glyph_index, FT_LOAD_DEFAULT);
> if (error) { return false }
> error = FT_Render_Glyph(ft_face->glyph, FT_RENDER_MODE_NORMAL);
> if (error) { return false }
> 
> glGenTextures(1, &texture);
> glBindTexture(GL_TEXTURE_2D, texture);
> glTexImage2D(GL_TEXTURE_2D, 0, 3, 30, 30, 0, GL_RGBA, GL_UNSIGNED_BYTE,
> &ft_face->glyph->bitmap);
> 
> Then I try to load it into a texture, but it doesn't work.  I don't see
> anywhere in freetype where it says what type of bitmap the glyphs are
> (RGB,
> RGBA, etc...) and I'm only using 30 so that I know the glyph will fit
> into
> the texture, since the font size is set to 16.  Can anyone tell me what
> I've
> done wrong.  I don't see what it could be.
> 
> Thank you.
> -- 
> View this message in context:
> http://www.nabble.com/freetype-opengl-texture-tf4243821.html#a12076307
> Sent from the Freetype - Dev mailing list archive at Nabble.com.
> 
> 
> 
> _______________________________________________
> Freetype-devel mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/freetype-devel




reply via email to

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