From c4e382432bbbe8b0c6c7e9f4c753b172851b6726 Mon Sep 17 00:00:00 2001 From: BoilingTeapot <103682205+BoilingTeapot@users.noreply.github.com> Date: Sun, 15 Sep 2024 00:26:39 +0000 Subject: [PATCH] Fix glyph width computation --- src/text.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/text.cpp b/src/text.cpp index 4ebd46a7..ee473759 100644 --- a/src/text.cpp +++ b/src/text.cpp @@ -825,7 +825,7 @@ std::vector TextLayoutPlainLine( ptg.DestRect.X = currentX; ptg.DestRect.Y = pos.y; ptg.DestRect.Width = - std::floor((fontSize / font->CellHeight) * font->AdvanceWidths[ptg.CharId]); + std::floor((fontSize / font->BitmapEmWidth) * font->AdvanceWidths[ptg.CharId]); ptg.DestRect.Height = fontSize; currentX += ptg.DestRect.Width;