aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ResourceLoader.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/ResourceLoader.cpp b/src/ResourceLoader.cpp
index d503f14..dba23ac 100644
--- a/src/ResourceLoader.cpp
+++ b/src/ResourceLoader.cpp
@@ -46,6 +46,17 @@ namespace QuickMedia {
}
namespace QuickMedia::FontLoader {
+ static const char *font_type_str(FontType font_type) {
+ switch(font_type) {
+ case FontType::LATIN: return "LATIN";
+ case FontType::LATIN_BOLD: return "LATIN_BOLD";
+ case FontType::LATIN_MONOSPACE: return "LATIN_MONOSPACE";
+ case FontType::CJK: return "CJK";
+ case FontType::SYMBOLS: return "SYMBOLS";
+ default: return "UNKNOWN";
+ }
+ }
+
mgl::Font* get_font(FontType font_type, unsigned int character_size) {
// Make mgl font size match sfml font size
character_size += 5;
@@ -164,6 +175,8 @@ namespace QuickMedia::FontLoader {
mgl::Font *font = font_cache[(unsigned int)font_type][character_size].get();
if(!font) {
+ fprintf(stderr, "### Loading font type: %s, size: %d, latin font: %s, config: %p\n", font_type_str(font_type), (int)character_size, get_config().font.latin.c_str(), (void*)&get_config());
+
auto new_font = std::make_unique<mgl::Font>();
if(!new_font->load_from_file(*mapped_file, character_size)) {
fprintf(stderr, "Warning: Failed to load font at character size %u\n", character_size);