jamesturk.net

personal website of James Turk, a developer in Washington, DC

GLFT_font

About GLFT_Font

GLFT_Font is originally by James Turk although it is based on the work of Marijn Haverbeke. GLFT_Font allows programmers to use fonts in their OpenGL applications with great ease on any platform for which both FreeType2 and OpenGL are available.

Obtaining GLFT_Font

The latest release of GLFT_Font should always be available here. Source is on github. At the moment the latest version is 0.2.2.

Using GLFT_Font

Using GLFT_Font is designed to be extremely simple. The simplest use is:

#include "GLFT_Font.h"...

glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
...
GLFT_Font fnt("somefont.ttf", size);
...
fnt.drawText(x, y, "Hello World");

GLFT_Font also includes support for finding the width/height of a string and drawText supports printf-style argument formatting. As of 0.2 GLFT_Font allows outputting text via C++ style stream operators.

Changelog

  • Version 0.2.1 - Updated website to polimath.com
  • Version 0.2 - 18 July 2005 - Added beginDraw/endDraw and changed vsprintf to vsnprintf
  • Version 0.1 - 1 July 2005 - Initial Release

about james

James Turk is a 23 year old currently living in Washington, DC working for Sunlight Labs. This site is a place for my projects and thoughts.

content © James Turk — cc-by unless otherwise noted