FSlateFontMeasure::MeasureStringInternal

Measures a string, optionally stopped after the specified horizontal offset in pixels is reached

Choose your operating system:

Windows

macOS

Linux

References

Module

SlateCore

Header

/Engine/Source/Runtime/SlateCore/Public/Fonts/FontMeasure.h

Include

#include "Fonts/FontMeasure.h"

Source

/Engine/Source/Runtime/SlateCore/Private/Fonts/FontMeasure.cpp

Syntax

FVector2D MeasureStringInternal
(
    const FString & Text,
    int32 StartIndex,
    int32 EndIndex,
    const FSlateFontInfo & InFontInfo,
    bool IncludeKerningWithPrecedingChar,
    float FontScale,
    int32 StopAfterHorizontalOffset,
    ELastCharacterIndexFormat CharIndexFormat,
    int32 & OutLastCharacterIndex
) const

Remarks

Measures a string, optionally stopped after the specified horizontal offset in pixels is reached

Returns

The width and height of the string.

Parameters

Parameter

Description

Text

The string to measure

StartIndex

The inclusive index to start measuring the string at

EndIndex

The inclusive index to stop measuring the string at

FontName

The name of the font the string is drawn with

FontSize

The size of the font

StopAfterHorizontalOffset

Offset horizontally into the string to stop measuring characters after, in pixels (or INDEX_NONE)

CharIndexFormat

Behavior to use for StopAfterHorizontalOffset

OutCharacterIndex

The index of the last character processed (used with StopAfterHorizontalOffset)

FontScale

The scale to apply when measuring the text