Cutout Vis2012
TUWienVisualisierung2(SS2012)-AdaptiveCutaways
 All Classes Namespaces Functions Pages
Public Member Functions | List of all members
FontRenderer Class Reference

#include <FontRenderer.h>

Public Member Functions

void loadFont (const std::string &fontPath, const std::string &fontName, int pixelHeight)
 
void createText (const std::string &text, const std::string &fontName, Scene *scene, Text *textObj)
 
void render (Shader *shader)
 

Detailed Description

Backend for font rendering. Loads true type fonts from a file.

Member Function Documentation

void FontRenderer::createText ( const std::string &  text,
const std::string &  fontName,
Scene scene,
Text textObj 
)

Creates a Text object with the specified string and font that is associated with fontName.

Parameters
textstring to be drawn
fontNamename associated with the desired font and size
sceneprovides canvas size
[out]pointerto creates Text object
void FontRenderer::loadFont ( const std::string &  fontPath,
const std::string &  fontName,
int  pixelHeight 
)

Loads a true type font from fontPath. The font is associated with fontName. The resulting font can only be used with the specified size and should not be scaled. If different font sizes are required, this method should be called once per size. Uses the library FreeType to create bitmaps for each character in the set and packs them tightly into one GL texture by using the algorithm outlines on this website.

Parameters
fontPathpath of the true type font file, relative to the folder fonts/
fontNamename that will be associated with this font and size
pixelHeightheight of 'W' in pixels
void FontRenderer::render ( Shader shader)

Test method to render a character map onscreen.


The documentation for this class was generated from the following files: