UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FSlateFontInfo Struct Reference

#include <SlateFontInfo.h>

Public Member Functions

SLATECORE_API FSlateFontInfo ()
 
 ~FSlateFontInfo ()
 
SLATECORE_API FSlateFontInfo (TSharedPtr< const FCompositeFont > InCompositeFont, const float InSize, const FName &InTypefaceFontName=NAME_None, const FFontOutlineSettings &InOutlineSettings=FFontOutlineSettings())
 
SLATECORE_API FSlateFontInfo (const UObject *InFontObject, const float InSize, const FName &InTypefaceFontName=NAME_None, const FFontOutlineSettings &InOutlineSettings=FFontOutlineSettings())
 
SLATECORE_API FSlateFontInfo (const FString &InFontName, float InSize, EFontHinting InHinting=EFontHinting::Default, const FFontOutlineSettings &InOutlineSettings=FFontOutlineSettings())
 
SLATECORE_API FSlateFontInfo (const FName &InFontName, float InSize, EFontHinting InHinting=EFontHinting::Default)
 
SLATECORE_API FSlateFontInfo (const ANSICHAR *InFontName, float InSize, EFontHinting InHinting=EFontHinting::Default)
 
SLATECORE_API FSlateFontInfo (const WIDECHAR *InFontName, float InSize, EFontHinting InHinting=EFontHinting::Default)
 
bool IsLegacyIdenticalTo (const FSlateFontInfo &Other) const
 
bool IsIdenticalTo (const FSlateFontInfo &Other) const
 
bool operator== (const FSlateFontInfo &Other) const
 
SLATECORE_API bool HasValidFont () const
 
SLATECORE_API const FCompositeFontGetCompositeFont () const
 
SLATECORE_API float GetClampSize () const
 
SLATECORE_API float GetClampSkew () const
 
SLATECORE_API void AddReferencedObjects (FReferenceCollector &Collector)
 

Public Attributes

TObjectPtr< const UObjectFontObject
 
TObjectPtr< UObjectFontMaterial
 
FFontOutlineSettings OutlineSettings
 
TSharedPtr< const FCompositeFontCompositeFont
 
FName TypefaceFontName
 
float Size
 
int32 LetterSpacing = 0
 
float SkewAmount = 0.0f
 
EFontFallback FontFallback
 
bool bForceMonospaced = false
 
bool bMaterialIsStencil = false
 
float MonospacedWidth = 1.0f
 

Friends

uint32 GetLegacyTypeHash (const FSlateFontInfo &FontInfo)
 
uint32 GetTypeHash (const FSlateFontInfo &FontInfo)
 

Detailed Description

A representation of a font in Slate.

Constructor & Destructor Documentation

◆ FSlateFontInfo() [1/7]

FSlateFontInfo::FSlateFontInfo ( )

Default constructor.

◆ ~FSlateFontInfo()

FSlateFontInfo::~FSlateFontInfo ( )
inline

Dtor. Must be inline

◆ FSlateFontInfo() [2/7]

FSlateFontInfo::FSlateFontInfo ( TSharedPtr< const FCompositeFont InCompositeFont,
const float  InSize,
const FName InTypefaceFontName = NAME_None,
const FFontOutlineSettings InOutlineSettings = FFontOutlineSettings() 
)

Creates and initializes a new instance with the specified font, size, and emphasis.

Parameters
InCompositeFontThe font instance to use.
InSizeThe size of the font.
InTypefaceFontNameThe name of the font to use from the default typeface (None will use the first entry)

◆ FSlateFontInfo() [3/7]

FSlateFontInfo::FSlateFontInfo ( const UObject InFontObject,
const float  InSize,
const FName InTypefaceFontName = NAME_None,
const FFontOutlineSettings InOutlineSettings = FFontOutlineSettings() 
)

Creates and initializes a new instance with the specified font, size, and emphasis.

Parameters
InFontObjectThe font instance to use.
InSizeThe size of the font.
InFamilyFontNameThe name of the font to use from the default typeface (None will use the first entry)

◆ FSlateFontInfo() [4/7]

FSlateFontInfo::FSlateFontInfo ( const FString &  InFontName,
float  InSize,
EFontHinting  InHinting = EFontHinting::Default,
const FFontOutlineSettings InOutlineSettings = FFontOutlineSettings() 
)

Creates and initializes a new instance with the specified font name and size.

Parameters
InFontNameThe name of the font.
InSizeThe size of the font.
InHintingThe type of hinting to use for the font.

◆ FSlateFontInfo() [5/7]

FSlateFontInfo::FSlateFontInfo ( const FName InFontName,
float  InSize,
EFontHinting  InHinting = EFontHinting::Default 
)

Creates and initializes a new instance with the specified font name and size.

Parameters
InFontNameThe name of the font.
InSizeThe size of the font.
InHintingThe type of hinting to use for the font.

