LeviLamina
Loading...
Searching...
No Matches
BitmapFont Class Reference
Inheritance diagram for BitmapFont:

Public Types

using CurrentLineCallback = ::std::function<bool(::std::string_view const&, ::std::string&, float, uint&)> const
using StringCacheStoredKey = ::std::tuple<::std::string, ::mce::Color, float, float, bool, bool>
using StringCacheLookupKey = ::std::tuple<::std::string_view, ::mce::Color, float, float, bool, bool>
using StringCache

Public Member Functions

BitmapFontoperator= (BitmapFont const &)
virtual float _getCharWidth (int uniChar, bool forceUnicode)
virtual bool supportsChar (int const &character)
virtual float getWrapHeight () const
virtual float getScaleFactor (int c) const
virtual float getScaleFactor () const
virtual bool isScreenPixelAligned () const
virtual bool materialCanBeOverridden () const
virtual void uploadTextureToGPU ()
virtual void _scanUnicodeCharacterSize (int character, int sheet, bool forceUnicode)
virtual bool _supportsShadowInSingleDraw ()
virtual::ResourceLocation _getFontSheetLocation (int sheet, bool forceUnicode) const
virtual::mce::MaterialPtr const & getMaterial (int sheet, bool isOddGuiScale) const
virtual void loadFontData (bool uploadTextureImmediately)
virtual float buildChar (::std::vector<::Font::GlyphQuad > &quads, int i, ::mce::Color const &color, bool italic, float x, float y, bool unicode)
virtual ::Core::PathBuffer<::std::string > getUnicodeFontNameWithPage (::Core::Path const &fontName, uchar const page) const
virtual void switchFontsource (::Core::Path const &asciiName, ::Core::Path const &unicodeName)
virtual ::std::pair<::Core::PathBuffer<::std::string > const &, ::Core::PathBuffer<::std::string > const & > getFontSources () const
MCAPI BitmapFont (::BitmapFont const &rhs)
MCAPI BitmapFont (::Core::Path const &asciiName, ::Core::Path const &unicodeName, ::std::shared_ptr<::mce::TextureGroup > textureGroup, bool uploadOnConstruction)
MCAPI void _loadAsciiFontInformation (::Core::Path const &fontName, bool uploadTextureImmediately)
MCAPI void * $ctor (::BitmapFont const &rhs)
MCAPI void * $ctor (::Core::Path const &asciiName, ::Core::Path const &unicodeName, ::std::shared_ptr<::mce::TextureGroup > textureGroup, bool uploadOnConstruction)
MCAPI void $dtor ()
MCAPI float $_getCharWidth (int uniChar, bool forceUnicode)
MCAPI bool $supportsChar (int const &character)
MCAPI float $getWrapHeight () const
MCAPI float $getScaleFactor (int c) const
MCAPI float $getScaleFactor () const
MCFOLD bool $isScreenPixelAligned () const
MCFOLD bool $materialCanBeOverridden () const
MCAPI void $uploadTextureToGPU ()
MCAPI void $_scanUnicodeCharacterSize (int character, int sheet, bool forceUnicode)
MCFOLD bool $_supportsShadowInSingleDraw ()
MCAPI::ResourceLocation $_getFontSheetLocation (int sheet, bool forceUnicode) const
MCAPI::mce::MaterialPtr const & $getMaterial (int sheet, bool isOddGuiScale) const
MCAPI void $loadFontData (bool uploadTextureImmediately)
MCAPI float $buildChar (::std::vector<::Font::GlyphQuad > &quads, int i, ::mce::Color const &color, bool italic, float x, float y, bool unicode)
MCAPI ::Core::PathBuffer<::std::string > $getUnicodeFontNameWithPage (::Core::Path const &fontName, uchar const page) const
MCAPI void $switchFontsource (::Core::Path const &asciiName, ::Core::Path const &unicodeName)
MCAPI ::std::pair<::Core::PathBuffer<::std::string > const &, ::Core::PathBuffer<::std::string > const & > $getFontSources () const
virtual void fetchPage (int page)
virtual void drawCached (::ScreenContext &screenContext, ::std::string_view str, float x, float y, ::mce::Color const &color, bool ignoreColorFormatting, bool darken, bool drawColorSymbol, ::mce::MaterialPtr const *optionalMat, int caretPosition, bool shadow, float linePadding, ::mce::Color const &resetColorOverride, ::mce::Color const &shaderDarkColor, float outlineWidth, float yCaretOffset, ::std::variant< ::std::monostate, ::UIActorOffscreenCaptureDescription, ::UIThumbnailMeshOffscreenCaptureDescription, ::UIMeshOffscreenCaptureDescription, ::UIStructureVolumeOffscreenCaptureDescription > const &offscreenCaptureDescription, bool autoGenNormalsAndTangents)
virtual int getLineLength (::std::string_view str, float fontSize, bool showColorSymbol)
virtual::Vec2 getTranslationFactor () const
virtual void setTextConstantsInScreenContext (::ScreenContext &screenContext, int glyphSheet, float guiScale, ::mce::Color const &textColor, bool hasShadow) const
virtual::mce::Font::Type getType (int glyphSheet) const
virtual ::std::optional<::mce::Font::RenderingParameterstryGetRenderingParameters (::ScreenContext const &screenContext, int glyphSheet, float guiScale, ::mce::Color const &textColor, bool hasShadow, uint textureWidth, uint textureHeight) const
virtual void onAppSuspended ()
virtual void onDeviceLost ()
virtual void reloadFontTextures (::Bedrock::NonOwnerPointer<::ResourceLoadManager > const &resourceLoadManager, bool blockingLoad)
virtual bool isReloadingTextures ()
virtual void unloadTextures ()
virtual void onLanguageChanged (::std::string_view languageCode)
virtual int _getReplacementCharacter ()
virtual::std::string _remapString (::std::string_view str) const
MCAPI bool _chopString (::std::string &currentLine, ::std::string &activeFormatting, float &totalHeight, uint &remainingLineCount, float maxWidth, bool showColorSymbol, bool centered, float fontSize, ::std::function< bool(::std::string_view const &, ::std::string &, float, uint &)> currentLineCallback)
MCAPI void _drawTextSegment (::ScreenContext &screenContext, ::std::string_view str, float startX, float startY, ::mce::Color const &color, bool centered, bool shadow, bool showColorSymbol, ::mce::MaterialPtr *optionalMat)
MCAPI int _drawWordWrap (::ScreenContext &screenContext, ::std::string_view str, float x, float y, float w, ::mce::Color const &color, uint maxLine, float fontSize, bool shadow, bool centered, bool showColorSymbol, ::mce::MaterialPtr *optionalMat)
MCAPI int _getStringChopAmount (::std::string_view currentLine, bool showColorSymbol, float maxWidth)
MCAPI ::std::shared_ptr<::Font::TextObject_makeTextObject (::Tessellator &tessellator, ::std::string_view str, ::mce::Color const &ccolor, bool showColorSymbol, bool ignoreColorFormatting, int caretPosition, bool shadow, float linePadding, bool isOddGuiScale, ::mce::Color const &resetColorOverride, bool uiMaterial, float outlineWidth, float yCaretOffset, bool autoGenNormalsAndTangents)
MCAPI int _processHeightWrap (::std::string_view str, float startX, float startY, float maxWidth, uint maxLine, bool showColorSymbol, bool centered, float fontSize, ::std::function< bool(::std::string_view const &, ::std::string &, float, uint &)> currentLineCallback)
MCAPI void calculateTextWidths (::std::string_view text, ::std::vector< int > &widths)
MCAPI void drawShadow (::ScreenContext &screenContext, ::std::string_view str, float x, float y, ::mce::Color const &color, bool showColorSymbol, ::mce::MaterialPtr *optionalMat, float linePadding)
MCAPI void drawTransformed (::ScreenContext &screenContext, ::std::string_view str, float x, float y, ::mce::Color const &color, float angle, float s, bool centered, float maxWidth, bool shadow)
MCAPI ::std::unordered_set<::ResourceLocation > const & getGlyphLocations () const
MCAPI ::std::vector<::ResourceLocationgetReloadFontTextures () const
MCAPI bool hasFormattingCodes (::std::string_view str) const
MCAPI void resetFontData (bool uploadTextureImmediately)
MCAPI bool supportsString (::std::string_view str)
MCAPI void tickObfuscatedTextIndex (float deltaTime, float obfuscateSwitchTime)
MCAPI void * $ctor (::std::shared_ptr<::mce::TextureGroup > textureGroup)
MCFOLD void $fetchPage (int page)
MCAPI void $drawCached (::ScreenContext &screenContext, ::std::string_view str, float x, float y, ::mce::Color const &color, bool ignoreColorFormatting, bool darken, bool drawColorSymbol, ::mce::MaterialPtr const *optionalMat, int caretPosition, bool shadow, float linePadding, ::mce::Color const &resetColorOverride, ::mce::Color const &shaderDarkColor, float outlineWidth, float yCaretOffset, ::std::variant< ::std::monostate, ::UIActorOffscreenCaptureDescription, ::UIThumbnailMeshOffscreenCaptureDescription, ::UIMeshOffscreenCaptureDescription, ::UIStructureVolumeOffscreenCaptureDescription > const &offscreenCaptureDescription, bool autoGenNormalsAndTangents)
MCAPI int $getLineLength (::std::string_view str, float fontSize, bool showColorSymbol)
MCFOLD::Vec2 $getTranslationFactor () const
MCFOLD void $setTextConstantsInScreenContext (::ScreenContext &screenContext, int glyphSheet, float guiScale, ::mce::Color const &textColor, bool hasShadow) const
MCFOLD::mce::Font::Type $getType (int glyphSheet) const
MCAPI ::std::optional<::mce::Font::RenderingParameters$tryGetRenderingParameters (::ScreenContext const &screenContext, int glyphSheet, float guiScale, ::mce::Color const &textColor, bool hasShadow, uint textureWidth, uint textureHeight) const
MCFOLD void $onAppSuspended ()
MCFOLD void $onDeviceLost ()
MCAPI void $reloadFontTextures (::Bedrock::NonOwnerPointer<::ResourceLoadManager > const &resourceLoadManager, bool blockingLoad)
MCAPI bool $isReloadingTextures ()
MCFOLD void $unloadTextures ()
MCFOLD void $onLanguageChanged (::std::string_view languageCode)
MCAPI int $_getReplacementCharacter ()
MCAPI::std::string $_remapString (::std::string_view str) const

