FTGL 2.4.0

Data Structures | Typedefs | Functions
FTGlyph.h File Reference
`#include <FTGL/ftgl.h>`
Include dependency graph for FTGlyph.h:
This graph shows which files directly or indirectly include this file:

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

## ◆ FTGLglyph

typedef struct _FTGLglyph FTGLglyph

Definition at line 134 of file FTGlyph.h.

## Function Documentation

## ◆ ftglCreateCustomGlyph()

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.

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.

References FTGL_EXPORT, and ftglCreateCustomGlyph().

Referenced by ftglCreateCustomGlyph().

## ◆ ftglDestroyGlyph()

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

Destroy an FTGL glyph object.

Parameters

  glyph | An FTGLglyph* object.

References FTGL_EXPORT, and ftglDestroyGlyph().

Referenced by ftglDestroyGlyph().

## ◆ ftglGetGlyphAdvance()

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

Return the advance for a glyph.

Parameters

  glyph | An FTGLglyph* object.

Returns
  The advance's X component.

References FTGL_EXPORT, and ftglGetGlyphAdvance().

Referenced by ftglGetGlyphAdvance().

## ◆ ftglGetGlyphBBox()

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.

References FTGL_EXPORT, and ftglGetGlyphBBox().

Referenced by ftglGetGlyphBBox().

## ◆ ftglGetGlyphError()

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

Query a glyph for errors.

Parameters

  glyph | An FTGLglyph* object.

Returns
  The current error code.

References FTGL_END_C_DECLS, FTGL_EXPORT, and ftglGetGlyphError().

Referenced by ftglGetGlyphError().

## ◆ ftglRenderGlyph()

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.

References FTGL_EXPORT, and ftglRenderGlyph().

Referenced by ftglRenderGlyph().