FSlateFontMeasure::Measure

Measures the width and height of a passed in string.

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

virtual FVector2D Measure
(
    const FString & Text,
    int32 StartIndex,
    int32 EndIndex,
    const FSlateFontInfo & InFontInfo,
    bool IncludeKerningWithPrecedingChar,
    float FontScale
) const

Remarks

Measures the width and height of a passed in string. The height is the maximum height of the largest character in the font/size pair

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

InFontInfo

Information about the font that the string is drawn with

FontScale

The scale to apply to the font

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss