FSlateFontMeasure::FindCharacterIndexAtOffset

Finds the character index at the specified position in pixels along the text horizontally

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 int32 FindCharacterIndexAtOffset
(
    const FText & Text,
    const FSlateFontInfo & InFontInfo,
    const int32 HorizontalOffset,
    float FontScale
) const

Remarks

Finds the character index at the specified position in pixels along the text horizontally

Returns

The index of the character closest to the specified horizontal offset

Parameters

Parameter

Description

Text

The text to measure

FontName

The name of the font the text is drawn with

FontSize

The size of the font

HorizontalOffset

Offset horizontally into the text, in pixels

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