Add font engine aware of Gui.scale

This commit enhances text rendering by leveraging FreeType and a dynamic
font atlas. Previously, GUI scaling relied on bitmap fonts, which led to
blurry and distorted text when scaling up. Now, we scale the font size
directly using FreeType, resulting in much sharper and more readable
text at any GUI scale.

Key improvements:
- Replaced bitmap font scaling with true font size scaling via FreeType.
- Reduced glyph cache dependency on fixed positions, relying on shader
  scaling instead.
- Switched to float-based glyph positioning for more accurate rendering
  and scaling.

These changes ensure clean and consistent text appearance across
different GUI scales.
This commit is contained in:
trompetin17
2025-05-16 18:02:40 -05:00
parent 189ec6a7eb
commit bdd94bd264
16 changed files with 155 additions and 123 deletions
+2 -2
View File
@@ -87,8 +87,8 @@ int GetFps()
CSize2D GetTextSize(const std::string& fontName, const std::wstring& text)
{
int width = 0;
int height = 0;
float width = 0;
float height = 0;
CStrIntern _fontName(fontName);
CFontMetrics fontMetrics(_fontName);
fontMetrics.CalculateStringSize(text.c_str(), width, height);