
OpenTK.Text
Posted Thursday, 10 December, 2009 - 10:20 by the Fiddler inOpenTK.Text is a simple, cross-platform library that provides text drawing routines to OpenTK applications. It relies on GDI+ to provide native-quality 2d text that is suitable for user interfaces and debugging overlays. Can be used with OpenGL 1.x, 2.x and backwards-compatible 3.x contexts.
This project is in need of a maintainer.
Usage:
using System.Drawing; using OpenTK.Graphics; Font font = new Font(FontFamily.GenericSansSerif, 18.0f); TextPrinter printer = new TextPrinter(TextQuality.High); printer.Begin(); printer.Print("Hello, World!", font, Color.White); printer.End();
Known limitations:
- The caching mechanism cannot deal with dynamic text. Specify
TextPrinterOptions.NoCachewhen drawing text strings that change per frame. - Mono GDI+ suffers from a large number of layout bugs. Workarounds are implemented for a number of those bugs, but unfortunately the workarounds allocate memory and may reduce performance.
- Only pixel-perfect, 2d text is supported. Trying to apply any perspective transform will probably cause the text to become illegible.

