UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FShapedTextCache Class Reference

#include <ShapedTextCache.h>

Public Member Functions

SLATE_API FShapedGlyphSequencePtr FindShapedText (const FCachedShapedTextKey &InKey) const
 
SLATE_API FShapedGlyphSequenceRef AddShapedText (const FCachedShapedTextKey &InKey, const TCHAR *InText)
 
SLATE_API FShapedGlyphSequenceRef AddShapedText (const FCachedShapedTextKey &InKey, const TCHAR *InText, const TextBiDi::ETextDirection InTextDirection)
 
SLATE_API FShapedGlyphSequenceRef AddShapedText (const FCachedShapedTextKey &InKey, FShapedGlyphSequenceRef InShapedText)
 
SLATE_API FShapedGlyphSequenceRef FindOrAddShapedText (const FCachedShapedTextKey &InKey, const TCHAR *InText)
 
SLATE_API FShapedGlyphSequenceRef FindOrAddShapedText (const FCachedShapedTextKey &InKey, const TCHAR *InText, const TextBiDi::ETextDirection InTextDirection)
 
SLATE_API FShapedGlyphSequenceRef FindOrAddOverflowEllipsisText (const float InScale, const FShapedTextContext &InTextContext, const FSlateFontInfo &InFontInfo)
 
SLATE_API void Clear ()
 
TSharedPtr< FSlateFontCacheGetFontCache () const
 
 FShapedTextCache (FPrivateToken, const TSharedRef< FSlateFontCache > &InFontCache)
 

Static Public Member Functions

static FShapedTextCacheRef Create (const TSharedRef< FSlateFontCache > &InFontCache)
 

Detailed Description

Cache of shaped text

Constructor & Destructor Documentation

◆ FShapedTextCache()

FShapedTextCache::FShapedTextCache ( FPrivateToken  ,
const TSharedRef< FSlateFontCache > &  InFontCache 
)
inline

Constructor

Member Function Documentation

◆ AddShapedText() [1/3]

FShapedGlyphSequenceRef FShapedTextCache::AddShapedText ( const FCachedShapedTextKey InKey,
const TCHAR InText 
)

Add the given shaped text instance to the cache, or generate a new instance and add that based on the parameters provided

Parameters
InKeyThe key identifying the shaped text instance to add
InTextThe text to shape. InKey may specify a sub-section of the entire text
InTextDirectionThe text direction of all of the text to be shaped. If present we do a unidirectional shape, otherwise we do a bidirectional shape
InShapedTextThe shaped text instance to add
Returns
The shaped text instance

◆ AddShapedText() [2/3]

FShapedGlyphSequenceRef FShapedTextCache::AddShapedText ( const FCachedShapedTextKey InKey,
const TCHAR InText,
const TextBiDi::ETextDirection  InTextDirection 
)

◆ AddShapedText() [3/3]

FShapedGlyphSequenceRef FShapedTextCache::AddShapedText ( const FCachedShapedTextKey InKey,
FShapedGlyphSequenceRef  InShapedText 
)

◆ Clear()

void FShapedTextCache::Clear ( )

Clear this cache

◆ Create()

static FShapedTextCacheRef FShapedTextCache::Create ( const TSharedRef< FSlateFontCache > &  InFontCache)
inlinestatic

Create a new shaped text cache

◆ FindOrAddOverflowEllipsisText()

FShapedGlyphSequenceRef FShapedTextCache::FindOrAddOverflowEllipsisText ( const float  InScale,
const FShapedTextContext InTextContext,
const FSlateFontInfo InFontInfo 
)

Try and find an existing overflow shaped text instance, or add a new entry to the cache if one cannot be found. The overflow sequence is used to replace characters that are clipped.

Returns
The shaped text instance

◆ FindOrAddShapedText() [1/2]

FShapedGlyphSequenceRef FShapedTextCache::FindOrAddShapedText ( const FCachedShapedTextKey InKey,
const TCHAR InText 
)

Try and find an existing shaped text instance, or add a new entry to the cache if one cannot be found

Parameters
InKeyThe key identifying the shaped text instance to find or add
InTextThe text to shape if we can't find the shaped text in the cache. InKey may specify a sub-section of the entire text
InTextDirectionThe text direction of all of the text to be shaped. If present we do a unidirectional shape, otherwise we do a bidirectional shape
Returns
The shaped text instance

◆ FindOrAddShapedText() [2/2]

FShapedGlyphSequenceRef FShapedTextCache::FindOrAddShapedText ( const FCachedShapedTextKey InKey,
const TCHAR InText,
const TextBiDi::ETextDirection  InTextDirection 
)

◆ FindShapedText()

FShapedGlyphSequencePtr FShapedTextCache::FindShapedText ( const FCachedShapedTextKey InKey) const

Try and find an existing shaped text instance

Parameters
InKeyThe key identifying the shaped text instance to find
Returns
The shaped text instance, or null if it wasn't found or was stale

◆ GetFontCache()

TSharedPtr< FSlateFontCache > FShapedTextCache::GetFontCache ( ) const
inline

Get the font cache used by this instance


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