LeviLamina
Loading...
Searching...
No Matches
FontRepository.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/gui/FontHandle.h"
7#include "mc/deps/application/AppPlatformListener.h"
8#include "mc/deps/core/threading/Async.h"
9#include "mc/deps/core/utility/EnableNonOwnerReferences.h"
10#include "mc/deps/core/utility/NonOwnerPointer.h"
11
12// auto generated forward declare list
13// clang-format off
14class Font;
17namespace Core { class Path; }
18namespace mce { class TextureGroup; }
19// clang-format on
20
22public:
23 // FontRepository inner types define
24 using NonNullFontPtr = ::gsl::not_null<::std::shared_ptr<::Font>>;
25
26public:
27 // member variables
28 // NOLINTBEGIN
29 ::ll::TypedStorage<1, 1, bool> mIsInitialized;
30 ::ll::TypedStorage<8, 24, ::std::vector<::gsl::not_null<::std::shared_ptr<::Font>>>> mLoadedFonts;
31 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, uint64>> mFontNameToIdentifier;
32 ::ll::TypedStorage<8, 8, uint64> mDefaultFontId;
33 ::ll::TypedStorage<8, 8, uint64> mRuneFontId;
34 ::ll::TypedStorage<8, 8, uint64> mUnicodeFontId;
35 ::ll::TypedStorage<8, 8, uint64> mSmoothFontLatinFontId;
36 ::ll::TypedStorage<8, 8, uint64> mSmoothFontWithHangulFallbackFontId;
37 ::ll::TypedStorage<8, 8, uint64> mUIFontId;
38 ::ll::TypedStorage<8, 8, uint64> mSmoothSmallFontID;
39 ::ll::TypedStorage<8, 80, ::FontHandle> mFontHandle;
40 ::ll::TypedStorage<8, 80, ::FontHandle> mRuneFontHandle;
41 ::ll::TypedStorage<8, 80, ::FontHandle> mUnicodeFontHandle;
42 ::ll::TypedStorage<8, 80, ::FontHandle> mSmoothFontLatinHandle;
43 ::ll::TypedStorage<8, 80, ::FontHandle> mUIFontHandle;
44 ::ll::TypedStorage<8, 64, ::std::unordered_map<uint64, ::std::shared_ptr<::Font>>> mOriginalMinecraftFonts;
45 ::ll::TypedStorage<8, 64, ::std::unordered_map<uint64, ::std::shared_ptr<::Font>>> mOverriddenFonts;
46 ::ll::TypedStorage<8, 24, ::std::vector<::Bedrock::Threading::Async<void>>> mFontLoadingTaskTrackers;
47 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::mce::TextureGroup>> mFontTextureGroup;
48 ::ll::TypedStorage<8, 32, ::std::string> mLanguageCode;
49 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::ResourceLoadManager>> mResourceLoadManager;
50 ::ll::TypedStorage<1, 1, bool> mIsOnLowMemoryDevice;
51 ::ll::TypedStorage<1, 1, bool> mHasLoggedFontLoadFailure;
52 ::ll::TypedStorage<1, 1, bool> mHasLoggedMissingSmoothFontWithHangulFallback;
53 // NOLINTEND
54
55public:
56 // prevent constructor by default
57 FontRepository();
58
59public:
60 // virtual functions
61 // NOLINTBEGIN
62 virtual ~FontRepository() /*override*/ = default;
63
64 virtual void onAppSuspended() /*override*/;
65
66 virtual void onDeviceLost() /*override*/;
67 // NOLINTEND
68
69public:
70 // member functions
71 // NOLINTBEGIN
72 MCAPI FontRepository(::Bedrock::NotNullNonOwnerPtr<::ResourceLoadManager> manager, bool isOnLowMemoryDevice);
73
74 MCAPI void _queueBitmapFont(
75 ::std::string const& alias,
76 ::Core::Path const& asciiName,
77 ::Core::Path const& unicodeName,
78 ::std::weak_ptr<::mce::TextureGroup> textureGroupWeakPtr
79 );
80
81 MCAPI void _queueMsdfFont(
82 ::std::string const& alias,
83 ::Core::Path const& fontPagePrefix,
84 ::std::weak_ptr<::mce::TextureGroup> textureGroupWeakPtr
85 );
86
87 MCAPI void _setDefaultFont(::std::string const& fontName, uint64 const fontId, ::std::shared_ptr<::Font> font);
88
89 MCAPI void _setFontIfOverride(uint64 const fontId, ::std::shared_ptr<::Font> font);
90
91 MCAPI void
92 _setMinecraftSmoothFontStyle(float guiScale, ::std::string const& languageCode, bool supportsCjkSmoothFont);
93
94 MCAPI uint64 addPreloadedFont(::std::string const& fontName, ::gsl::not_null<::std::shared_ptr<::Font>> font);
95
96 MCAPI ::FontHandle getFontFromFontType(::std::string const& fontType) const;
97
98 MCAPI ::FontHandle getFontHandle(uint64 const fontId);
99
100 MCAPI uint64 getFontIdentifier(::std::string const& fontName);
101
102 MCAPI ::std::vector<::ResourceLocation> getReloadFontTextures() const;
103
104 MCAPI bool haveDefaultFontsLoaded();
105
106 MCAPI void initDefaultFontHandles();
107
108 MCAPI bool isRepositoryInitialized();
109
110 MCAPI void loadDefaultFonts(::std::shared_ptr<::mce::TextureGroup> textureGroup);
111
112 MCAPI void onLanguageChanged(::std::string const& languageCode);
113
114 MCAPI void parseAndLoadMetadataFonts(::std::shared_ptr<::mce::TextureGroup> textureGroup);
115
116 MCAPI void reloadFontTextures(bool blockingLoad);
117
118 MCAPI void setMinecraftUIFontStyle(::std::string const& languageCode);
119
120 MCAPI void setUseFontOverrides(bool useOverrides);
121 // NOLINTEND
122
123public:
124 // static variables
125 // NOLINTBEGIN
126 MCAPI static uint64& INVALID_FONT();
127 // NOLINTEND
128
129public:
130 // constructor thunks
131 // NOLINTBEGIN
132 MCAPI void* $ctor(::Bedrock::NotNullNonOwnerPtr<::ResourceLoadManager> manager, bool isOnLowMemoryDevice);
133 // NOLINTEND
134
135public:
136 // virtual function thunks
137 // NOLINTBEGIN
138 MCAPI void $onAppSuspended();
139
140 MCAPI void $onDeviceLost();
141 // NOLINTEND
142};
Definition AppPlatformListener.h:16
Definition EnableNonOwnerReferences.h:7
Definition Path.h:11
Definition FontRepository.h:5
Definition Font.h:5
Definition ResourceLoadManager.h:18
Definition ResourceLocation.h:15
Definition TextureGroup.h:7