Static Public Member Functions

static MCAPI void ** $vftable ()
static MCAPI bool containsWideChar (::std::string_view str)
static MCAPI ::Core::PathBuffer<::std::string > const & NOT_FOUND_PAGE ()
static MCAPI int const & UNICODE_REPLACEMENT_CHARACTER_CODE ()

Public Attributes

::ll::TypedStorage< 8, 32, ::Core::PathBuffer<::std::string > > mAsciiFontName
::ll::TypedStorage< 8, 32, ::Core::PathBuffer<::std::string > > mUnicodeFontName
::ll::TypedStorage< 4, 1024, float[256]> mCharWidths
::ll::TypedStorage< 8, 16, ::std::shared_ptr<::mce::Image > > mBitmapFontImage
::ll::TypedStorage< 8, 64, ::std::unordered_map< int, float > > mUnicodeWidths
::ll::TypedStorage< 8, 64, ::std::unordered_map< int, float > > mUnicodeOffsets
::ll::TypedStorage< 8, 64, ::std::unordered_map< int, float > > mUnicodePageGlyphWidths
::ll::TypedStorage< 8, 64, ::std::unordered_set< int > > mSheetScannedForWidthsAndOffsets
::ll::TypedStorage< 4, 512, ::mce::Color[32]> mColors
::ll::TypedStorage< 4, 4, float > mScalarOverride
::ll::TypedStorage< 8, 24, ::std::vector<::std::tuple< int, int, float > > > mScaleOverrideCharacter
::ll::TypedStorage< 8, 16, ::std::shared_ptr<::mce::TextureGroup > > mTextureGroup
::ll::TypedStorage< 8, 16, ::std::map< ::std::tuple<::std::string, ::mce::Color, float, float, bool, bool >, ::std::vector<::std::shared_ptr<::Font::TextObject > >, ::std::less< void > > > mStringCache
::ll::TypedStorage< 4, 4, int > mObfuscatedIndex
::ll::TypedStorage< 4, 4, float > mObfuscatedTextTime
::ll::TypedStorage< 4, 8, ::Vec2mCaretRenderPosition
::ll::TypedStorage< 4, 8, ::Vec2mCaretRenderSize
::ll::TypedStorage< 1, 1, bool > mAlwaysUnicode
::ll::TypedStorage< 1, 1, bool > mAutoResetFormat
::ll::TypedStorage< 1, 1, bool > mUseCache
::ll::TypedStorage< 4, 16, ::mce::ColormCurrentColor
::ll::TypedStorage< 4, 4, int > mFontTexture
::ll::TypedStorage< 4, 16, ::mce::ColormCaretColor
::ll::TypedStorage< 1, 1, bool > mItalic
::ll::TypedStorage< 1, 1, bool > mBold
::ll::TypedStorage< 1, 1, bool > mStrikethrough
::ll::TypedStorage< 1, 1, bool > mUnderlined
::ll::TypedStorage< 1, 1, bool > mObfuscated
::ll::TypedStorage< 8, 16, ::mce::MaterialPtrmFontMat

