1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Add font loading tracking to log

This commit is contained in:
Ivan Savenko
2024-09-28 19:30:26 +00:00
parent 532ed9b12c
commit 51848ced3b
3 changed files with 16 additions and 0 deletions

View File

@@ -212,6 +212,12 @@ CBitmapFont::CBitmapFont(const std::string & filename):
SDL_FreeSurface(atlasImage);
atlasImage = scaledSurface;
}
logGlobal->debug("Loaded BMP font: '%s', height %d, ascent %d",
filename,
getLineHeightScaled(),
getFontAscentScaled()
);
}
CBitmapFont::~CBitmapFont()

View File

@@ -73,6 +73,14 @@ CTrueTypeFont::CTrueTypeFont(const JsonNode & fontConfig):
TTF_SetFontStyle(font.get(), getFontStyle(fontConfig));
TTF_SetFontHinting(font.get(),TTF_HINTING_MONO);
logGlobal->debug("Loaded TTF font: '%s', point size %d, height %d, ascent %d, descent %d, line skip %d",
fontConfig["file"].String(),
getPointSize(fontConfig["size"]),
TTF_FontHeight(font.get()),
TTF_FontAscent(font.get()),
TTF_FontDescent(font.get()),
TTF_FontLineSkip(font.get())
);
}
CTrueTypeFont::~CTrueTypeFont() = default;

View File

@@ -342,6 +342,8 @@ std::shared_ptr<const IFont> RenderHandler::loadFont(EFonts font)
return fonts.at(font);
const int8_t index = static_cast<int8_t>(font);
logGlobal->debug("Loading font %d", static_cast<int>(index));
auto configList = CResourceHandler::get()->getResourcesWithName(JsonPath::builtin("config/fonts.json"));
std::shared_ptr<FontChain> loadedFont = std::make_shared<FontChain>();
std::string bitmapPath;