freetype-devel
[Top][All Lists]
Advanced

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

[ft-devel] FT_GlyphSlot::advance.x versus FT_Bitmap::width for character


From: Louis Desjardins
Subject: [ft-devel] FT_GlyphSlot::advance.x versus FT_Bitmap::width for character spacing
Date: Tue, 13 Sep 2011 15:40:20 -0700

Hi,

I am using Freetype to load a font face from memory (FT_New_Memory_Face), and then render this using OpenGL ES. I render using glVertexPointer and glDrawArrays. glVertexPointer is passed the vertices of where I want each character to be displayed.

When drawing a string (versus just a single character), I have to account for how much space each subsequent character is shifted over by. I wanted to know if using FT_Bitmap::width (i.e. the bitmap width of the previous character in the string) is a suitable value to use for this purpose? (When I try this, it looks okay for the most part, though maybe not perfect). Or, should I be using FT_GlyphSlot::advance.x (for horizontal spacing) instead for this purpose?

Thanks!
LB

reply via email to

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