1
0
mirror of synced 2025-03-03 16:34:19 +01:00

fix: Properly scale unifont glyphs

This commit is contained in:
WerWolv 2025-01-26 14:21:17 +01:00
parent 8334fbb236
commit 403104dda1

View File

@ -88,7 +88,10 @@ namespace hex::fonts {
const ImVec2 offset = { font.offset.x, font.offset.y - (defaultFont->getDescent() - fontAtlas->calculateFontDescend(font, fontSize)) };
// Load the font
fontAtlas->addFontFromMemory(font.fontData, font.defaultSize.value_or(fontSize), !font.defaultSize.has_value(), offset, glyphRanges.back());
float size = fontSize;
if (font.defaultSize.has_value())
size = font.defaultSize.value() * ImHexApi::System::getBackingScaleFactor();
fontAtlas->addFontFromMemory(font.fontData, size, !font.defaultSize.has_value(), offset, glyphRanges.back());
}
}