1
0
mirror of synced 2025-01-18 00:56:49 +01:00

fix: Properly clear font name before loading

This commit is contained in:
WerWolv 2023-11-28 11:11:13 +01:00
parent 75e26458cc
commit 37ce37862a

View File

@ -252,7 +252,7 @@ namespace hex::plugin::builtin {
ranges.push_back(fontRange);
cfg.Name = { 0x00 };
std::memset(cfg.Name, 0x00, sizeof(cfg.Name));
std::strncpy(cfg.Name, font.name.c_str(), sizeof(cfg.Name) - 1);
cfg.GlyphOffset = { font.offset.x, font.offset.y };
fonts->AddFontFromMemoryTTF(font.fontData.data(), int(font.fontData.size()), 0, &cfg, ranges.back().Data);