# FTGlyph.h File Reference

`#include <FTGL/ftgl.h>`

Go to the source code of this file.

## Data Structures
class | FTGlyph
| FTGlyph is the base class for FTGL glyphs. More...
## Typedefs
typedef struct _FTGLglyph | FTGLglyph
## Functions
FTGLglyph * | ftglCreateCustomGlyph (FTGLglyph *base, void *data, void(*renderCallback)(FTGLglyph *, void *, FTGL_DOUBLE, FTGL_DOUBLE, int, FTGL_DOUBLE *, FTGL_DOUBLE *), void(*destroyCallback)(FTGLglyph *, void *))
| Create a custom FTGL glyph object.
void | ftglDestroyGlyph (FTGLglyph *glyph)
| Destroy an FTGL glyph object.
void | ftglRenderGlyph (FTGLglyph *glyph, FTGL_DOUBLE penx, FTGL_DOUBLE peny, int renderMode, FTGL_DOUBLE *advancex, FTGL_DOUBLE *advancey)
| Render a glyph at the current pen position and compute the corresponding advance.
float | ftglGetGlyphAdvance (FTGLglyph *glyph)
| Return the advance for a glyph.
void | ftglGetGlyphBBox (FTGLglyph *glyph, float bounds[6])
| Return the bounding box for a glyph.
FT_Error | ftglGetGlyphError (FTGLglyph *glyph)
| Query a glyph for errors.

## Typedef Documentation

typedef struct _FTGLglyph FTGLglyph

Definition at line 133 of file FTGlyph.h.

## Function Documentation

FTGLglyph* ftglCreateCustomGlyph | ( | FTGLglyph * | base,
|  | void * | data,
|  | void(*)(FTGLglyph *, void *, FTGL_DOUBLE, FTGL_DOUBLE, int, FTGL_DOUBLE *, FTGL_DOUBLE *) | renderCallback,
|  | void(*)(FTGLglyph *, void *) | destroyCallback |
| ) |  |  |

Create a custom FTGL glyph object.

FIXME: maybe get rid of "base" and have advanceCallback etc. functions

Parameters:

  | base | The base FTGLglyph* to subclass.
  | data | A pointer to private data that will be passed to callbacks.
  | renderCallback | A rendering callback function.
  | destroyCallback | A callback function to be called upon destruction.

Returns:
  An FTGLglyph* object.

void ftglDestroyGlyph | ( | FTGLglyph * | glyph | ) |

Destroy an FTGL glyph object.

Parameters:

  | glyph | An FTGLglyph* object.

float ftglGetGlyphAdvance | ( | FTGLglyph * | glyph | ) |

Return the advance for a glyph.

Parameters:

  | glyph | An FTGLglyph* object.

Returns:
  The advance's X component.

void ftglGetGlyphBBox | ( | FTGLglyph * | glyph,
|  | float | bounds[6] |
| ) |  |  |

Return the bounding box for a glyph.

Parameters:

  | glyph | An FTGLglyph* object.
  | bounds | An array of 6 float values where the bounding box's lower left near and upper right far 3D coordinates will be stored.

FT_Error ftglGetGlyphError | ( | FTGLglyph * | glyph | ) |

Query a glyph for errors.

Parameters:

  | glyph | An FTGLglyph* object.

Returns:
  The current error code.

void ftglRenderGlyph | ( | FTGLglyph * | glyph,
|  | FTGL_DOUBLE | penx,
|  | FTGL_DOUBLE | peny,
|  | int | renderMode,
|  | FTGL_DOUBLE * | advancex,
|  | FTGL_DOUBLE * | advancey |
| ) |  |  |

Render a glyph at the current pen position and compute the corresponding advance.

Parameters:

  | glyph | An FTGLglyph* object.
  | penx | The current pen's X position.
  | peny | The current pen's Y position.
  | renderMode | Render mode to display
  | advancex | A pointer to an FTGL_DOUBLE where to write the advance's X component.
  | advancey | A pointer to an FTGL_DOUBLE where to write the advance's Y component.