23 #if defined(_DEBUG) && defined(_WINDOWS)
24 #define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
33 template class Singleton<Fonts>;
34 template class Database<Font>;
36 Fonts * Fonts::create() {
40 Fonts::Lose Fonts::g_lose;
41 Fonts::Unlose Fonts::g_unlose;
44 : Database<Font>(
"config/fonts.xml",
"Fonts")
50 vr.lend_pre_uninit(&g_lose);
51 vr.lend_post_reinit(&g_unlose);
64 Font * Fonts::load(XML_Element_c &xml_element,
const String &,
const String &) {
65 const String filepath = xml_element[
"filepath"].to_string();
66 const float height = xml_element[
"height"].to_float();
68 const float screen_height = float(
get_Window().get_height());
69 float virtual_screen_height = screen_height;
70 XML_Element_c virtual_screen = xml_element[
"virtual_screen"];
71 if(virtual_screen.good()) {
72 XML_Element_c vsw = virtual_screen[
"width"];
73 XML_Element_c vsh = virtual_screen[
"height"];
79 virtual_screen_height = vsh.to_float();
81 if(vsw_ratio > virtual_screen_height / screen_height)
82 virtual_screen_height = vsw_ratio * screen_height;
85 virtual_screen_height = vsw_ratio * screen_height;
88 virtual_screen_height = vsh.to_float();
static const int & get_width()
Get the size of the window.
A Font database read in from a file.
EGLSurface EGLint EGLint EGLint EGLint height
virtual Font * create_Font(const String &filename, const float &glyph_height, const float &virtual_screen_height)=0
Function for creating a Font; used internally by Fonts.
static void remove_pre_uninit(Event::Handler *const &handler)
Window & get_Window()
Get access to the singleton.
Fonts & get_Fonts()
Get access to the singleton.
Video & get_Video()
Get access to the singleton.