Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 14 commits ahead of sloopdoom:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



This is an experimental version of the FTGLES2 library for OpenGL ES 2.0. Use at your own risk, as the library is subject to change.

The only demo project that currently supports OpenGL ES 2.0 is GLES2Demo. All other demos in this branch default back to OpenGL ES 1.1.

FTGLES2 0.2.1

FTGLES2 is a C++ library for rendering fonts on mobile operating systems with OpenGL ES. It is a port of FTGLES, whitch iself is a port of FTGL. It currently should target the iPhone and iPad,android,linux, and windows. iOS 4.2 is currently supported.

From the FTGL notes:

"Unlike other OpenGL font libraries FTGL uses standard font file formats so doesn't need a preprocessing step to convert the high quality font data into a lesser quality, proprietary format."

"FTGL uses the Freetype font library to open and 'decode' the fonts. It then takes that output and stores it in a format most efficient for OpenGL rendering."


See INSTALL NOTES for instructions on how to add FTGLES to your Xcode project or build using automake.


Include the library in your code:

#include "FTGL/ftgles2.h"

Create a font from a truetype file or opentype font:

FTFont *font = new FTTextureFont("/path/to/myfont.ttf");
FTFont *font2 = new FTTextureFont("/path/to/myotherfont.otf");

To render the text within your render loop (fonts are rendered at the origin along the positive x-axis):

glColor4f(0.0f, 0.0f, 0.0f, 1.0f); // Black text
font->Render("Lorem ipsum dolor sit amet");

The Hello World Demo example class shows a minimal implementation of a render loop.

See the Demos folder for several comprehensive sample iPhone apps. The demo apps include a unicode demo, as well as a demonstration of how to use layouts to easily align and position your text.

Differences between FTGL and FTGLES2

FTGLES2 0.2.1 supports the following font types from the original FTGL library:

  • FTBufferFont
  • FTGLOutlineFont
  • FTGLPolygonFont
  • FTGLTextureFont

Extrusion and pixmap rendering from the original FTGL library are currently not supported. Bitmap font support is currently in progress.

Performance Notes

If you need to render large amounts of text, Texture fonts are preferable, and also currently look much better than other font types. Texture fonts allow you to render a full screen of text without any appreciable drop in frame rate.

For Polygon and Outline fonts, rendering speeds depend very much on the type face being rendered. More complex glyphs will almost always contain more vertices, and thus FTGLES will need to draw more polygons or lines.

While you may get acceptable results by switching to a simple typeface, it is generally recommended that you avoid excessive use of Polygon and Outline fonts in iOS applications. Expect to see large drops in frame rate when drawing any more than 100-200 Polygon or Outline glyphs on screen.

Performance of the SimpleLayout class was previously very slow, but was recently improved in a recent build.

There is a Performance test application that will show the framerate of a screen full of text rendered using the SimpleLayout class, along with several font faces.


  • FTGLES License here
  • FTGLES2 License here
  • Original FTGL License here
  • Freetype 2 License here