V-Gears 0
Free Final Fantasy VII engine.
UiFont Class Reference

The UI widgets font. More...

#include <UiFont.h>

Collaboration diagram for UiFont:

Public Member Functions

 UiFont (const Ogre::String &name, const Ogre::String &language)
 Constructor. More...
 
virtual ~UiFont ()
 Destructor. More...
 
const Ogre::String & GetName () const
 Retrieves the font name. More...
 
const Ogre::String & GetLanguage () const
 Retrieves the font language. More...
 
void SetImage (const Ogre::String &image, const int width, const int height)
 Sets an image for the font. More...
 
const Ogre::String & GetImageName () const
 Retrieves the font image file name. More...
 
int GetImageWidth () const
 Retrieves the font image width. More...
 
int GetImageHeight () const
 Retrieves the font image height. More...
 
void SetHeight (const int height)
 Sets the character height for the font. More...
 
int GetHeight () const
 Retrieves the character height of the font. More...
 
void AddCharData (const UiCharData &data)
 Adds data for a character. More...
 
UiCharData GetCharData (const int char_code) const
 Retrieves character data from a char code. More...
 

Private Attributes

Ogre::String name_
 The font name. More...
 
Ogre::String language_
 The font language. More...
 
Ogre::String image_name_
 The font image file name. More...
 
int image_width_
 The font image file width. More...
 
int image_height_
 The font image file height. More...
 
int height_
 The height of the font characters. More...
 
std::vector< UiCharDatachar_data_
 List of character data for the font. More...
 

Detailed Description

The UI widgets font.

Constructor & Destructor Documentation

◆ UiFont()

UiFont::UiFont ( const Ogre::String &  name,
const Ogre::String &  language 
)

Constructor.

Parameters
[in]nameThe font name.
[in]languageThe font language.

◆ ~UiFont()

UiFont::~UiFont ( )
virtual

Destructor.

Member Function Documentation

◆ AddCharData()

void UiFont::AddCharData ( const UiCharData data)

Adds data for a character.

Parameters
[in]dataThe character data to add.

◆ GetCharData()

UiCharData UiFont::GetCharData ( const int  char_code) const

Retrieves character data from a char code.

Parameters
[in]char_codeThe code of the character to retrieve data about.
Returns
Character data associated to the char code. A default {
See also
UiCharData} structure wil be returnd if there is no data for the char code.

◆ GetHeight()

int UiFont::GetHeight ( ) const

Retrieves the character height of the font.

Returns
The character height.

◆ GetImageHeight()

int UiFont::GetImageHeight ( ) const

Retrieves the font image height.

Returns
The font image height.

◆ GetImageName()

const Ogre::String & UiFont::GetImageName ( ) const

Retrieves the font image file name.

Returns
The font image file name.

◆ GetImageWidth()

int UiFont::GetImageWidth ( ) const

Retrieves the font image width.

Returns
The font image height.

◆ GetLanguage()

const Ogre::String & UiFont::GetLanguage ( ) const

Retrieves the font language.

Returns
The font language.

◆ GetName()

const Ogre::String & UiFont::GetName ( ) const

Retrieves the font name.

Returns
The font name.

◆ SetHeight()

void UiFont::SetHeight ( const int  height)

Sets the character height for the font.

Parameters
[in]heightCharacter height.

◆ SetImage()

void UiFont::SetImage ( const Ogre::String &  image,
const int  width,
const int  height 
)

Sets an image for the font.

The image is a character map.

Parameters
[in]imagePath to the font image, relative to data/fonts.
[in]widthImage width.
[in]heightImage height.

Member Data Documentation

◆ char_data_

std::vector<UiCharData> UiFont::char_data_
private

List of character data for the font.

◆ height_

int UiFont::height_
private

The height of the font characters.

◆ image_height_

int UiFont::image_height_
private

The font image file height.

◆ image_name_

Ogre::String UiFont::image_name_
private

The font image file name.

◆ image_width_

int UiFont::image_width_
private

The font image file width.

◆ language_

Ogre::String UiFont::language_
private

The font language.

◆ name_

Ogre::String UiFont::name_
private

The font name.


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