◆ FSlateFontInfo() [6/7]

FSlateFontInfo::FSlateFontInfo ( const ANSICHAR InFontName,
float  InSize,
EFontHinting  InHinting = EFontHinting::Default 
)

Creates and initializes a new instance with the specified font name and size.

Parameters
InFontNameThe name of the font.
InSizeThe size of the font.
InHintingThe type of hinting to use for the font.

◆ FSlateFontInfo() [7/7]

FSlateFontInfo::FSlateFontInfo ( const WIDECHAR InFontName,
float  InSize,
EFontHinting  InHinting = EFontHinting::Default 
)

Creates and initializes a new instance with the specified font name and size.

Parameters
InFontNameThe name of the font.
InSizeThe size of the font.
InHintingThe type of hinting to use for the font.

Member Function Documentation

◆ AddReferencedObjects()

void FSlateFontInfo::AddReferencedObjects ( FReferenceCollector Collector)

◆ GetClampSize()

float FSlateFontInfo::GetClampSize ( ) const

Get the font size clamp for the font renderer (on 16bits)

◆ GetClampSkew()

float FSlateFontInfo::GetClampSkew ( ) const

Get the skew amount clamp for the text shaper

◆ GetCompositeFont()

const FCompositeFont * FSlateFontInfo::GetCompositeFont ( ) const

Get the composite font pointer associated with this font info (either directly or via a UFont)

Note
This function will return the fallback font if this font info itself does not contain a valid font. If you want to test whether this font info is empty, use HasValidFont

◆ HasValidFont()

bool FSlateFontInfo::HasValidFont ( ) const

Check to see whether this font info has a valid composite font pointer set (either directly or via a UFont)

◆ IsIdenticalTo()

bool FSlateFontInfo::IsIdenticalTo ( const FSlateFontInfo Other) const
inline

◆ IsLegacyIdenticalTo()

bool FSlateFontInfo::IsLegacyIdenticalTo ( const FSlateFontInfo Other) const
inline

We need to verify equality without taking into account some more recently added UPROPERTY.. this is required and used only by the legacy FSlateFontKey.

◆ operator==()

bool FSlateFontInfo::operator== ( const FSlateFontInfo Other) const
inline

Friends And Related Symbol Documentation

◆ GetLegacyTypeHash

uint32 GetLegacyTypeHash ( const FSlateFontInfo FontInfo)
friend

We need a Type Hash that does not take into account some more recently added UPROPERTY.. this is required and used only by the legacy FSlateFontKey.

◆ GetTypeHash

uint32 GetTypeHash ( const FSlateFontInfo FontInfo)
friend

Calculates a type hash value for a font info.

Type hashes are used in certain collection types, such as TMap.

Parameters
FontInfoThe font info to calculate the hash for.
Returns
The hash value.

Member Data Documentation

◆ bForceMonospaced

bool FSlateFontInfo::bForceMonospaced = false

Enable pseudo-monospaced font.

◆ bMaterialIsStencil

bool FSlateFontInfo::bMaterialIsStencil = false

When enabled, whole quads are filled by the material without automatically stenciling the text - this needs to be done within the material (using Font Signed Distance node).

◆ CompositeFont

TSharedPtr<const FCompositeFont> FSlateFontInfo::CompositeFont

The composite font data to use (valid when used with a Slate style set in C++)

◆ FontFallback

EFontFallback FSlateFontInfo::FontFallback

The font fallback level. Runtime only, don't set on shared FSlateFontInfo, as it may change the font elsewhere (make a copy).

◆ FontMaterial

TObjectPtr<UObject> FSlateFontInfo::FontMaterial

The material to use when rendering

◆ FontObject

TObjectPtr<const UObject> FSlateFontInfo::FontObject

The font object (valid when used from UMG or a Slate widget style asset)

◆ LetterSpacing

int32 FSlateFontInfo::LetterSpacing = 0

The uniform spacing (or tracking) between all characters in the text.

◆ MonospacedWidth

float FSlateFontInfo::MonospacedWidth = 1.0f

The uniform width to apply to all characters when bForceMonospaced is enabled, proportional of the font Size.

◆ OutlineSettings

FFontOutlineSettings FSlateFontInfo::OutlineSettings

Settings for applying an outline to a font

◆ Size

float FSlateFontInfo::Size

The font size is a measure in point values. The conversion of points to Slate Units is done at 96 DPI. So if you're using a tool like Photoshop to prototype layouts and UI mock ups, you can change the UMG Font settings to ensure that UMG font size is displayed in its 72 DPI equivalent, even if Slate will still use 96 DPI internally.

◆ SkewAmount

float FSlateFontInfo::SkewAmount = 0.0f

A skew amount to apply to the text.

◆ TypefaceFontName

FName FSlateFontInfo::TypefaceFontName

The name of the font to use from the default typeface (None will use the first entry)


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