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:
@@ -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()
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user