diff options
| author | Kevin <115616336+lag@users.noreply.github.com> | 2026-03-06 09:52:28 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-06 09:52:28 -0600 |
| commit | ea65542c1b63d7ee37025837bf205e55ace0c863 (patch) | |
| tree | 0ba5abdfdbf055d11bd85a460b98b51f2c9c9904 /Minecraft.Client/Font.h | |
| parent | 1755cd58bebf19053c6b4bbf9915b07237e1c14e (diff) | |
Add Chat / Pastes / Formatting (#682)
* Initial fixes for ContainerSetSlotPacket and CraftItemPacket
* Chat: paste, history, § formatting, 1-9 block when open (Windows64)
Made-with: Cursor
* static_cast refactor
Diffstat (limited to 'Minecraft.Client/Font.h')
| -rw-r--r-- | Minecraft.Client/Font.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Minecraft.Client/Font.h b/Minecraft.Client/Font.h index 18d9bf91..3d25880d 100644 --- a/Minecraft.Client/Font.h +++ b/Minecraft.Client/Font.h @@ -21,6 +21,12 @@ private: float xPos; float yPos; + // § format state (bold, italic, underline, strikethrough); set during draw(), reset by §r + bool m_bold; + bool m_italic; + bool m_underline; + bool m_strikethrough; + bool enforceUnicodeSheet; // use unicode sheet for ascii bool bidirectional; // use bidi to flip strings @@ -41,9 +47,11 @@ public: private: void renderCharacter(wchar_t c); // 4J added + void renderStyleLine(float x0, float y0, float x1, float y1); // solid line for underline/strikethrough public: void drawShadow(const wstring& str, int x, int y, int color); + void drawShadowLiteral(const wstring& str, int x, int y, int color); // draw without interpreting § codes void drawShadowWordWrap(const wstring &str, int x, int y, int w, int color, int h); // 4J Added h param void draw(const wstring &str, int x, int y, int color); /** @@ -58,11 +66,13 @@ private: void draw(const wstring &str, bool dropShadow); 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 bool CharacterExists(wchar_t c); // 4J added public: int width(const wstring& str); + int widthLiteral(const wstring& str); // width without skipping § codes (for chat input) wstring sanitize(const wstring& str); void drawWordWrap(const wstring &string, int x, int y, int w, int col, int h); // 4J Added h param |
