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> mUIFontId;
37 ::ll::TypedStorage<8, 8, uint64> mSmoothSmallFontID;
38 ::ll::TypedStorage<8, 80, ::FontHandle> mFontHandle;
39 ::ll::TypedStorage<8, 80, ::FontHandle> mRuneFontHandle;
40 ::ll::TypedStorage<8, 80, ::FontHandle> mUnicodeFontHandle;
41 ::ll::TypedStorage<8, 80, ::FontHandle> mSmoothFontLatinHandle;
42 ::ll::TypedStorage<8, 80, ::FontHandle> mUIFontHandle;
43 ::ll::TypedStorage<8, 64, ::std::unordered_map<uint64, ::std::shared_ptr<::Font>>> mOriginalMinecraftFonts;
44 ::ll::TypedStorage<8, 64, ::std::unordered_map<uint64, ::std::shared_ptr<::Font>>> mOverriddenFonts;
45 ::ll::TypedStorage<8, 24, ::std::vector<::Bedrock::Threading::Async<void>>> mFontLoadingTaskTrackers;
46 ::ll::TypedStorage<8, 32, ::std::string> mLanguageCode;
47 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::ResourceLoadManager>> mResourceLoadManager;
48 ::ll::TypedStorage<1, 1, bool> mIsOnLowMemoryDevice;
49 // NOLINTEND
50
51public:
52 // prevent constructor by default
53 FontRepository();
54
55public:
56 // virtual functions
57 // NOLINTBEGIN
58 virtual ~FontRepository() /*override*/ = default;
59
60 virtual void onAppSuspended() /*override*/;
61
62 virtual void onDeviceLost() /*override*/;
63 // NOLINTEND
64
65public:
66 // member functions
67 // NOLINTBEGIN
68 MCAPI FontRepository(::Bedrock::NotNullNonOwnerPtr<::ResourceLoadManager> manager, bool isOnLowMemoryDevice);
69
70 MCAPI void _queueBitmapFont(
71 ::std::string const& alias,
72 ::Core::Path const& asciiName,
73 ::Core::Path const& unicodeName,
74 ::std::weak_ptr<::mce::TextureGroup> textureGroupWeakPtr
75 );
76
77 MCAPI void _queueMsdfFont(
78 ::std::string const& alias,
79 ::Core::Path const& fontPagePrefix,
80 ::std::weak_ptr<::mce::TextureGroup> textureGroupWeakPtr
81 );
82
83 MCAPI void _setDefaultFont(::std::string const& fontName, uint64 const fontId, ::std::shared_ptr<::Font> font);
84
85 MCAPI void _setFontIfOverride(uint64 const fontId, ::std::shared_ptr<::Font> font);
86
87 MCAPI uint64 addPreloadedFont(::std::string const& fontName, ::gsl::not_null<::std::shared_ptr<::Font>> font);
88
89 MCAPI ::FontHandle getFontFromFontType(::std::string const& fontType) const;
90
91 MCAPI ::FontHandle getFontHandle(uint64 const fontId);
92
93 MCAPI uint64 getFontIdentifier(::std::string const& fontName);
94
95 MCAPI ::std::vector<::ResourceLocation> getReloadFontTextures() const;
96
97 MCAPI void initDefaultFontHandles();
98
99 MCAPI void loadDefaultFonts(::std::shared_ptr<::mce::TextureGroup> textureGroup);
100
101 MCAPI void onLanguageChanged(::std::string const& languageCode);
102
103 MCAPI void parseAndLoadMetadataFonts(::std::shared_ptr<::mce::TextureGroup> textureGroup);
104
105 MCAPI void reloadFontTextures(bool blockingLoad);
106
107 MCAPI void setMinecraftSmoothFontStyle(float guiScale, ::std::string const&);
108
109 MCAPI void setMinecraftUIFontStyle(::std::string const& languageCode);
110
111 MCAPI void setUseFontOverrides(bool useOverrides);
112 // NOLINTEND
113
114public:
115 // static variables
116 // NOLINTBEGIN
117 MCAPI static uint64& INVALID_FONT();
118 // NOLINTEND
119
120public:
121 // constructor thunks
122 // NOLINTBEGIN
123 MCAPI void* $ctor(::Bedrock::NotNullNonOwnerPtr<::ResourceLoadManager> manager, bool isOnLowMemoryDevice);
124 // NOLINTEND
125
126public:
127 // virtual function thunks
128 // NOLINTBEGIN
129 MCAPI void $onAppSuspended();
130
131 MCAPI void $onDeviceLost();
132 // NOLINTEND
133};
Definition AppPlatformListener.h:15
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