UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FSlateSdfGenerator Class Referenceabstract

#include <SlateSdfGenerator.h>

+ Inheritance diagram for FSlateSdfGenerator:

Classes

struct  FRequestDescriptor
 
struct  FRequestOutputInfo
 

Public Types

enum class  ERequestResponse {
  SUCCESS = 0 , SDF_UNAVAILABLE , BUSY , PLACEHOLDER_ONLY ,
  BAD_REQUEST
}
 
enum class  ESdfType { Simple , Perpendicular , MultichannelAndSimple }
 
using Ptr = TUniquePtr< FSlateSdfGenerator >
 
using FForEachRequestDoneCallback = TFunctionRef< void(const FRequestDescriptor, TArray< uint8 >)>
 

Public Member Functions

virtual ~FSlateSdfGenerator ()
 
virtual ERequestResponse Spawn (const FRequestDescriptor &InRequest, FRequestOutputInfo &OutCharInfo)=0
 
virtual ERequestResponse SpawnWithPlaceholder (const FRequestDescriptor &InRequest, FRequestOutputInfo &OutCharInfo, TArray< uint8 > &OutRawPixels)=0
 
virtual ERequestResponse Respawn (const FRequestDescriptor &InRequest, const FRequestOutputInfo &InCharInfo)=0
 
virtual ERequestResponse MakePlaceholder (const FRequestDescriptor &InRequest, FRequestOutputInfo &OutCharInfo, TArray< uint8 > &OutRawPixels)=0
 
virtual void Update (const FForEachRequestDoneCallback &InEnumerator)=0
 
virtual void Flush ()=0
 

Static Public Member Functions

static Ptr create ()
 

Protected Member Functions

 FSlateSdfGenerator ()
 

Detailed Description

Generates multi-channel signed distance fields for font glyphs.

Member Typedef Documentation

◆ FForEachRequestDoneCallback

Callback function for the finished tasks.

◆ Ptr

Member Enumeration Documentation

◆ ERequestResponse

Generator's response to caller's request.

Enumerator
SUCCESS 

Task spawned successfully (and placeholder generated if requested)

SDF_UNAVAILABLE 

Glyph is available in the face but the SDF generation was not possible/successful

BUSY 

Task not spawned due to task pool being full (try again later)

PLACEHOLDER_ONLY 

Task not spawned but placeholder and output info generated (respawn later)

BAD_REQUEST 

Task not spawned because the request data was not valid

◆ ESdfType

Type of requested signed distance field.

Enumerator
Simple 

Simple single-channel signed distance field based on true Euclidean distance (1 channel/pixel)

Perpendicular 

Single-channel signed distance field based on the perpendicular distance metric, which is always orthogonal to an edge, and produces mitered rather than rounded outlines (1 channel/pixel)

MultichannelAndSimple 

Multi-channel signed distance field with simple (true) signed distance field in additional channel (4 channels/pixel, also known as MTSDF)

Constructor & Destructor Documentation

◆ ~FSlateSdfGenerator()

FSlateSdfGenerator::~FSlateSdfGenerator ( )
virtual

◆ FSlateSdfGenerator()

FSlateSdfGenerator::FSlateSdfGenerator ( )
protected

Member Function Documentation

◆ create()

FSlateSdfGenerator::Ptr FSlateSdfGenerator::create ( )
static

Creates an instance of FSlateSdfGenerator.

◆ Flush()

virtual void FSlateSdfGenerator::Flush ( )
pure virtual

Flushes all started tasks.

Implemented in FSlateSdfGeneratorImpl.

◆ MakePlaceholder()

virtual ERequestResponse FSlateSdfGenerator::MakePlaceholder ( const FRequestDescriptor InRequest,
FRequestOutputInfo OutCharInfo,
TArray< uint8 > &  OutRawPixels 
)
pure virtual

Only generates a placeholder-quality signed distance field immediately into OutRawPixels without spawning.

Implemented in FSlateSdfGeneratorImpl.

◆ Respawn()

virtual ERequestResponse FSlateSdfGenerator::Respawn ( const FRequestDescriptor InRequest,
const FRequestOutputInfo InCharInfo 
)
pure virtual

Attempts to start generating again if previous attempt failed but produced a placeholder, whose FRequestOutputInfo must match.

Implemented in FSlateSdfGeneratorImpl.

◆ Spawn()

virtual ERequestResponse FSlateSdfGenerator::Spawn ( const FRequestDescriptor InRequest,
FRequestOutputInfo OutCharInfo 
)
pure virtual

Starts generating a distance field for the requested glyph.

Implemented in FSlateSdfGeneratorImpl.

◆ SpawnWithPlaceholder()

virtual ERequestResponse FSlateSdfGenerator::SpawnWithPlaceholder ( const FRequestDescriptor InRequest,
FRequestOutputInfo OutCharInfo,
TArray< uint8 > &  OutRawPixels 
)
pure virtual

Starts generating a distance field and immediately provides an approximate distance field placeholder.

Implemented in FSlateSdfGeneratorImpl.

◆ Update()

virtual void FSlateSdfGenerator::Update ( const FForEachRequestDoneCallback InEnumerator)
pure virtual

Checks for finished tasks and processes each of them by calling InEnumerator.

Implemented in FSlateSdfGeneratorImpl.


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