UCanvas::MeasureStringInternal

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

Windows
MacOS
Linux

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Engine/Canvas.h

Include

#include "Engine/Canvas.h"

Source

/Engine/Source/Runtime/Engine/Private/UserInterface/Canvas.cpp

Syntax

static void MeasureStringInternal
(
    FTextSizingParameters & Parameters,
    const TCHAR *const pText,
    const int32 TextLength,
    const int32 StopAfterHorizontalOffset,
    const ELastCharacterIndexFormat CharIndexFormat,
    int32 & OutLastCharacterIndex
)

Remarks

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

Parameters

Parameter

Description

Parameters

Used for various purposes DrawXL: [out] will be set to the width of the string DrawYL: [out] will be set to the height of the string DrawFont: [in] specifies the font to use for retrieving the size of the characters in the string Scale: [in] specifies the amount of scaling to apply to the string

pText

the string to calculate the size for

TextLength

the number of code units in pText

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)

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