![]() |
Blamite Game Engine - blam!
00423.10.27.24.0533.blamite
The core library for the Blamite Game Engine.
|
Class representing a Blamite font package. More...
#include <fonts.h>
Public Member Functions | |
BlamFontPackage () | |
Constructor. More... | |
~BlamFontPackage () | |
Destructor. More... | |
BlamFontGlyph * | GetGlyph (char character) |
Retrieves font glyph information from a character. More... | |
Ogre::HlmsDatablock * | CreateCopiedDatablock () |
Creates a copy of this glyph's datablock, intended to allow for it to be recolored on a per-instance basis. More... | |
Public Attributes | |
std::string | name = "" |
The name/ID of the font. Must be unique. More... | |
std::string | file_path = "" |
The file path of the font information or package file. More... | |
BlamFontPackageType | type = BlamFontPackageType::Unknown |
The format of the font pacakge. See BlamFontPackageType for details. More... | |
BlamMap< char, BlamFontGlyph * > | glyphs = BlamMap<char, BlamFontGlyph*>() |
Map containing all glyphs within the font package. More... | |
bool | monospace = false |
Whether or not the font is monospaced. More... | |
int | monospace_width = 0 |
The monospaced width of each character. Only used when monospace is set to true . More... | |
int | charspacing = 0 |
The amount of spacing between each character, in pixels. More... | |
int | line_height = 0 |
The height of each line of text, in pixels. More... | |
int | space_width = 0 |
The width of the space character, in pixels. Only used when monospace is false . More... | |
bool | use_point_filtering = false |
Whether or not glyphs in this font package should use point filtering or not. More... | |
uint32_t | glyphs_per_row = 0 |
The number of glyphs per row within the texture atlas. Only used in fonts that use a texture atlas. More... | |
uint32_t | glyphs_per_column = 0 |
The number of glyphs per column within the texture atlas. Only used in fonts that use a texture atlas. More... | |
Ogre::TextureGpu * | font_atlas = nullptr |
The font atlas texture. Only used in fonts that use a texture atlas. More... | |
Ogre::HlmsDatablock * | font_datablock = nullptr |
The font atlas datablock. Only used in fonts that use a texture atlas. More... | |
Ogre::FontPtr | ttf_font |
Unused. More... | |
Class representing a Blamite font package.
Font packages are used to store font data in either an unpacked (XML) format, or in a single package (.bin) file. They are used throughout the engine to display text.
BlamFontPackage::BlamFontPackage | ( | ) |
Constructor.
Does not perform any tasks.
To load a font, use one of the appropriate functions within Blam::Content::Fonts.
BlamFontPackage::~BlamFontPackage | ( | ) |
Destructor.
Ensures that all glyph data is properly released.
Ogre::HlmsDatablock * BlamFontPackage::CreateCopiedDatablock | ( | ) |
Creates a copy of this glyph's datablock, intended to allow for it to be recolored on a per-instance basis.
This method is only supported if this glyph's font package stores glyphs in a single texture atlas. For fonts which store glyphs in their own separate bitmaps, use the CreateCopiedDatablock
method within BlamFontGlyph instead.
BlamFontGlyph * BlamFontPackage::GetGlyph | ( | char | character | ) |
Retrieves font glyph information from a character.
character | - The character to look up. |
nullptr
is returned. int BlamFontPackage::charspacing = 0 |
The amount of spacing between each character, in pixels.
std::string BlamFontPackage::file_path = "" |
The file path of the font information or package file.
Ogre::TextureGpu* BlamFontPackage::font_atlas = nullptr |
The font atlas texture. Only used in fonts that use a texture atlas.
Ogre::HlmsDatablock* BlamFontPackage::font_datablock = nullptr |
The font atlas datablock. Only used in fonts that use a texture atlas.
BlamMap<char, BlamFontGlyph*> BlamFontPackage::glyphs = BlamMap<char, BlamFontGlyph*>() |
Map containing all glyphs within the font package.
uint32_t BlamFontPackage::glyphs_per_column = 0 |
The number of glyphs per column within the texture atlas. Only used in fonts that use a texture atlas.
uint32_t BlamFontPackage::glyphs_per_row = 0 |
The number of glyphs per row within the texture atlas. Only used in fonts that use a texture atlas.
int BlamFontPackage::line_height = 0 |
The height of each line of text, in pixels.
bool BlamFontPackage::monospace = false |
Whether or not the font is monospaced.
int BlamFontPackage::monospace_width = 0 |
The monospaced width of each character. Only used when monospace
is set to true
.
std::string BlamFontPackage::name = "" |
The name/ID of the font. Must be unique.
int BlamFontPackage::space_width = 0 |
The width of the space character, in pixels. Only used when monospace
is false
.
Ogre::FontPtr BlamFontPackage::ttf_font |
Unused.
BlamFontPackageType BlamFontPackage::type = BlamFontPackageType::Unknown |
The format of the font pacakge. See BlamFontPackageType for details.
bool BlamFontPackage::use_point_filtering = false |
Whether or not glyphs in this font package should use point filtering or not.