Table of Contents

 
AddFont
 

Purpose

Adds a font object to the manager

 

Protoype

void CTextMngr::AddFont (string str_font_id, string str_filename)
 

Parameters

font_id the string ID that will be used to reference the font object
filename the name or location of the font image file
 

Description

Font objects can be assigned to text objects so that when the text objects are render they are displayed in the font assigned to them. This allows automatic display of various fonts on the screen. The font assigned to a text object can be changed with SetFont(). Each font object has its own unique identifier string contained in str_font_id. This identifier can have no spaces, and if an identical indentifier already exists in the font manager this ID will be ignored. The actual font itself is a true-type font file, the path or location of which is contained in str_filename.

NOTE: All fonts must be true-type (.ttf)

 
Use
CTextMngr text;
text.AddFont("my_font", "arial.ttf"); 
 

Prev: _EatWhite
Next: AddText