diff options
| author | Ayush Thoren <ayushthoren@gmail.com> | 2026-03-21 21:33:35 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-22 00:33:35 -0400 |
| commit | be7e2ca91d7013ac6b4a9b2333ebf008fd5b7f10 (patch) | |
| tree | ded6005aa37e14322bcbbe3e77ac4877ee2fac34 /Minecraft.Client/Font.h | |
| parent | 250accd40bbe162a790248be742e39866e5d8901 (diff) | |
Fix font rendering for color and formatting codes (#1017)
* Fix "Colormatic" splash text rendering as single color
Signed-off-by: Ayush Thoren <ayushthoren@gmail.com>
* Use per-vertex coloring in a single batch
Signed-off-by: Ayush Thoren <ayushthoren@gmail.com>
* Fix font rendering for color and formatting codes
Signed-off-by: Ayush Thoren <ayushthoren@gmail.com>
---------
Signed-off-by: Ayush Thoren <ayushthoren@gmail.com>
Diffstat (limited to 'Minecraft.Client/Font.h')
| -rw-r--r-- | Minecraft.Client/Font.h | 6 |
1 files changed, 4 insertions, 2 deletions
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<int, int> 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 |
