14#include "FontCache.generated.h"
215 return FontFace ==
Other.FontFace
216 && FontRenderSize ==
Other.FontRenderSize
217 && OutlineRenderSize ==
Other.OutlineRenderSize
218 && OutlineMiteredCorners ==
Other.OutlineMiteredCorners
219 && OutlineSeparateFillAlpha ==
Other.OutlineSeparateFillAlpha
220 && GlyphIndex ==
Other.GlyphIndex
221 && FontSkew ==
Other.FontSkew;
226 return !(*
this ==
Other);
240 int32 OutlineRenderSize;
242 bool OutlineMiteredCorners;
244 bool OutlineSeparateFillAlpha;
270 return !(*
this ==
Other);
312 return !(*
this ==
Other);
352 , bMaterialIsStencil(
false)
353 , FontMaterial(nullptr)
358 , CachedFontSkew(0.f)
376 return GlyphsToRender;
388 return MaxTextHeight;
400 return bMaterialIsStencil;
406 return OutlineSettings;
502 enum class EEnumerateGlyphsResult :
uint8 { EnumerationFailed, EnumerationAborted, EnumerationComplete };
508 struct FSourceIndexToGlyphData
510 FSourceIndexToGlyphData()
512 , AdditionalGlyphIndices()
518 , AdditionalGlyphIndices()
527 int32 GetLowestGlyphIndex()
const
532 int32 GetHighestGlyphIndex()
const
534 return (AdditionalGlyphIndices.Num() > 0) ? AdditionalGlyphIndices.Last() : GlyphIndex;
542 struct FSourceIndicesToGlyphData
552 inline int32 GetSourceTextStartIndex()
const
554 return SourceTextRange.TextStart;
557 inline int32 GetSourceTextEndIndex()
const
559 return SourceTextRange.TextStart + SourceTextRange.TextLen;
576 return GlyphDataArray.GetAllocatedSize();
580 FSourceTextRange SourceTextRange;
591 bool bMaterialIsStencil;
601 FSourceIndicesToGlyphData SourceIndicesToGlyphData;
603 float CachedFontSkew;
605#if SLATE_CHECK_UOBJECT_SHAPED_GLYPH_SEQUENCE
681#if WITH_EDITORONLY_DATA
741#if WITH_EDITORONLY_DATA
746 mutable uint16 MaxHeight;
748 mutable int16 Baseline;
773#if WITH_ATLAS_DEBUGGING
835 UE_DEPRECATED(5.1,
"GetOverflowEllipsisText is known to create dangling pointer. Use FShapedTextCache::FindOrAddOverflowEllipsisText.")
1005#if WITH_EDITOR && WITH_FREETYPE
1045#if !UE_BUILD_SHIPPING
1101 volatile bool bFlushRequested;
@ INDEX_NONE
Definition CoreMiscDefines.h:150
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
UE::FPlatformRecursiveMutex FCriticalSection
Definition CriticalSection.h:53
SLATECORE_API ETextShapingMethod GetDefaultTextShapingMethod()
Definition FontCache.cpp:107
ETextShapingMethod
Definition FontCache.h:52
EFontCacheAtlasDataType
Definition FontCache.h:34
SLATECORE_API bool IsSlateSdfTextFeatureEnabled()
Definition FontCache.cpp:91
const bool
Definition NetworkReplayStreaming.h:178
#define UENUM(...)
Definition ObjectMacros.h:749
UE_FORCEINLINE_HINT bool IsValid(const UObject *Test)
Definition Object.h:1875
EFontFallback
Definition SlateFontInfo.h:23
ESlateTextureAtlasThreadId
Definition TextureAtlas.h:44
ESlateFontAtlasContentType
Definition TextureAtlas.h:17
int32 InternalIndex
Definition VulkanMemory.cpp:4036
Definition FontCache.h:666
SLATECORE_API int8 GetKerning(TCHAR FirstChar, TCHAR SecondChar, const EFontFallback MaxFontFallback)
Definition FontCache.cpp:717
SLATECORE_API int16 GetBaseline() const
Definition FontCache.cpp:759
SLATECORE_API const FCharacterEntry & GetCharacter(TCHAR Character, const EFontFallback MaxFontFallback)
Definition FontCache.cpp:788
SLATECORE_API uint16 GetMaxHeight() const
Definition FontCache.cpp:749
Definition FontCacheCompositeFont.h:203
Definition ContainerAllocationPolicies.h:1660
Definition FontCacheFreeType.h:448
Definition FontCacheFreeType.h:533
Definition FontCacheFreeType.h:228
Definition FontCacheFreeType.h:418
Definition FontCacheFreeType.h:473
Definition FontCacheFreeType.h:199
Definition NameTypes.h:617
Definition UObjectGlobals.h:2492
Definition SlateTextShaper.h:19
Definition FontCache.h:334
SLATECORE_API bool IsDirty() const
Definition FontCache.cpp:304
SLATECORE_API FGlyphOffsetResult GetGlyphAtOffset(FSlateFontCache &InFontCache, const int32 InHorizontalOffset, const int32 InStartOffset=0) const
Definition FontCache.cpp:351
SLATECORE_API ~FShapedGlyphSequence()
Definition FontCache.cpp:293
SLATECORE_API void AddReferencedObjects(FReferenceCollector &Collector)
Definition FontCache.cpp:542
int16 GetTextBaseline() const
Definition FontCache.h:380
float GetFontSkew() const
Definition FontCache.cpp:317
uint16 GetMaxTextHeight() const
Definition FontCache.h:386
bool IsMaterialStencil() const
Definition FontCache.h:398
const FFontOutlineSettings & GetFontOutlineSettings() const
Definition FontCache.h:404
const TArray< FShapedGlyphEntry > & GetGlyphsToRender() const
Definition FontCache.h:374
SLATECORE_API TOptional< int8 > GetKerning(const int32 InIndex) const
Definition FontCache.cpp:503
FShapedGlyphSequence()
Definition FontCache.h:348
SLATECORE_API int32 GetMeasuredWidth() const
Definition FontCache.cpp:322
SLATECORE_API FShapedGlyphSequencePtr GetSubSequence(const int32 InStartIndex, const int32 InEndIndex) const
Definition FontCache.cpp:517
const UObject * GetFontMaterial() const
Definition FontCache.h:392
SLATECORE_API SIZE_T GetAllocatedSize() const
Definition FontCache.cpp:299
Definition TextureAtlas.h:283
Definition FontCache.h:756
virtual SLATECORE_API FSlateShaderResource * GetAtlasPageResource(const int32 InIndex) const override
Definition FontCache.cpp:953
SLATECORE_API void GetUnderlineMetrics(const FSlateFontInfo &InFontInfo, const float FontScale, int16 &OutUnderlinePos, int16 &OutUnderlineThickness) const
Definition FontCache.cpp:1635
SLATECORE_API uint16 GetMaxCharacterHeight(const FSlateFontInfo &InFontInfo, float FontScale) const
Definition FontCache.cpp:1625
SLATECORE_API void UpdateCache()
Definition FontCache.cpp:1872
ISlateFontTexture * GetFontTexture(uint32 Index)
Definition FontCache.h:875
SLATECORE_API void ReleaseResources()
Definition FontCache.cpp:1945
SLATECORE_API void GetStrikeMetrics(const FSlateFontInfo &InFontInfo, const float FontScale, int16 &OutStrikeLinePos, int16 &OutStrikeLineThickness) const
Definition FontCache.cpp:1640
SLATECORE_API int8 GetKerning(const FFontData &InFontData, const float InSize, TCHAR First, TCHAR Second, float Scale) const
Definition FontCache.cpp:1645
SLATECORE_API void RequestFlushCache(const FString &FlushReason)
Definition FontCache.cpp:1675
SLATECORE_API class FCharacterList & GetCharacterList(const FSlateFontInfo &InFontInfo, float FontScale, const FFontOutlineSettings &InOutlineSettings=FFontOutlineSettings::NoOutline)
Definition FontCache.cpp:1244
SLATECORE_API TArray< FString > GetAvailableFontSubFaces(FFontFaceDataConstRef InMemory) const
Definition FontCache.cpp:1665
SLATECORE_API const FFontData & GetFontDataForCodepoint(const FSlateFontInfo &InFontInfo, const UTF32CHAR InCodepoint, float &OutScalingFactor) const
Definition FontCache.cpp:1615
SLATECORE_API FShapedGlyphFontAtlasData GetShapedGlyphFontAtlasData(const FShapedGlyphEntry &InShapedGlyph, const FFontOutlineSettings &InOutlineSettings)
Definition FontCache.cpp:1270
SLATECORE_API bool CanLoadCodepoint(const FFontData &InFontData, const UTF32CHAR InCodepoint, EFontFallback MaxFallbackLevel=EFontFallback::FF_NoFallback) const
Definition FontCache.cpp:1655
SLATECORE_API const FFontData & GetDefaultFontData(const FSlateFontInfo &InFontInfo) const
Definition FontCache.cpp:1610
virtual SLATECORE_API int32 GetNumAtlasPages() const override
Definition FontCache.cpp:948
SLATECORE_API FShapedGlyphSequenceRef GetOverflowEllipsisText(const FSlateFontInfo &InFontInfo, const float InFontScale)
Definition FontCache.cpp:1600
SLATECORE_API FShapedGlyphSequenceRef ShapeBidirectionalText(const FString &InText, const FSlateFontInfo &InFontInfo, const float InFontScale, const TextBiDi::ETextDirection InBaseDirection, const ETextShapingMethod InTextShapingMethod) const
Definition FontCache.cpp:1224
SLATECORE_API bool HasKerning(const FFontData &InFontData) const
Definition FontCache.cpp:1650
SLATECORE_API FShapedGlyphSequenceRef ShapeUnidirectionalText(const FString &InText, const FSlateFontInfo &InFontInfo, const float InFontScale, const TextBiDi::ETextDirection InTextDirection, const ETextShapingMethod InTextShapingMethod) const
Definition FontCache.cpp:1234
SLATECORE_API SIZE_T GetFontDataAssetResidentMemory(const UObject *FontDataAsset) const
Definition FontCache.cpp:2013
SLATECORE_API int16 GetBaseline(const FSlateFontInfo &InFontInfo, float FontScale) const
Definition FontCache.cpp:1630
virtual SLATECORE_API ~FSlateFontCache()
Definition FontCache.cpp:934
SLATECORE_API FSdfGlyphFontAtlasData GetSdfGlyphFontAtlasData(const FShapedGlyphEntry &InShapedGlyph, const FFontOutlineSettings &InOutlineSettings)
Definition FontCache.cpp:1325
SLATECORE_API void FlushObject(const UObject *const InObject)
Definition FontCache.cpp:1689
FOnReleaseFontResources & OnReleaseResources()
Definition FontCache.h:867
SLATECORE_API FShapedGlyphSequenceRef ShapeOverflowEllipsisText(const FSlateFontInfo &InFontInfo, const float InFontScale)
Definition FontCache.cpp:1605
SLATECORE_API void FlushCompositeFont(const FCompositeFont &InCompositeFont)
Definition FontCache.cpp:1699
SLATECORE_API const TSet< FName > & GetFontAttributes(const FFontData &InFontData) const
Definition FontCache.cpp:1660
virtual SLATECORE_API bool IsAtlasPageResourceAlphaOnly(const int32 InIndex) const override
Definition FontCache.cpp:958
SLATECORE_API bool HasLoadedFontForCodepoint(const FSlateFontInfo &InFontInfo, const UTF32CHAR InCodepoint) const
Definition FontCache.cpp:1620
SLATECORE_API bool ConditionalFlushCache()
Definition FontCache.cpp:1844
SLATECORE_API void FlushData()
Definition FontCache.cpp:1988
Definition SlateFontRenderer.h:58
Definition SlateSdfGenerator.h:9
Definition SlateShaderResource.h:44
Definition SlateTextShaper.h:64
Definition TextureAtlas.h:328
Definition FontTypes.h:136
Definition AssetRegistryState.h:50
Definition UnrealString.h.inl:34
Definition SharedPointer.h:692
Definition SharedPointer.h:153
Definition UniquePtr.h:107
Definition SharedPointer.h:1295
SIZE_T GetAllocatedSize(const T &Value)
Definition ManagedArray.h:93
ETextDirection
Definition Text.h:1413
@ false
Definition radaudio_common.h:23
U16 Index
Definition radfft.cpp:71
Definition TextureAtlas.h:244
Definition FontCache.h:618
uint16 USize
Definition FontCache.h:636
float FontScale
Definition FontCache.h:628
const FFontData * FontData
Definition FontCache.h:624
bool HasKerning
Definition FontCache.h:652
int16 HorizontalOffset
Definition FontCache.h:642
uint16 VSize
Definition FontCache.h:638
int16 GlobalDescender
Definition FontCache.h:644
bool SupportsOutline
Definition FontCache.h:654
int16 VerticalOffset
Definition FontCache.h:640
TSharedPtr< FFreeTypeKerningCache > KerningCache
Definition FontCache.h:626
EFontFallback FallbackLevel
Definition FontCache.h:650
TCHAR Character
Definition FontCache.h:620
uint32 GlyphIndex
Definition FontCache.h:622
float BitmapRenderScale
Definition FontCache.h:630
uint16 StartV
Definition FontCache.h:634
bool Valid
Definition FontCache.h:656
uint16 StartU
Definition FontCache.h:632
int16 XAdvance
Definition FontCache.h:646
uint8 TextureIndex
Definition FontCache.h:648
Definition FontTypes.h:99
Definition CompositeFont.h:428
Definition CompositeFont.h:145
Definition SlateFontInfo.h:37
static SLATECORE_API FFontOutlineSettings NoOutline
Definition SlateFontInfo.h:126
Definition FontCache.h:255
const uint32 GlyphIndex
Definition FontCache.h:281
friend uint32 GetTypeHash(const FSdfGlyphEntryKey &Key)
Definition FontCache.h:273
bool operator!=(const FSdfGlyphEntryKey &Other) const
Definition FontCache.h:268
const int32 SpreadCategory
Definition FontCache.h:287
const ESlateFontAtlasContentType AtlasContentType
Definition FontCache.h:283
const int32 Ppem
Definition FontCache.h:285
const TWeakPtr< FFreeTypeFace > FontFace
Definition FontCache.h:279
bool operator==(const FSdfGlyphEntryKey &Other) const
Definition FontCache.h:259
Definition FontCache.h:120
float Width
Definition FontCache.h:126
float BearingX
Definition FontCache.h:122
float BearingY
Definition FontCache.h:124
float Height
Definition FontCache.h:128
Definition FontCache.h:101
bool bSupportsSdf
Definition FontCache.h:134
uint16 StartU
Definition FontCache.h:107
bool bPendingRespawn
Definition FontCache.h:136
uint16 USize
Definition FontCache.h:111
FMetrics Metrics
Definition FontCache.h:130
bool Valid
Definition FontCache.h:138
uint8 TextureIndex
Definition FontCache.h:132
int16 VerticalOffset
Definition FontCache.h:103
uint16 VSize
Definition FontCache.h:113
uint16 StartV
Definition FontCache.h:109
int16 HorizontalOffset
Definition FontCache.h:105
float EmOuterSpread
Definition FontCache.h:115
float EmInnerSpread
Definition FontCache.h:117
Definition FontCache.h:299
bool operator==(const FSdfGlyphTaskKey &Other) const
Definition FontCache.h:303
friend uint32 GetTypeHash(const FSdfGlyphTaskKey &Key)
Definition FontCache.h:315
bool operator!=(const FSdfGlyphTaskKey &Other) const
Definition FontCache.h:310
float EmOuterSpread
Definition FontCache.h:323
const FSdfGlyphEntryKey SdfGlyphEntryKey
Definition FontCache.h:321
float EmInnerSpread
Definition FontCache.h:325
Definition FontCache.h:206
friend struct FFontCacheStatsKey
Definition FontCache.h:207
friend uint32 GetTypeHash(const FShapedGlyphEntryKey &Key)
Definition FontCache.h:229
bool operator==(const FShapedGlyphEntryKey &Other) const
Definition FontCache.h:213
bool operator!=(const FShapedGlyphEntryKey &Other) const
Definition FontCache.h:224
Definition FontCache.h:143
TSharedPtr< FShapedGlyphFaceData > FontFaceData
Definition FontCache.h:147
int16 YOffset
Definition FontCache.h:159
uint32 GlyphIndex
Definition FontCache.h:149
uint8 NumGraphemeClustersInGlyph
Definition FontCache.h:175
bool bIsVisible
Definition FontCache.h:184
SLATECORE_API bool HasValidGlyph() const
Definition FontCache.cpp:118
int16 YAdvance
Definition FontCache.h:155
TextBiDi::ETextDirection TextDirection
Definition FontCache.h:179
int16 XOffset
Definition FontCache.h:157
int8 Kerning
Definition FontCache.h:165
int32 SourceIndex
Definition FontCache.h:151
SLATECORE_API float GetBitmapRenderScale() const
Definition FontCache.cpp:132
int16 XAdvance
Definition FontCache.h:153
uint8 NumCharactersInGlyph
Definition FontCache.h:170
Definition FontCache.h:78
uint16 StartV
Definition FontCache.h:86
uint8 TextureIndex
Definition FontCache.h:92
bool Valid
Definition FontCache.h:96
uint16 USize
Definition FontCache.h:88
int16 VerticalOffset
Definition FontCache.h:80
bool SupportsOutline
Definition FontCache.h:94
int16 HorizontalOffset
Definition FontCache.h:82
uint16 StartU
Definition FontCache.h:84
uint16 VSize
Definition FontCache.h:90
Definition FontCache.h:430
const FShapedGlyphEntry * Glyph
Definition FontCache.h:453
int32 GlyphOffset
Definition FontCache.h:455
FGlyphOffsetResult()
Definition FontCache.h:431
int32 CharacterIndex
Definition FontCache.h:457
FGlyphOffsetResult(const int32 InCharacterIndex)
Definition FontCache.h:438
FGlyphOffsetResult(const FShapedGlyphEntry *InGlyph, const int32 InGlyphOffset)
Definition FontCache.h:445
Definition SlateFontInfo.h:147
Definition FontTypes.h:72
Definition FontTypes.h:22
Definition ObjectPtr.h:488
Definition Optional.h:131
Definition WeakObjectPtrTemplates.h:25