From be7e2ca91d7013ac6b4a9b2333ebf008fd5b7f10 Mon Sep 17 00:00:00 2001 From: Ayush Thoren Date: Sat, 21 Mar 2026 21:33:35 -0700 Subject: Fix font rendering for color and formatting codes (#1017) * Fix "Colormatic" splash text rendering as single color Signed-off-by: Ayush Thoren * Use per-vertex coloring in a single batch Signed-off-by: Ayush Thoren * Fix font rendering for color and formatting codes Signed-off-by: Ayush Thoren --------- Signed-off-by: Ayush Thoren --- Minecraft.Client/Font.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Minecraft.Client/Font.h') diff --git a/Minecraft.Client/Font.h b/Minecraft.Client/Font.h index c78ea678..58bceb4c 100644 --- a/Minecraft.Client/Font.h +++ b/Minecraft.Client/Font.h @@ -38,7 +38,7 @@ private: std::map m_charMap; public: - Font(Options *options, const wstring& name, Textures* textures, bool enforceUnicode, ResourceLocation *textureLocation, int cols, int rows, int charWidth, int charHeight, unsigned short charMap[] = nullptr); + Font(Options *options, const wstring& name, Textures* textures, bool enforceUnicode, ResourceLocation *textureLocation, int cols, int rows, int charWidth, int charHeight, unsigned short charMap[] = nullptr); #ifndef _XBOX // 4J Stu - This dtor clashes with one in xui! We never delete these anyway so take it out for now. Can go back when we have got rid of XUI ~Font(); @@ -48,6 +48,8 @@ public: private: void renderCharacter(wchar_t c); // 4J added void addCharacterQuad(wchar_t c); + void addSolidQuad(float x0, float y0, float x1, float y1); + void emitCharacterGeometry(wchar_t c); void renderStyleLine(float x0, float y0, float x1, float y1); // solid line for underline/strikethrough public: @@ -65,7 +67,7 @@ public: private: wstring reorderBidi(const wstring &str); - void draw(const wstring &str, bool dropShadow); + void draw(const wstring &str, bool dropShadow, int baseColor); void draw(const wstring& str, int x, int y, int color, bool dropShadow); void drawLiteral(const wstring& str, int x, int y, int color); // no ยง parsing int MapCharacter(wchar_t c); // 4J added -- cgit v1.2.3