LeviLamina
Loading...
Searching...
No Matches
MSDFFont.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#include "mc/deps/minecraft_renderer/renderer/Type.h"
9
10// auto generated forward declare list
11// clang-format off
13class ScreenContext;
14class Vec2;
15namespace Core { class Path; }
16namespace mce { class Color; }
17namespace mce { class MaterialPtr; }
18namespace mce { class TextureGroup; }
19// clang-format on
20
21class MSDFFont : public ::Font {
22public:
23 // member variables
24 // NOLINTBEGIN
25 ::ll::TypedStorage<8, 32, ::Core::PathBuffer<::std::string>> mFontPagePrefix;
26 ::ll::TypedStorage<8, 64, ::std::unordered_map<int, float>> mUnicodeWidths;
27 ::ll::TypedStorage<8, 64, ::std::unordered_set<int>> mSheetScannedForWidthsAndOffsets;
28 ::ll::TypedStorage<8, 64, ::std::unordered_map<int, int>> mRemappedGlyphs;
29 // NOLINTEND
30
31public:
32 // prevent constructor by default
33 MSDFFont();
34
35public:
36 // virtual functions
37 // NOLINTBEGIN
38 virtual float _getCharWidth(int uniChar, bool forceUnicode) /*override*/;
39
40 virtual bool supportsChar(int const& character) /*override*/;
41
42 virtual float getWrapHeight() const /*override*/;
43
44 virtual float getScaleFactor() const /*override*/;
45
46 virtual bool isScreenPixelAligned() const /*override*/;
47
48 virtual bool materialCanBeOverridden() const /*override*/;
49
50 virtual void uploadTextureToGPU() /*override*/;
51
52 virtual void setTextConstantsInScreenContext(
53 ::ScreenContext& screenContext,
54 int,
55 float guiScale,
56 ::mce::Color const& textColor,
57 bool hasShadow
58 ) const /*override*/;
59
60 virtual ::Vec2 getTranslationFactor() const /*override*/;
61
62 virtual void _scanUnicodeCharacterSize(int character, int sheet, bool forceUnicode) /*override*/;
63
64 virtual bool _supportsShadowInSingleDraw() /*override*/;
65
66 virtual ::ResourceLocation _getFontSheetLocation(int sheet, bool) const /*override*/;
67
68 virtual ::mce::MaterialPtr const& getMaterial(int sheet, bool isOddGuiScale) const /*override*/;
69
70 virtual ::mce::Font::Type getType(int glyphSheet) const /*override*/;
71
72 virtual void loadFontData(bool) /*override*/;
73
74 virtual float buildChar(
75 ::std::vector<::Font::GlyphQuad>& quads,
76 int i,
77 ::mce::Color const& color,
78 bool italic,
79 float x,
80 float y,
81 bool unicode
82 ) /*override*/;
83
84 virtual ::Core::PathBuffer<::std::string>
85 getUnicodeFontNameWithPage(::Core::Path const& fontName, uchar const page) const;
86
87 virtual int _getReplacementCharacter() /*override*/;
88
89 virtual ::std::string _remapString(::std::string_view str) const /*override*/;
90
91 virtual void switchFontsource(::Core::Path const&, ::Core::Path const&) /*override*/;
92
93 virtual ::std::pair<::Core::PathBuffer<::std::string> const&, ::Core::PathBuffer<::std::string> const&>
94 getFontSources() const /*override*/;
95
96 virtual ~MSDFFont() /*override*/;
97 // NOLINTEND
98
99public:
100 // member functions
101 // NOLINTBEGIN
102 MCAPI MSDFFont(
103 ::Core::Path const& fontPagePrefix,
104 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
105 bool uploadOnConstruction
106 );
107
108 MCAPI void _loadGlyphRemappingData();
109
110 MCAPI void _loadMsdfFontInformation(::Core::Path const& fontName, uchar page);
111 // NOLINTEND
112
113public:
114 // constructor thunks
115 // NOLINTBEGIN
116 MCAPI void* $ctor(
117 ::Core::Path const& fontPagePrefix,
118 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
119 bool uploadOnConstruction
120 );
121 // NOLINTEND
122
123public:
124 // destructor thunk
125 // NOLINTBEGIN
126 MCAPI void $dtor();
127 // NOLINTEND
128
129public:
130 // virtual function thunks
131 // NOLINTBEGIN
132 MCAPI float $_getCharWidth(int uniChar, bool forceUnicode);
133
134 MCAPI bool $supportsChar(int const& character);
135
136 MCFOLD float $getWrapHeight() const;
137
138 MCFOLD float $getScaleFactor() const;
139
140 MCFOLD bool $isScreenPixelAligned() const;
141
142 MCFOLD bool $materialCanBeOverridden() const;
143
144 MCFOLD void $uploadTextureToGPU();
145
146 MCFOLD void $setTextConstantsInScreenContext(
147 ::ScreenContext& screenContext,
148 int,
149 float guiScale,
150 ::mce::Color const& textColor,
151 bool hasShadow
152 ) const;
153
154 MCAPI ::Vec2 $getTranslationFactor() const;
155
156 MCAPI void $_scanUnicodeCharacterSize(int character, int sheet, bool forceUnicode);
157
158 MCFOLD bool $_supportsShadowInSingleDraw();
159
160 MCAPI ::ResourceLocation $_getFontSheetLocation(int sheet, bool) const;
161
162 MCAPI ::mce::MaterialPtr const& $getMaterial(int sheet, bool isOddGuiScale) const;
163
164 MCFOLD ::mce::Font::Type $getType(int glyphSheet) const;
165
166 MCAPI void $loadFontData(bool);
167
168 MCAPI float $buildChar(
169 ::std::vector<::Font::GlyphQuad>& quads,
170 int i,
171 ::mce::Color const& color,
172 bool italic,
173 float x,
174 float y,
175 bool unicode
176 );
177
178 MCAPI ::Core::PathBuffer<::std::string>
179 $getUnicodeFontNameWithPage(::Core::Path const& fontName, uchar const page) const;
180
181 MCFOLD int $_getReplacementCharacter();
182
183 MCAPI ::std::string $_remapString(::std::string_view str) const;
184
185 MCAPI void $switchFontsource(::Core::Path const&, ::Core::Path const&);
186
187 MCAPI ::std::pair<::Core::PathBuffer<::std::string> const&, ::Core::PathBuffer<::std::string> const&>
188 $getFontSources() const;
189 // NOLINTEND
190
191public:
192 // vftables
193 // NOLINTBEGIN
194 MCNAPI static void** $vftable();
195 // NOLINTEND
196};
Definition Path.h:17
Definition Font.h:5
Definition MSDFFont.h:5
static MCAPI void ** $vftable()
Definition ResourceLocation.h:15
Definition ScreenContext.h:5
Definition Vec2.h:5
Definition Color.h:13
Definition MaterialPtr.h:15
Definition TextureGroup.h:7
Definition Font.h:14