UCanvas::TextSize

Calculates the horizontal and vertical size of a given string.

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

void TextSize
(
    const UFont * InFont,
    const FString & InText,
    float & XL,
    float & YL,
    float ScaleX,
    float ScaleY
)

Remarks

Calculates the horizontal and vertical size of a given string. This is used for clipped text as it does not take wrapping into account.

Parameters

Parameter

Description

Font

The font to use.

Text

String to calculate for.

XL

out Horizontal length of string.

YL

out Vertical length of string.

ScaleX

Scale that the string is expected to draw at horizontally.

ScaleY

Scale that the string is expected to draw at vertically.

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