Member Typedef Documentation

◆ StringCache

using Font::StringCache
inherited
Initial value:
::std::map<
::std::tuple<::std::string, ::mce::Color, float, float, bool, bool>,
::std::vector<::std::shared_ptr<::Font::TextObject>>,
::std::less<void>>

Member Function Documentation

◆ _getCharWidth()

virtual float BitmapFont::_getCharWidth ( int uniChar,
bool forceUnicode )
virtual

Implements Font.

◆ supportsChar()

virtual bool BitmapFont::supportsChar ( int const & character)
virtual

Implements Font.

◆ getWrapHeight()

virtual float BitmapFont::getWrapHeight ( ) const
virtual

Implements Font.

◆ getScaleFactor() [1/2]

virtual float BitmapFont::getScaleFactor ( int c) const
virtual

Reimplemented from Font.

◆ getScaleFactor() [2/2]

virtual float BitmapFont::getScaleFactor ( ) const
virtual

Implements Font.

◆ isScreenPixelAligned()

virtual bool BitmapFont::isScreenPixelAligned ( ) const
virtual

Implements Font.

◆ materialCanBeOverridden()

virtual bool BitmapFont::materialCanBeOverridden ( ) const
virtual

Implements Font.

◆ uploadTextureToGPU()

virtual void BitmapFont::uploadTextureToGPU ( )
virtual

