Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
BitmapFont.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/gui/Font.h"
7#include "mc/deps/core/file/PathBuffer.h"
8
9// auto generated forward declare list
10// clang-format off
12namespace Core { class Path; }
13namespace mce { class Color; }
14namespace mce { class MaterialPtr; }
15namespace mce { class TextureGroup; }
16namespace mce { struct Image; }
17// clang-format on
18
19class BitmapFont : public ::Font {
20public:
21 // member variables
22 // NOLINTBEGIN
23 ::ll::TypedStorage<8, 32, ::Core::PathBuffer<::std::string>> mAsciiFontName;
24 ::ll::TypedStorage<8, 32, ::Core::PathBuffer<::std::string>> mUnicodeFontName;
25 ::ll::TypedStorage<1, 1, uchar> mAsciiSheetCount;
26 ::ll::TypedStorage<1, 1, uchar> mAsciiCharacterHeight;
27 ::ll::TypedStorage<4, 4, int> mAsciiCharacterYOffset;
28 ::ll::TypedStorage<1, 1, bool> mUseExtendedAscii;
29 ::ll::TypedStorage<8, 64, ::std::unordered_map<int, ::std::array<float, 256>>> mCharWidths;
30 ::ll::TypedStorage<8, 64, ::std::unordered_map<int, ::std::shared_ptr<::mce::Image>>> mBitmapFontImages;
31 ::ll::TypedStorage<8, 64, ::std::unordered_map<int, float>> mUnicodeWidths;
32 ::ll::TypedStorage<8, 64, ::std::unordered_map<int, float>> mUnicodeOffsets;
33 ::ll::TypedStorage<8, 64, ::std::unordered_map<int, float>> mUnicodePageGlyphWidths;
34 ::ll::TypedStorage<8, 64, ::std::unordered_set<int>> mSheetScannedForWidthsAndOffsets;
35 // NOLINTEND
36
37public:
38 // prevent constructor by default
39 BitmapFont& operator=(BitmapFont const&);
40 BitmapFont();
41
42public:
43 // virtual functions
44 // NOLINTBEGIN
45 virtual ~BitmapFont() /*override*/ = default;
46
47 virtual float _getCharWidth(int uniChar, bool forceUnicode) /*override*/;
48
49 virtual bool supportsChar(int const& character) /*override*/;
50
51 virtual float getWrapHeight() const /*override*/;
52
53 virtual float getScaleFactor(int c) const /*override*/;
54
55 virtual float getScaleFactor() const /*override*/;
56
57 virtual bool isScreenPixelAligned() const /*override*/;
58
59 virtual bool materialCanBeOverridden() const /*override*/;
60
61 virtual void uploadTextureToGPU() /*override*/;
62
63 virtual void _scanUnicodeCharacterSize(int character, int sheet, bool forceUnicode) /*override*/;
64
65 virtual bool _supportsShadowInSingleDraw() /*override*/;
66
67 virtual ::ResourceLocation _getFontSheetLocation(int sheet, bool forceUnicode) const /*override*/;
68
69 virtual ::mce::MaterialPtr const& getMaterial(int sheet, bool isOddGuiScale) const /*override*/;
70
71 virtual float getGlyphHeight(int glyphSheet, bool isUnicode) const /*override*/;
72
73 virtual void loadFontData(bool uploadTextureImmediately) /*override*/;
74
75 virtual float buildChar(
76 ::std::vector<::Font::GlyphQuad>& quads,
77 int i,
78 ::mce::Color const& color,
79 bool italic,
80 float x,
81 float y,
82 bool unicode
83 ) /*override*/;
84
85 virtual ::Core::PathBuffer<::std::string>
86 getUnicodeFontNameWithPage(::Core::Path const& fontName, uchar const page) const;
87
88 virtual void switchFontsource(::Core::Path const& asciiName, ::Core::Path const& unicodeName) /*override*/;
89
90 virtual ::std::pair<::Core::PathBuffer<::std::string> const&, ::Core::PathBuffer<::std::string> const&>
91 getFontSources() const /*override*/;
92
93 virtual uchar _getAsciiSheetCount() const /*override*/;
94
95 virtual int _getAsciiGlyphsPerPage() const /*override*/;
96
97 virtual bool _usesLegacyAsciiMapping() const /*override*/;
98 // NOLINTEND
99
100public:
101 // member functions
102 // NOLINTBEGIN
103 MCNAPI BitmapFont(::BitmapFont const& rhs);
104
105 MCNAPI BitmapFont(
106 ::Core::Path const& asciiName,
107 ::Core::Path const& unicodeName,
108 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
109 uchar asciiSheetCount,
110 bool uploadOnConstruction
111 );
112
113 MCNAPI ::Core::PathBuffer<::std::string> getAsciiFontNameWithPage(uchar const page) const;
114 // NOLINTEND
115
116public:
117 // constructor thunks
118 // NOLINTBEGIN
119 MCNAPI void* $ctor(::BitmapFont const& rhs);
120
121 MCNAPI void* $ctor(
122 ::Core::Path const& asciiName,
123 ::Core::Path const& unicodeName,
124 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
125 uchar asciiSheetCount,
126 bool uploadOnConstruction
127 );
128 // NOLINTEND
129
130public:
131 // virtual function thunks
132 // NOLINTBEGIN
133 MCNAPI float $_getCharWidth(int uniChar, bool forceUnicode);
134
135 MCNAPI bool $supportsChar(int const& character);
136
137 MCNAPI float $getWrapHeight() const;
138
139 MCNAPI float $getScaleFactor(int c) const;
140
141 MCNAPI float $getScaleFactor() const;
142
143 MCNAPI bool $isScreenPixelAligned() const;
144
145 MCNAPI bool $materialCanBeOverridden() const;
146
147 MCNAPI void $uploadTextureToGPU();
148
149 MCNAPI void $_scanUnicodeCharacterSize(int character, int sheet, bool forceUnicode);
150
152
153 MCNAPI ::ResourceLocation $_getFontSheetLocation(int sheet, bool forceUnicode) const;
154
155 MCNAPI ::mce::MaterialPtr const& $getMaterial(int sheet, bool isOddGuiScale) const;
156
157 MCNAPI float $getGlyphHeight(int glyphSheet, bool isUnicode) const;
158
159 MCNAPI void $loadFontData(bool uploadTextureImmediately);
160
161 MCNAPI float $buildChar(
162 ::std::vector<::Font::GlyphQuad>& quads,
163 int i,
164 ::mce::Color const& color,
165 bool italic,
166 float x,
167 float y,
168 bool unicode
169 );
170
171 MCNAPI ::Core::PathBuffer<::std::string>
172 $getUnicodeFontNameWithPage(::Core::Path const& fontName, uchar const page) const;
173
174 MCNAPI void $switchFontsource(::Core::Path const& asciiName, ::Core::Path const& unicodeName);
175
176 MCNAPI ::std::pair<::Core::PathBuffer<::std::string> const&, ::Core::PathBuffer<::std::string> const&>
178
179 MCNAPI uchar $_getAsciiSheetCount() const;
180
181 MCNAPI int $_getAsciiGlyphsPerPage() const;
182
183 MCNAPI bool $_usesLegacyAsciiMapping() const;
184 // NOLINTEND
185};
Definition BitmapFont.h:5
MCAPI ::Core::PathBuffer<::std::string > $getUnicodeFontNameWithPage(::Core::Path const &fontName, uchar const page) const
MCAPI int $_getAsciiGlyphsPerPage() const
MCAPI void $switchFontsource(::Core::Path const &asciiName, ::Core::Path const &unicodeName)
MCAPI::mce::MaterialPtr const & $getMaterial(int sheet, bool isOddGuiScale) const
MCAPI ::Core::PathBuffer<::std::string > getAsciiFontNameWithPage(uchar const page) const
MCAPI float $_getCharWidth(int uniChar, bool forceUnicode)
MCAPI ::std::pair<::Core::PathBuffer<::std::string > const &, ::Core::PathBuffer<::std::string > const & > $getFontSources() const
MCAPI float $getScaleFactor(int c) const
MCAPI::ResourceLocation $_getFontSheetLocation(int sheet, bool forceUnicode) const
MCAPI bool $materialCanBeOverridden() const
MCAPI bool $_supportsShadowInSingleDraw()
MCAPI void $loadFontData(bool uploadTextureImmediately)
MCAPI void * $ctor(::BitmapFont const &rhs)
MCAPI float $getGlyphHeight(int glyphSheet, bool isUnicode) const
MCAPI float $buildChar(::std::vector<::Font::GlyphQuad > &quads, int i, ::mce::Color const &color, bool italic, float x, float y, bool unicode)
MCAPI void $uploadTextureToGPU()
MCAPI bool $_usesLegacyAsciiMapping() const
MCAPI void $_scanUnicodeCharacterSize(int character, int sheet, bool forceUnicode)
MCAPI bool $isScreenPixelAligned() const
MCAPI float $getWrapHeight() const
MCAPI bool $supportsChar(int const &character)
MCAPI uchar $_getAsciiSheetCount() const
Definition Path.h:10
Definition Font.h:5
Definition Path.h:16
Definition ResourceLocation.h:15
Definition Color.h:13
Definition MaterialPtr.h:14
Definition TextureGroup.h:7
STL namespace.
Definition Font.h:15
Definition Image.h:13