LeviLamina
Loading...
Searching...
No Matches
FontAlias.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/client/gui/FontHandle.h"
8#include "mc/deps/core/file/PathBuffer.h"
9#include "mc/deps/core/utility/NonOwnerPointer.h"
10#include "mc/deps/minecraft_renderer/renderer/Type.h"
11
12// auto generated forward declare list
13// clang-format off
15class ScreenContext;
16namespace Core { class Path; }
17namespace mce { class Color; }
18namespace mce { class MaterialPtr; }
19namespace mce::Font { struct RenderingParameters; }
20// clang-format on
21
22class FontAlias : public ::Font {
23public:
24 // FontAlias inner types declare
25 // clang-format off
26 struct ReferenceData;
27 // clang-format on
28
29 // FontAlias inner types define
30 struct ReferenceData {
31 public:
32 // member variables
33 // NOLINTBEGIN
34 ::ll::TypedStorage<8, 80, ::FontHandle> mFontHandle;
35 ::ll::TypedStorage<8, 32, ::std::string> mLanguageCode;
36 ::ll::TypedStorage<8, 24, ::std::vector<::std::pair<int, int>>> mIncludedUnicodeRanges;
37 ::ll::TypedStorage<4, 4, float> mFontScale;
38 // NOLINTEND
39 };
40
41public:
42 // member variables
43 // NOLINTBEGIN
44 ::ll::TypedStorage<8, 24, ::std::vector<::FontAlias::ReferenceData>> mFontReferences;
45 ::ll::TypedStorage<8, 32, ::std::string> mCurrentLanguageCode;
46 ::ll::TypedStorage<1, 1, bool> mAllReferencesMaterialsCanBeOverridden;
47 ::ll::TypedStorage<1, 1, bool> mAllReferencesScreenPixelAligned;
48 ::ll::TypedStorage<1, 1, bool> mAllReferencesSupportShadowInSingleDraw;
49 ::ll::TypedStorage<4, 4, float> mMaxWrapHeight;
50 ::ll::TypedStorage<4, 4, float> mMaxScalar;
51 // NOLINTEND
52
53public:
54 // virtual functions
55 // NOLINTBEGIN
56 virtual ~FontAlias() /*override*/ = default;
57
58 virtual float _getCharWidth(int uniChar, bool forceUnicode) /*override*/;
59
60 virtual bool supportsChar(int const& character) /*override*/;
61
62 virtual float getWrapHeight() const /*override*/;
63
64 virtual float getScaleFactor() const /*override*/;
65
66 virtual float getScaleFactor(int uniChar) const /*override*/;
67
68 virtual bool isScreenPixelAligned() const /*override*/;
69
70 virtual bool materialCanBeOverridden() const /*override*/;
71
72 virtual void setTextConstantsInScreenContext(
73 ::ScreenContext& screenContext,
74 int glyphSheet,
75 float guiScale,
76 ::mce::Color const& textColor,
77 bool hasShadow
78 ) const /*override*/;
79
80 virtual void uploadTextureToGPU() /*override*/;
81
82 virtual ::ResourceLocation _getFontSheetLocation(int sheet, bool forceUnicode) const /*override*/;
83
84 virtual ::mce::MaterialPtr const& getMaterial(int sheet, bool isOddGuiScale) const /*override*/;
85
86 virtual ::mce::Font::Type getType(int glyphSheet) const /*override*/;
87
88 virtual ::std::optional<::mce::Font::RenderingParameters> tryGetRenderingParameters(
89 ::ScreenContext const& screenContext,
90 int glyphSheet,
91 float guiScale,
92 ::mce::Color const& textColor,
93 bool hasShadow,
94 uint textureWidth,
95 uint textureHeight
96 ) const /*override*/;
97
98 virtual void loadFontData(bool uploadTextureImmediately) /*override*/;
99
100 virtual bool _supportsShadowInSingleDraw() /*override*/;
101
102 virtual void onLanguageChanged(::std::string_view languageCode) /*override*/;
103
104 virtual void _scanUnicodeCharacterSize(int character, int sheet, bool forceUnicode) /*override*/;
105
106 virtual float buildChar(
107 ::std::vector<::Font::GlyphQuad>& quads,
108 int i,
109 ::mce::Color const& color,
110 bool italic,
111 float x,
112 float y,
113 bool unicode
114 ) /*override*/;
115
116 virtual ::std::string _remapString(::std::string_view str) const /*override*/;
117
118 virtual void switchFontsource(::Core::Path const& asciiName, ::Core::Path const& unicodeName) /*override*/;
119
120 virtual ::std::pair<::Core::PathBuffer<::std::string> const&, ::Core::PathBuffer<::std::string> const&>
121 getFontSources() const /*override*/;
122 // NOLINTEND
123
124public:
125 // member functions
126 // NOLINTBEGIN
127 MCAPI ::Bedrock::NotNullNonOwnerPtr<::FontHandle const> getFontReferenceForSheet(int const& sheet) const;
128
129 MCAPI ::Bedrock::NotNullNonOwnerPtr<::FontHandle const> getFontReferenceForUnicode(int const& character) const;
130 // NOLINTEND
131
132public:
133 // virtual function thunks
134 // NOLINTBEGIN
135 MCAPI float $_getCharWidth(int uniChar, bool forceUnicode);
136
137 MCAPI bool $supportsChar(int const& character);
138
139 MCAPI float $getWrapHeight() const;
140
141 MCAPI float $getScaleFactor() const;
142
143 MCAPI float $getScaleFactor(int uniChar) const;
144
145 MCAPI bool $isScreenPixelAligned() const;
146
147 MCAPI bool $materialCanBeOverridden() const;
148
149 MCAPI void $setTextConstantsInScreenContext(
150 ::ScreenContext& screenContext,
151 int glyphSheet,
152 float guiScale,
153 ::mce::Color const& textColor,
154 bool hasShadow
155 ) const;
156
157 MCFOLD void $uploadTextureToGPU();
158
159 MCAPI ::ResourceLocation $_getFontSheetLocation(int sheet, bool forceUnicode) const;
160
161 MCAPI ::mce::MaterialPtr const& $getMaterial(int sheet, bool isOddGuiScale) const;
162
163 MCAPI ::mce::Font::Type $getType(int glyphSheet) const;
164
165 MCAPI ::std::optional<::mce::Font::RenderingParameters> $tryGetRenderingParameters(
166 ::ScreenContext const& screenContext,
167 int glyphSheet,
168 float guiScale,
169 ::mce::Color const& textColor,
170 bool hasShadow,
171 uint textureWidth,
172 uint textureHeight
173 ) const;
174
175 MCFOLD void $loadFontData(bool uploadTextureImmediately);
176
177 MCAPI bool $_supportsShadowInSingleDraw();
178
179 MCAPI void $onLanguageChanged(::std::string_view languageCode);
180
181 MCAPI void $_scanUnicodeCharacterSize(int character, int sheet, bool forceUnicode);
182
183 MCAPI float $buildChar(
184 ::std::vector<::Font::GlyphQuad>& quads,
185 int i,
186 ::mce::Color const& color,
187 bool italic,
188 float x,
189 float y,
190 bool unicode
191 );
192
193 MCAPI ::std::string $_remapString(::std::string_view str) const;
194
195 MCAPI void $switchFontsource(::Core::Path const& asciiName, ::Core::Path const& unicodeName);
196
197 MCAPI ::std::pair<::Core::PathBuffer<::std::string> const&, ::Core::PathBuffer<::std::string> const&>
198 $getFontSources() const;
199 // NOLINTEND
200};
Definition Path.h:11
Definition FontAlias.h:5
Definition Font.h:5
Definition ResourceLocation.h:15
Definition ScreenContext.h:5
Definition Color.h:13
Definition MaterialPtr.h:14
Definition FontAlias.h:13
Definition Font.h:15
Definition RenderingParameters.h:7