_________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

Classes
font.h File Reference
#include <string>
#include "color.h"
#include "guichan/font.h"

Go to the source code of this file.

Classes

class  CFont
 Font definition. More...
 
class  CFontColor
 Font color definition. More...
 
class  CLabel
 

include/font.h - The font headerfile.

#define MaxFontColors   9
 
#define FontRed   "red"
 
#define FontGreen   "green"
 
#define FontYellow   "yellow"
 
#define FontWhite   "white"
 
#define FontGrey   "grey"
 
int FontCodePage
 true when GameFont is provided More...
 
CFontGetSmallFont ()
 
CFontGetGameFont ()
 Small font used in stats. More...
 
bool IsGameFontReady ()
 Normal font used in game. More...
 
void SetDefaultTextColors (const std::string &normal, const std::string &reverse)
 Set the default text colors for normal and reverse text. More...
 
void GetDefaultTextColors (std::string &normalp, std::string &reversep)
 Get the default text colors for normal and reverse text. More...
 
std::string GetLineFont (unsigned int line, const std::string &s, unsigned int maxlen, const CFont *font)
 Return the 'line' line of the string 's'. More...
 
int GetHotKey (const std::string &text)
 Get the hot key from a string. More...
 
void LoadFonts ()
 Load and initialize the fonts. More...
 
void CleanFonts ()
 Cleanup the font module. More...
 

Macro Definition Documentation

◆ FontGreen

#define FontGreen   "green"

◆ FontGrey

#define FontGrey   "grey"

◆ FontRed

#define FontRed   "red"

FIXME: should be moved to lua

◆ FontWhite

#define FontWhite   "white"

◆ FontYellow

#define FontYellow   "yellow"

◆ MaxFontColors

#define MaxFontColors   9

Function Documentation

◆ CleanFonts()

void CleanFonts ( )

Cleanup the font module.

Clean up the font module.

◆ GetDefaultTextColors()

void GetDefaultTextColors ( std::string &  normalp,
std::string &  reversep 
)

Get the default text colors for normal and reverse text.

Get the default text colors.

Parameters
normalpNormal text color pointer.
reversepReverse text color pointer.

◆ GetGameFont()

CFont& GetGameFont ( )

Small font used in stats.

◆ GetHotKey()

int GetHotKey ( const std::string &  text)

Get the hot key from a string.

Get the hot key from a string

◆ GetLineFont()

std::string GetLineFont ( unsigned int  line,
const std::string &  s,
unsigned int  maxlen,
const CFont font 
)

Return the 'line' line of the string 's'.

Return the 'line' line of the string 's'.

Parameters
lineline number.
smultiline string.
maxlenmax length of the string (0 : unlimited) (in char if font == NULL else in pixels).
fontif specified use font->Width() instead of strlen.
Returns
computed value.

◆ GetSmallFont()

CFont& GetSmallFont ( )

Font selector for the font functions. FIXME: should be moved to lua

◆ IsGameFontReady()

bool IsGameFontReady ( )

Normal font used in game.

◆ LoadFonts()

void LoadFonts ( )

Load and initialize the fonts.

Load all fonts.

◆ SetDefaultTextColors()

void SetDefaultTextColors ( const std::string &  normal,
const std::string &  reverse 
)

Set the default text colors for normal and reverse text.

Set the default text colors.

Parameters
normalNormal text color.
reverseReverse text color.

Variable Documentation

◆ FontCodePage

int FontCodePage

true when GameFont is provided

(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.