Navigation
API > API/Runtime > API/Runtime/Slate > API/Runtime/Slate/Framework > API/Runtime/Slate/Framework/Text
Inheritance Hierarchy
- TSharedFromThis
- FTextLayout
- FSlateTextLayout
References
| Module | Slate |
| Header | /Engine/Source/Runtime/Slate/Public/Framework/Text/TextLayout.h |
| Include | #include "Framework/Text/TextLayout.h" |
Syntax
class FTextLayout : public TSharedFromThis< FTextLayout >
Variables
| Type | Name | Description | |
|---|---|---|---|
| bool | ApplyLineHeightToBottomLine | Whether or not line height should be applied to the last line. | |
| int32 | CachedLayoutGeneration | ||
| TAttribute< FString > | DebugSourceInfo | Information given to use by our an external source (typically our owner widget) to help identify who owns this text layout in the case of an error | |
| ETextLayoutDirtyState::Flags | DirtyFlags | Whether parameters on the layout have changed which requires the view be updated. | |
| TSharedRef< IBreakIterator > | GraphemeBreakIterator | The iterator to use to detect grapheme cluster boundaries | |
| ETextJustify::Type | Justification | How the text should be aligned with the margin. | |
| TSharedPtr< IBreakIterator > | LineBreakIterator | The iterator to use to detect appropriate soft-wrapping points for lines | |
| float | LineHeightPercentage | The percentage to modify a line height by. | |
| TArray< FLineModel > | LineModels | The models for the lines of text. A LineModel represents a single string with no manual breaks. | |
| TArray< FLineView > | LineViews | The views for the lines of text. | |
| TSet< int32 > | LineViewsToJustify | The indices for all of the line views that require justification. | |
| FMargin | Margin | The size of the margins to put about the text. This is an unscaled value. | |
| float | OverHeight | Extra height of the last line due to line height. | |
| float | Scale | The scale to draw the text at | |
| FVector2D | ScrollOffset | The scroll offset of the text layout from the parent widget | |
| TUniquePtr< TextBiDi::ITextBiDi > | TextBiDiDetection | Unicode BiDi text detection | |
| ETextFlowDirection | TextFlowDirection | How should the text within this layout be flowed? | |
| FTextLayoutSize | TextLayoutSize | The final size of the text layout on screen. | |
| TOptional< ETextOverflowPolicy > | TextOverflowPolicyOverride | Override for the text overflow policy. If unset, the style is used | |
| ETextShapingMethod | TextShapingMethod | The method used to shape the text within this layout | |
| ETextTransformPolicy | TransformPolicy | The transform policy used by this text layout. | |
| FVector2D | ViewSize | The size of the text layout that can actually be seen from the parent widget | |
| TSharedRef< IBreakIterator > | WordBreakIterator | The iterator to use to detect word boundaries | |
| ETextWrappingPolicy | WrappingPolicy | The wrapping policy used by this text layout. | |
| float | WrappingWidth | The width that the text should be wrap at. If 0 or negative no wrapping occurs. |
Constructors
| Type | Name | Description | |
|---|---|---|---|
FTextLayout () |
Destructors
| Type | Name | Description | |
|---|---|---|---|
~FTextLayout () |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | AddLine
(
const FNewLineData& NewLine |
||
| void | AddLineHighlight
(
const FTextLineHighlight& Highlight |
Adds a single line highlight to the existing set of highlights. | |
| void | AddLines
(
const TArray< FNewLineData >& NewLines |
||
| void | AddRunRenderer
(
const FTextRunRenderer& Renderer |
Adds a single run renderer to the existing set of renderers. | |
| void | BeginLayout () |
Notifies all Runs that we are beginning to generate a new layout. | |
| void | BeginLineLayout
(
FLineModel& LineModel |
Notifies all Runs on the given line is beginning to have a new layout generated. | |
| void | CalculateLineTextDirection
(
FLineModel& LineModel |
Calculates the text direction for the given line based upon the current shaping method and document flow direction | |
| ETextJustify::Type | CalculateLineViewVisualJustification
(
const FLineView& LineView |
Calculates the visual justification for the given line view | |
| void | Calculates the text direction for each line based upon the current shaping method and document flow direction When changing the shaping method, or document flow direction, all the lines need to be dirtied (see DirtyAllLineModels(ELineModelDirtyState::TextBaseDirection)) | ||
| void | Clears all line highlights | ||
| void | ClearLines () |
||
| void | Clears all run renderers | ||
| void | ClearView () |
Clears the current layouts view information. | |
| TSharedRef< IRun > | CreateDefaultTextRun
(
const TSharedRef< FString >& NewText, |
Called to generate a new empty text run for this text layout | |
| void | CreateLineWrappingCache
(
FLineModel& LineModel |
Create the wrapping cache for the given line based upon the current scale | |
| void | Create the wrapping cache for the current text based upon the current scale Each line keeps its own cached state, so needs to be cleared when changing the text within a line When changing the scale, all the lines need to be cleared (see DirtyAllLineModels(ELineModelDirtyState::WrappingInformation)) | ||
| void |
DirtyAllLineModels
(
const ELineModelDirtyState::Flags InDirtyFlags |
Set the given dirty flags on all line models in this layout | |
| void |
DirtyLayout ()
|
||
| void |
DirtyRunLayout
(
const TSharedRef< const IRun >& Run |
||
| void | EndLayout () |
Notifies all Runs that the layout has finished generating. | |
| void | EndLineLayout
(
FLineModel& LineModel |
Notifies all Runs on the given line has finished having a new layout generated. | |
| void | FlushLineTextShapingCache
(
FLineModel& LineModel |
Flushes the text shaping cache for the given line | |
| void | Flushes the text shaping cache for each line | ||
| bool | |||
| void | GetAsText
(
FText& DisplayText, |
||
| void | GetAsText
(
FString& DisplayText, |
||
| FVector2D | GetDrawSize () |
Get the size of the text layout, including any lines which extend beyond the wrapping boundaries (eg, lines with lots of trailing whitespace, or lines with no break candidates) | |
| FTextSelection | GetGraphemeAt
(
const FTextLocation& Location |
||
| ETextJustify::Type | |||
| int32 | GetLineCount () |
||
| float | |||
| const TArray< FTextLayout::FLineModel > & | |||
| int32 | GetLineViewIndexForTextLocation
(
const TArray< FTextLayout::FLineView >& LineViews, |
||
| const TArray< FTextLayout::FLineView > & | GetLineViews () |
||
| FVector2D | GetLocationAt
(
const FTextLocation& Location, |
||
| FMargin | GetMargin () |
||
| float | GetScale () |
||
| void | GetSelectionAsText
(
FString& DisplayText, |
||
| FVector2D | GetSize () |
Get the size of the text layout, including any lines which extend beyond the wrapping boundaries (eg, lines with lots of trailing whitespace, or lines with no break candidates) | |
| ETextFlowDirection | |||
| FTextLocation | GetTextLocationAt
(
const FLineView& LineView, |
||
| FTextLocation | GetTextLocationAt
(
const FVector2D& Relative, |
||
| void | GetTextOffsetLocations
(
FTextOffsetLocations& OutTextOffsetLocations |
Constructs an array containing the mappings between the text that would be returned by GetAsText, and the internal FTextLocation points used within this text layout | |
| ETextShapingMethod | |||
| ETextTransformPolicy | This option is destructive to the model text, so changing it requires refreshing the text layout from its marshaller | ||
| FVector2D | GetViewSize () |
Get the size of the text layout that can actually be seen from the parent widget | |
| ETextJustify::Type | Get the visual justification for this document (based on the visual justification used by the first line of text) | ||
| FTextSelection | GetWordAt
(
const FTextLocation& Location |
||
| FVector2D | Get the size of the text layout after the text has been wrapped, and including the first piece of trailing whitespace for any given soft-wrapped line | ||
| FVector2D | Get the size of the text layout after the text has been wrapped, and including the first piece of trailing whitespace for any given soft-wrapped line | ||
| ETextWrappingPolicy | |||
| float | |||
| bool | InsertAt
(
const FTextLocation& Location, |
||
| bool | InsertAt
(
const FTextLocation& Location, |
||
| bool | InsertAt
(
const FTextLocation& Location, |
||
| bool | IsEmpty () |
||
| bool | |||
| bool | JoinLineWithNextLine
(
int32 LineIndex |
||
| bool | RemoveAt
(
const FTextLocation& Location, |
||
| bool | RemoveLine
(
int32 LineIndex |
||
| void | RemoveLineHighlight
(
const FTextLineHighlight& Highlight |
Removes a single line highlight to the existing set of highlights. | |
| void | RemoveRunRenderer
(
const FTextRunRenderer& Renderer |
Removes a single run renderer to the existing set of renderers. | |
| void | SetApplyLineHeightToBottomLine
(
bool Value |
||
| void | SetDebugSourceInfo
(
const TAttribute< FString >& InDebugSourceInfo |
Set the information used to help identify who owns this text layout in the case of an error | |
| void | SetJustification
(
ETextJustify::Type Value |
||
| void | SetLineBreakIterator
(
TSharedPtr< IBreakIterator > InLineBreakIterator |
Set the iterator to use to detect appropriate soft-wrapping points for lines (or null to go back to using the default) | |
| void | SetLineHeightPercentage
(
float Value |
||
| void | SetLineHighlights
(
const TArray< FTextLineHighlight >& Highlights |
Replaces the current set of line highlights with the provided highlights. | |
| void | |||
| void | SetRunRenderers
(
const TArray< FTextRunRenderer >& Renderers |
Replaces the current set of run renderers with the provided renderers. | |
| void | SetScale
(
float Value |
||
| void | SetTextFlowDirection
(
const ETextFlowDirection InTextFlowDirection |
||
| void | SetTextOverflowPolicy
(
const TOptional< ETextOverflowPolicy > InTextOverflowPolicy |
||
| void | SetTextShapingMethod
(
const ETextShapingMethod InTextShapingMethod |
||
| void | SetTransformPolicy
(
ETextTransformPolicy Value |
||
| void | SetVisibleRegion
(
const FVector2D& InViewSize, |
||
| void | SetWrappingPolicy
(
ETextWrappingPolicy Value |
||
| void | SetWrappingWidth
(
float Value |
||
| bool | SplitLineAt
(
const FTextLocation& Location |
||
| void | TransformLineText
(
FLineModel& LineModel |
Transform the given line model text based on the active transform policy. | |
| void | |||
| void | Updates the TextLayout's if any changes have occurred since the last update. | ||
| void | UpdateLayout () |
Classes
| Type | Name | Description | |
|---|---|---|---|
| ELineModelDirtyState | |||
| ETextLayoutDirtyState | |||
| FBlockDefinition | |||
| FBreakCandidate | |||
| FLineModel | |||
| FLineView | |||
| FLineViewHighlight | |||
| FNewLineData | |||
| FRunModel | |||
| FTextLayoutSize | |||
| FTextOffsetLocations | A mapping between the offsets into the text as a flat string (with line-breaks), and the internal lines used within a text layout |