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

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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"
 
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)
 true when GameFont is provided 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 FreeOpenGLFonts ()
 Free OpenGL fonts. More...
 
void ReloadFonts ()
 Reload OpenGL fonts. More...
 
void CleanFonts ()
 Cleanup the font module. More...
 

Macro Definition Documentation

#define FontGreen   "green"
#define FontGrey   "grey"
#define FontRed   "red"

FIXME: should be moved to lua

#define FontWhite   "white"
#define FontYellow   "yellow"
#define MaxFontColors   9

Function Documentation

void CleanFonts ( )

Cleanup the font module.

Clean up the font module.

void FreeOpenGLFonts ( )

Free OpenGL fonts.

Free OpenGL fonts

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.
CFont& GetGameFont ( )

Small font used in stats.

int GetHotKey ( const std::string &  text)

Get the hot key from a string.

Get the hot key from a string

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.
CFont& GetSmallFont ( )

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

bool IsGameFontReady ( )

Normal font used in game.

void LoadFonts ( )

Load and initialize the fonts.

Load all fonts.

void ReloadFonts ( )

Reload OpenGL fonts.

Reload OpenGL fonts

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

true when GameFont is provided

Set the default text colors for normal and reverse text

Set the default text colors.

Parameters
normalNormal text color.
reverseReverse text color.
(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.