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

#include <SlateFontRenderer.h>

Public Member Functions

 FSlateFontRenderer (const FFreeTypeLibrary *InFTLibrary, FFreeTypeCacheDirectory *InFTCacheDirectory, FCompositeFontCache *InCompositeFontCache)
 
uint16 GetMaxHeight (const FSlateFontInfo &InFontInfo, const float InScale) const
 
int16 GetBaseline (const FSlateFontInfo &InFontInfo, const float InScale) const
 
void GetUnderlineMetrics (const FSlateFontInfo &InFontInfo, const float InScale, int16 &OutUnderlinePos, int16 &OutUnderlineThickness) const
 
void GetStrikeMetrics (const FSlateFontInfo &InFontInfo, const float InScale, int16 &OutStrikeLinePos, int16 &OutStrikeLineThickness) const
 
bool HasKerning (const FFontData &InFontData) const
 
int8 GetKerning (const FFontData &InFontData, const float InSize, TCHAR First, TCHAR Second, const float InScale) const
 
TSharedPtr< FFreeTypeKerningCacheGetKerningCache (const FFontData &InFontData, const uint32 InFontRenderSize) const
 
bool CanLoadCodepoint (const FFontData &InFontData, const UTF32CHAR InCodepoint, EFontFallback MaxFallbackLevel) const
 
bool GetRenderData (const FShapedGlyphEntry &InShapedGlyph, const FFontOutlineSettings &InOutlineSettings, FCharacterRenderData &OutRenderData) const
 

Detailed Description

Bridging point between FreeType and the Slate font system. This class, via the instances you pass to its constructor, knows how to correctly render a Slate font.

Constructor & Destructor Documentation

◆ FSlateFontRenderer()

FSlateFontRenderer::FSlateFontRenderer ( const FFreeTypeLibrary InFTLibrary,
FFreeTypeCacheDirectory InFTCacheDirectory,
FCompositeFontCache InCompositeFontCache 
)

Member Function Documentation

◆ CanLoadCodepoint()

bool FSlateFontRenderer::CanLoadCodepoint ( const FFontData InFontData,
const UTF32CHAR  InCodepoint,
EFontFallback  MaxFallbackLevel 
) const

Whether or not the specified character, within the specified font, can be loaded with the specified maximum font fallback level

Parameters
InFontDataInformation about the font to load
InCodepointThe codepoint being loaded
MaxFallbackLevelThe maximum fallback level to try for the font
Returns
Whether or not the character can be loaded

◆ GetBaseline()

int16 FSlateFontRenderer::GetBaseline ( const FSlateFontInfo InFontInfo,
const float  InScale 
) const
Returns
the baseline for any character in the default font

◆ GetKerning()

int8 FSlateFontRenderer::GetKerning ( const FFontData InFontData,
const float  InSize,
TCHAR  First,
TCHAR  Second,
const float  InScale 
) const

Calculates the kerning amount for a pair of characters

Parameters
InFontDataThe font that used to draw the string with the first and second characters
InSizeThe size of the font to draw
FirstThe first character in the pair
SecondThe second character in the pair
InScaleThe scale at which the font is being drawn
Returns
The kerning amount, 0 if no kerning

◆ GetKerningCache()

TSharedPtr< FFreeTypeKerningCache > FSlateFontRenderer::GetKerningCache ( const FFontData InFontData,
const uint32  InFontRenderSize 
) const

Retrieves the kerning cache object used to retrieve kerning amounts between glyphs

Parameters
InFontDataThe font that used to draw the string with the first and second characters
InFontRenderSizeThe final size of the font to render (including scaling)
Returns
A pointer object referring to the kerning cache matching the given parameters, invalid/null if no kerning is performed

◆ GetMaxHeight()

uint16 FSlateFontRenderer::GetMaxHeight ( const FSlateFontInfo InFontInfo,
const float  InScale 
) const
Returns
The global max height for any character in the default font

◆ GetRenderData()

bool FSlateFontRenderer::GetRenderData ( const FShapedGlyphEntry InShapedGlyph,
const FFontOutlineSettings InOutlineSettings,
FCharacterRenderData OutRenderData 
) const

Creates render data for a specific character

Parameters
InFontDataRaw font data to render the character with
InSizeThe size of the font to draw
InOutlineSettingsOutline settings to apply when rendering the characer
CharThe character to render
OutRenderDataWill contain the created render data
InScaleThe scale of the font
OutFallbackLevelOutputs the fallback level of the font

◆ GetStrikeMetrics()

void FSlateFontRenderer::GetStrikeMetrics ( const FSlateFontInfo InFontInfo,
const float  InScale,
int16 OutStrikeLinePos,
int16 OutStrikeLineThickness 
) const

Get the strike metrics used by any character in the default font

Parameters
OutStrikeLinePosThe offset from the baseline to the center of the strike bar
OutStrikeLineThicknessThe thickness of the strike bar

◆ GetUnderlineMetrics()

void FSlateFontRenderer::GetUnderlineMetrics ( const FSlateFontInfo InFontInfo,
const float  InScale,
int16 OutUnderlinePos,
int16 OutUnderlineThickness 
) const

Get the underline metrics used by any character in the default font

Parameters
OutUnderlinePosThe offset from the baseline to the center of the underline bar
OutUnderlineThicknessThe thickness of the underline bar

◆ HasKerning()

bool FSlateFontRenderer::HasKerning ( const FFontData InFontData) const
Parameters
Whetheror not the font has kerning

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