![]() |
Blamite Game Engine - blam!
00296.01.12.21.0102.blamite
The core library for the Blamite Game Engine.
|
#include "fonts.h"
#include <fstream>
#include <Strings/components/3rdparty/rapidxml/rapidxml.hpp>
#include <Strings/components/utils/converters/converters.h>
#include <Strings/components/utils/string/string.h>
#include <Strings/components/utils/io/io.h>
#include "components/rendering/rendering.h"
#include "components/rendering/directx11/direct2d/drawing.h"
#include "components/rendering/directx11/dw_font_loader/FontLoader.h"
#include "components/diagnostics/logger/logger.h"
#include "components/diagnostics/errors/errors.h"
#include "components/resources/cache/cache.h"
#include "components/settings/config/config.h"
#include "res/mc/errors.h"
Functions | |
HRESULT | LoadGlyph (char character, int width, int height, std::string bitmap_path, std::string format, Font *font) |
Creates a FontGlyph from the provided data. More... | |
bool | resolve_glyph_character (std::string xml_glyph, char *character) |
Identify the character of the font glyph from the XML attribute. More... | |
FontGlyphFormat | GetGlyphFormatFromString (std::string format) |
Evaluates a string into the appropriate FontGlyphFormat. More... | |
void | CleanupFontData (std::string id) |
Cleans up all data for the specified font. More... | |
Variables | |
std::map< std::string, Font > | font_list |
void CleanupFontData | ( | std::string | id | ) |
Cleans up all data for the specified font.
This is called automatically from Blam::Content::Fonts::Cleanup, and does not need to be called elsewhere.
id | - The ID of the font to reload. |
FontGlyphFormat GetGlyphFormatFromString | ( | std::string | format | ) |
Evaluates a string into the appropriate FontGlyphFormat.
format | - The glyph format |
HRESULT LoadGlyph | ( | char | character, |
int | width, | ||
int | height, | ||
std::string | bitmap_path, | ||
std::string | format, | ||
Font * | font | ||
) |
Creates a FontGlyph from the provided data.
character | - The character of the glyph |
width | - The width of the glyph image |
height | - The height of the glyph image |
bitmap_path | - The path to the glyph image file |
format | - The format of the glyph image file |
font | - Pointer to the font to add the glyph to |
S_OK
if the glyph was loaded without error, otherwise will return an error code. The following code is returned if the file was not found:
bool resolve_glyph_character | ( | std::string | xml_glyph, |
char * | character | ||
) |
Identify the character of the font glyph from the XML attribute.
xml_glyph | - The original string containing the glyph value from fontinfo.xml |
character | - Pointer to a character to set to the resolved character |
true
if the character was resolved, false
if the character could not be resolved std::map<std::string, Font> font_list |