|
@@ -2850,6 +2850,13 @@ static void ImFontAtlasBuildRenderLinesTexData(ImFontAtlas* atlas)
|
|
|
// Note: this is called / shared by both the stb_truetype and the FreeType builder
|
|
|
void ImFontAtlasBuildInit(ImFontAtlas* atlas)
|
|
|
{
|
|
|
+ // Round font size
|
|
|
+ // - We started rounding in 1.90 WIP (18991) as our layout system currently doesn't support non-rounded font size well yet.
|
|
|
+ // - Note that using io.FontGlobalScale or SetWindowFontScale(), with are legacy-ish, partially supported features, can still lead to unrounded sizes.
|
|
|
+ // - We may support it better later and remove this rounding.
|
|
|
+ for (ImFontConfig& cfg : atlas->ConfigData)
|
|
|
+ cfg.SizePixels = ImFloor(cfg.SizePixels);
|
|
|
+
|
|
|
// Register texture region for mouse cursors or standard white pixels
|
|
|
if (atlas->PackIdMouseCursors < 0)
|
|
|
{
|