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

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

virtual float _getCharWidth (int uniChar, bool forceUnicode)
virtual bool supportsChar (int const &character)
virtual float getWrapHeight () const
virtual float getScaleFactor () const
virtual bool isScreenPixelAligned () const
virtual bool materialCanBeOverridden () const
virtual void uploadTextureToGPU ()
virtual void setTextConstantsInScreenContext (::ScreenContext &screenContext, int, float guiScale, ::mce::Color const &textColor, bool hasShadow) const
virtual::Vec2 getTranslationFactor () const
virtual void _scanUnicodeCharacterSize (int character, int sheet, bool forceUnicode)
virtual bool _supportsShadowInSingleDraw ()
virtual::ResourceLocation _getFontSheetLocation (int sheet, bool) const
virtual::mce::MaterialPtr const & getMaterial (int sheet, bool isOddGuiScale) const
virtual::mce::Font::Type getType (int glyphSheet) const
virtual void loadFontData (bool)
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 int _getReplacementCharacter ()
virtual::std::string _remapString (::std::string_view str) const
virtual void switchFontsource (::Core::Path const &, ::Core::Path const &)
virtual ::std::pair<::Core::PathBuffer<::std::string > const &, ::Core::PathBuffer<::std::string > const & > getFontSources () const
MCAPI MSDFFont (::Core::Path const &fontPagePrefix, ::std::shared_ptr<::mce::TextureGroup > textureGroup, bool uploadOnConstruction)
MCAPI void _loadGlyphRemappingData ()
MCAPI void _loadMsdfFontInformation (::Core::Path const &fontName, uchar page)
MCAPI void * $ctor (::Core::Path const &fontPagePrefix, ::std::shared_ptr<::mce::TextureGroup > textureGroup, bool uploadOnConstruction)
MCAPI void $dtor ()
MCAPI float $_getCharWidth (int uniChar, bool forceUnicode)
MCAPI bool $supportsChar (int const &character)
MCFOLD float $getWrapHeight () const
MCFOLD float $getScaleFactor () const
MCFOLD bool $isScreenPixelAligned () const
MCFOLD bool $materialCanBeOverridden () const
MCFOLD void $uploadTextureToGPU ()
MCFOLD void $setTextConstantsInScreenContext (::ScreenContext &screenContext, int, float guiScale, ::mce::Color const &textColor, bool hasShadow) const
MCAPI::Vec2 $getTranslationFactor () const
MCAPI void $_scanUnicodeCharacterSize (int character, int sheet, bool forceUnicode)
MCFOLD bool $_supportsShadowInSingleDraw ()
MCAPI::ResourceLocation $_getFontSheetLocation (int sheet, bool) const
MCAPI::mce::MaterialPtr const & $getMaterial (int sheet, bool isOddGuiScale) const
MCFOLD::mce::Font::Type $getType (int glyphSheet) const
MCAPI void $loadFontData (bool)
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
MCFOLD int $_getReplacementCharacter ()
MCAPI::std::string $_remapString (::std::string_view str) const
MCAPI void $switchFontsource (::Core::Path const &, ::Core::Path const &)
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 float getScaleFactor (int c) 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)
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)
MCAPI float $getScaleFactor (int c) 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)

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 > > mFontPagePrefix
::ll::TypedStorage< 8, 64, ::std::unordered_map< int, float > > mUnicodeWidths
::ll::TypedStorage< 8, 64, ::std::unordered_set< int > > mSheetScannedForWidthsAndOffsets
::ll::TypedStorage< 8, 64, ::std::unordered_map< int, int > > mRemappedGlyphs
::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 MSDFFont::_getCharWidth ( int uniChar,
bool forceUnicode )
virtual

Implements Font.

◆ supportsChar()

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

Implements Font.

◆ getWrapHeight()

virtual float MSDFFont::getWrapHeight ( ) const
virtual

Implements Font.

◆ getScaleFactor()

virtual float MSDFFont::getScaleFactor ( ) const
virtual

Implements Font.

◆ isScreenPixelAligned()

virtual bool MSDFFont::isScreenPixelAligned ( ) const
virtual

Implements Font.

◆ materialCanBeOverridden()

virtual bool MSDFFont::materialCanBeOverridden ( ) const
virtual

Implements Font.

◆ uploadTextureToGPU()

virtual void MSDFFont::uploadTextureToGPU ( )
virtual

Implements Font.

◆ setTextConstantsInScreenContext()

virtual void MSDFFont::setTextConstantsInScreenContext ( ::ScreenContext & screenContext,
int ,
float guiScale,
::mce::Color const & textColor,
bool hasShadow ) const
virtual

Reimplemented from Font.

◆ _scanUnicodeCharacterSize()

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

Implements Font.

◆ _supportsShadowInSingleDraw()

virtual bool MSDFFont::_supportsShadowInSingleDraw ( )
virtual

Implements Font.

◆ _getFontSheetLocation()

virtual::ResourceLocation MSDFFont::_getFontSheetLocation ( int sheet,
bool  ) const
virtual

Implements Font.

◆ getMaterial()

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

Implements Font.

◆ loadFontData()

virtual void MSDFFont::loadFontData ( bool )
virtual

Implements Font.

◆ buildChar()

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

Implements Font.

◆ _getReplacementCharacter()

virtual int MSDFFont::_getReplacementCharacter ( )
virtual

Reimplemented from Font.

◆ switchFontsource()

virtual void MSDFFont::switchFontsource ( ::Core::Path const & ,
::Core::Path const &  )
virtual

Implements Font.

◆ getFontSources()

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

Implements Font.

◆ $vftable()

MCAPI void ** MSDFFont::$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: