aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Xbox/Font/XUI_FontRenderer.h
diff options
context:
space:
mode:
authordaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
committerdaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
commitb691c43c44ff180d10e7d4a9afc83b98551ff586 (patch)
tree3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.Client/Xbox/Font/XUI_FontRenderer.h
parentdef8cb415354ac390b7e89052a50605285f1aca9 (diff)
Initial commit
Diffstat (limited to 'Minecraft.Client/Xbox/Font/XUI_FontRenderer.h')
-rw-r--r--Minecraft.Client/Xbox/Font/XUI_FontRenderer.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/Minecraft.Client/Xbox/Font/XUI_FontRenderer.h b/Minecraft.Client/Xbox/Font/XUI_FontRenderer.h
new file mode 100644
index 00000000..cffe2ed1
--- /dev/null
+++ b/Minecraft.Client/Xbox/Font/XUI_FontRenderer.h
@@ -0,0 +1,49 @@
+#pragma once
+using namespace std;
+class XUI_FontData;
+class XUI_Font;
+
+// Define this to use this class as the XUI font renderer
+#define OVERRIDE_XUI_FONT_RENDERER
+
+//#define USE_SCALING_FONT
+
+class XUI_FontRenderer : public IXuiFontRenderer
+{
+protected:
+ enum eFontData
+ {
+ eFontData_MIN = 0,
+ eFontData_Mojangles_7 = 0,
+ eFontData_Mojangles_11,
+ eFontData_MAX
+ };
+
+ // The font data is the image and size/coords data
+ XUI_FontData *m_loadedFontData[eFontData_MAX];
+
+ // The XUI_Font is a temporary instance that is around as long as XUI needs it, but does the actual rendering
+ // These can be chained
+ unordered_map<float, XUI_Font *> m_loadedFonts[eFontData_MAX];
+
+public:
+ XUI_FontRenderer();
+
+ // 4J - IXuiFontRenderer interface
+ virtual HRESULT STDMETHODCALLTYPE Init( float fDpi );
+ virtual VOID STDMETHODCALLTYPE Term();
+ virtual HRESULT STDMETHODCALLTYPE GetCaps( DWORD * pdwCaps );
+ virtual HRESULT STDMETHODCALLTYPE CreateFont( const TypefaceDescriptor * pTypefaceDescriptor,
+ float fPointSize, DWORD dwStyle, DWORD dwReserved, HFONTOBJ * phFont );
+ virtual VOID STDMETHODCALLTYPE ReleaseFont( HFONTOBJ hFont );
+ virtual HRESULT STDMETHODCALLTYPE GetFontMetrics( HFONTOBJ hFont, XUIFontMetrics *pFontMetrics );
+ virtual HRESULT STDMETHODCALLTYPE GetCharMetrics( HFONTOBJ hFont, WCHAR wch,
+ XUICharMetrics *pCharMetrics );
+ virtual HRESULT STDMETHODCALLTYPE DrawCharToTexture( HFONTOBJ hFont, WCHAR wch, HXUIDC hDC,
+ IXuiTexture * pTexture, UINT x, UINT y, UINT width, UINT height,
+ UINT insetX, UINT insetY );
+ virtual HRESULT STDMETHODCALLTYPE DrawCharsToDevice( HFONTOBJ hFont, CharData * pCharData,
+ DWORD dwCount, RECT *pClipRect, HXUIDC hDC,
+ D3DXMATRIX * pWorldViewProj );
+
+}; \ No newline at end of file