Implements Font.

◆ _scanUnicodeCharacterSize()

virtual void BitmapFont::_scanUnicodeCharacterSize ( int character,
int sheet,
bool forceUnicode )
virtual

Implements Font.

◆ _supportsShadowInSingleDraw()

virtual bool BitmapFont::_supportsShadowInSingleDraw ( )
virtual

Implements Font.

◆ _getFontSheetLocation()

virtual::ResourceLocation BitmapFont::_getFontSheetLocation ( int sheet,
bool forceUnicode ) const
virtual

Implements Font.

◆ getMaterial()

virtual::mce::MaterialPtr const & BitmapFont::getMaterial ( int sheet,
bool isOddGuiScale ) const
virtual

Implements Font.

◆ loadFontData()

virtual void BitmapFont::loadFontData ( bool uploadTextureImmediately)
virtual

Implements Font.

◆ buildChar()

virtual float BitmapFont::buildChar ( ::std::vector<::Font::GlyphQuad > & quads,
int i,
::mce::Color const & color,
bool italic,
float x,
float y,
bool unicode )
virtual

Implements Font.

◆ switchFontsource()

virtual void BitmapFont::switchFontsource ( ::Core::Path const & asciiName,
::Core::Path const & unicodeName )
virtual

Implements Font.

◆ getFontSources()

virtual ::std::pair<::Core::PathBuffer<::std::string > const &, ::Core::PathBuffer<::std::string > const & > BitmapFont::getFontSources ( ) const
virtual

Implements Font.

◆ $vftable()

MCAPI void ** BitmapFont::$vftable ( )
static
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

The documentation for this class was generated from the following files: