int FontAdd(char *font, char *style, int points, int color);
Load a system font.
Return Value
Returns an int handle to the loaded font.
Parameters
font Name of the font to be loaded. See table below for supported font specifiers.
style Style to be applied to the font. See table below for supported style specifiers.
points Size of the font in points.
color Color of the font, expressed as RGB values, encoded as a hexadecimal value. e.g. 0xFF0000 represents the color red.
Remarks
The FontAdd() function initializes a system font. The tables below specify the supported fonts in DragonFireSDK:
If a font specifier cannot be recognized, Arial will be used by default.
If a style specifier cannot be recognized, Regular will be used by default.
Availability
Available in DragonFireSDK 1.2 and later.
Example
Description: This program will display several Text objects using each available font in a different size and color.
#include "DragonFireSDK.h"
int font;
void AppMain() { font=FontAdd("Arial","Regular",18,0xFF0000); TextAdd(20,20,"This is Arial",font);
font=FontAdd("Courier","Regular",20,0x00FF00); TextAdd(20,60,"This is Courier",font);
font=FontAdd("Georgia","Regular",22,0x0000FF); TextAdd(20,100,"This is Georgia",font);
font=FontAdd("Helvetica","Regular",24,0x770000); TextAdd(20,140,"This is Helvetica",font);
font=FontAdd("Times","Regular",26,0x007700); TextAdd(20,180,"This is Times",font);
font=FontAdd("Trebuchet","Regular",28,0x000077); TextAdd(20,220,"This is Trebuchet",font);
font=FontAdd("Verdana","Regular",30,0x777777); TextAdd(20,260,"This is Verdana",font); }
void AppExit() {
}
void OnTimer() {
} |