Skip to content
LeviMC
English
AutoLightDark
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 MCNAPI FontRepository(::Bedrock::NotNullNonOwnerPtr<::ResourceLoadManager> manager, bool isOnLowMemoryDevice);
73
74 MCNAPI 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 uchar asciiSheetCount
80 );
81
82 MCNAPI void _queueMsdfFont(
83 ::std::string const& alias,
84 ::Core::Path const& fontPagePrefix,
85 ::std::weak_ptr<::mce::TextureGroup> textureGroupWeakPtr
86 );
87
88 MCNAPI void _setDefaultFont(::std::string const& fontName, uint64 const fontId, ::std::shared_ptr<::Font> font);
89
90 MCNAPI void _setFontIfOverride(uint64 const fontId, ::std::shared_ptr<::Font> font);
91
92 MCNAPI void
93 _setMinecraftSmoothFontStyle(float guiScale, ::std::string const& languageCode, bool supportsCjkSmoothFont);
94
95 MCNAPI uint64 addPreloadedFont(::std::string const& fontName, ::gsl::not_null<::std::shared_ptr<::Font>> font);
96
97 MCAPI ::FontHandle getFontFromFontType(::std::string const& fontType) const;
98
99 MCNAPI ::FontHandle getFontHandle(uint64 const fontId);
100
101 MCNAPI uint64 getFontIdentifier(::std::string const& fontName);
102
103 MCNAPI ::std::vector<::ResourceLocation> getReloadFontTextures() const;
104
106
108
110
111 MCNAPI void loadDefaultFonts(::std::shared_ptr<::mce::TextureGroup> textureGroup);
112
113 MCNAPI void onLanguageChanged(::std::string const& languageCode);
114
115 MCNAPI void parseAndLoadMetadataFonts(::std::shared_ptr<::mce::TextureGroup> textureGroup);
116
117 MCNAPI void reloadFontTextures(bool blockingLoad);
118
119 MCNAPI void setMinecraftUIFontStyle(::std::string const& languageCode);
120
121 MCNAPI void setUseFontOverrides(bool useOverrides);
122 // NOLINTEND
123
124public:
125 // static variables
126 // NOLINTBEGIN
127 MCAPI static uint64& INVALID_FONT();
128 // NOLINTEND
129
130public:
131 // constructor thunks
132 // NOLINTBEGIN
133 MCNAPI void* $ctor(::Bedrock::NotNullNonOwnerPtr<::ResourceLoadManager> manager, bool isOnLowMemoryDevice);
134 // NOLINTEND
135
136public:
137 // virtual function thunks
138 // NOLINTBEGIN
139 MCNAPI void $onAppSuspended();
140
141 MCNAPI void $onDeviceLost();
142 // NOLINTEND
143};
Definition AppPlatformListener.h:16
Definition EnableNonOwnerReferences.h:7
Definition Path.h:10
Definition FontRepository.h:5
MCAPI FontRepository(::Bedrock::NotNullNonOwnerPtr<::ResourceLoadManager > manager, bool isOnLowMemoryDevice)
MCAPI void _setMinecraftSmoothFontStyle(float guiScale, ::std::string const &languageCode, bool supportsCjkSmoothFont)
MCAPI void setUseFontOverrides(bool useOverrides)
MCAPI bool haveDefaultFontsLoaded()
MCAPI bool isRepositoryInitialized()
MCAPI ::std::vector<::ResourceLocation > getReloadFontTextures() const
MCAPI void _queueBitmapFont(::std::string const &alias, ::Core::Path const &asciiName, ::Core::Path const &unicodeName, ::std::weak_ptr<::mce::TextureGroup > textureGroupWeakPtr, uchar asciiSheetCount)
MCAPI void _setDefaultFont(::std::string const &fontName, uint64 const fontId, ::std::shared_ptr<::Font > font)
MCAPI uint64 getFontIdentifier(::std::string const &fontName)
MCAPI void setMinecraftUIFontStyle(::std::string const &languageCode)
MCAPI void $onDeviceLost()
MCAPI void loadDefaultFonts(::std::shared_ptr<::mce::TextureGroup > textureGroup)
MCAPI::FontHandle getFontHandle(uint64 const fontId)
MCAPI uint64 addPreloadedFont(::std::string const &fontName, ::gsl::not_null<::std::shared_ptr<::Font > > font)
MCAPI void * $ctor(::Bedrock::NotNullNonOwnerPtr<::ResourceLoadManager > manager, bool isOnLowMemoryDevice)
MCAPI void _setFontIfOverride(uint64 const fontId, ::std::shared_ptr<::Font > font)
MCAPI void _queueMsdfFont(::std::string const &alias, ::Core::Path const &fontPagePrefix, ::std::weak_ptr<::mce::TextureGroup > textureGroupWeakPtr)
MCAPI void onLanguageChanged(::std::string const &languageCode)
MCAPI void $onAppSuspended()
MCAPI void initDefaultFontHandles()
MCAPI void reloadFontTextures(bool blockingLoad)
MCAPI void parseAndLoadMetadataFonts(::std::shared_ptr<::mce::TextureGroup > textureGroup)
Definition Font.h:5
Definition ResourceLoadManager.h:22
Definition ResourceLocation.h:15
Definition TextureGroup.h:7