{\*\generator Msftedit 5.41.21.2508;}\viewkind4\uc1\pard\qc\lang1033\b\f0\fs32 Font rendering\par
\b0\f1\fs20\par
\lang1032\f2\par
\pard\lang1033\b\f1\fs24 Overview\par
\par
\b0\fs22 This sample demonstrates the basic capabilities of the font renderer, which can be used to render high-quality, 2d text on a color buffer.\par
\par
\par
\b\fs24 Requirements\b0\fs22\par
\par
The font renderer depends on OpenGL 1.1, but takes advantage of higher OpenGL versions to improve quality and/or speed.\par
\par
\par
\b\f0\fs24 Usage\par
\par
\b0\f1\fs22 To use the font renderer, create and store a \b TextPrinter \b0 instance.\par
\par
The \b Print \b0 method renders a System.String using the specified System.Drawing.Font and System.Drawing.Color. You can optionally specify a layout rectangle, one or more layout flags (e.g. right-to-left or vertical) and one or more TextPrinterFlags (e.g. no cache).\par
\lang1032\f2\par
\lang1033\f1 The \b Measure \b0 method measures the bounding box of each character (also called 'glyph extents') and the bounding box of the whole string. It can be used to get accurate data for laying out GUI elements or rendering a caret.\par
\par
The \b Begin \b0 and \b End \b0 methods can be used to setup and restore a pixel-perfect, resolution dependent, orthographic projection matrix on the current OpenGL context. This matrix matches the typical 2d coordinate system of the native font rendering libraries (origin on the top-left corner of the screen) and ensures that text drawn through OpenTK will look identical to native text.\par
If you wish to specify a \b custom projection matrix\b0 , do not call TextPrinter.Begin or TextPrinter.End and scale the text by the inverse of your viewport Width and Height, multiplied by two. For example:\par