DreamGUI
Reference

UDreamRichTextBlock

A rich text block whose hierarchy is code, not an asset: one paragraph that reads markup.

Inherits from UDreamUIControl.

Declared in Public/Controls/DreamRichTextBlock.h.

A rich text block whose hierarchy is code, not an asset: one paragraph that reads markup.

UMG's RichTextBlock resolves <Tag>text</Tag> against a decorator set; this library's text stack has had the same idea since it was written -- UDreamText::bRichText plus two data assets, one mapping tags to styles and one mapping tags to images -- and what was missing was a CONTROL that turns it on. That is all this class is: a text node with the flag set, the two assets exposed, and the colour and size coming from the project sheet like every other control's.

WHY IT IS A CONTROL AND NOT A FLAG ON A TEXT NODE

The flag already exists on the node, and an author who wants it there can still set it. What a control adds is the thing a flag cannot: a Native.RichText tag that reads the project's text colour and size, so a project restyles its prose in one place, and a place for the two data assets to be authored per instance without anyone reaching into a visual.

WHAT THE MARKUP MEANS is not this control's business and is not restated here -- the tag vocabulary, the filter flags and the two asset formats belong to UDreamText and its parser, and a second description of them in a control header is a second thing to keep true.

Properties

NameTypeCategoryIn the details panelFrom BlueprintDescription
StyleFDreamRichTextStyleRich TextyesGetStyle / SetStyleThis instance's own look. The project sheet wins while StyleSource says so AND a sheet actually exists; with no sheet in the project this IS the look in effect.
TextFTextRich TextyesGetText / SetTextThe prose, markup and all.
TagFilterFlagsint32Rich TextyesGetTagFilterFlags / SetTagFilterFlagsWhich tags the parser is allowed to act on. The default is all of them.
CustomStyleDataTObjectPtr<UDreamUIRichTextCustomStyleData>Rich TextyesGetCustomStyleData / SetCustomStyleDataWhat <MyTag> means, as a style. Null leaves custom tags to the char-selection consumers.
ImageDataTObjectPtr<UDreamUIRichTextImageData_BaseObject>Rich TextyesGetImageData / SetImageDataWhat <img=key/> means. Null draws nothing for an image tag. The tag may also give a size and where the image sits on its line: <img=key,24/>, <img=key,24,32/>, <img=key,24,baseline/> -- middle (the default, centred), baseline, top or bottom. An image taller than its line makes the line taller.
HorizontalAlignmentEDreamUITextParagraphHorizontalAlignRich TextyesGetHorizontalAlignment / SetHorizontalAlignmentHow the paragraph sits in the control's rect.
VerticalAlignmentEDreamUITextParagraphVerticalAlignRich TextyesGetVerticalAlignment / SetVerticalAlignment
OverflowTypeEDreamUITextOverflowTypeRich TextyesGetOverflowType / SetOverflowTypeWhat a line too long for the control does. VerticalOverflow is the one that WRAPS, which is what prose usually wants and what a rich text block almost always is.
bAutoWrapTextboolRich TextyesGetAutoWrapText / SetAutoWrapTextBreak a line that does not fit rather than letting it run on -- UMG's AutoWrapText.
TextTransformPolicyEDreamUITextTransformPolicyRich TextyesGetTextTransformPolicy / SetTextTransformPolicyCase the prose is DRAWN in -- UMG's TextTransformPolicy. The authored string is untouched.
MinDesiredWidthfloatRich TextyesGetMinDesiredWidth / SetMinDesiredWidthA floor under the width the paragraph asks a content-sized parent for -- UMG's MinDesiredWidth. Zero means no opinion, which is every block that exists today.
LanguageFStringRich TextyesGetLanguage / SetLanguageThe language the prose is written in, as a culture name ("ja", "zh-Hans"); empty is the game's. Picks the font's fallbacks meant for it and the forms a script draws per language -- see UDreamText::Language. <lang=xx> still overrides it for what the tag encloses.
TabSizefloatRich TextyesGetTabSize / SetTabSizeTab stops in spaces, from the line's start edge -- CSS tab-size, 8 as browsers have it.
TextJustifyEDreamTextJustifyRich TextyesGetTextJustify / SetTextJustifyWhere a justified line gets its extra room. Read only with HorizontalAlignment Justify.
LastLineAlignEDreamTextLastLineAlignRich TextyesGetLastLineAlign / SetLastLineAlignHow a justified paragraph's last line, and a line a newline ends, align. Read only with HorizontalAlignment Justify.
SmallTextRasterEDreamTextSmallTextRasterRich TextyesGetSmallTextRaster / SetSmallTextRasterOff keeps the prose on its font's distance field at every size; see UDreamText::SmallTextRaster.
TextNodeTObjectPtr<UDreamWidget>Rich Text-read onlyThe paragraph itself. Public because everything under a control is reachable by name.

Functions

FunctionKindDescription
bool GetAutoWrapText()pureGet Auto Wrap Text
UDreamUIRichTextCustomStyleData* GetCustomStyleData()pureGet Custom Style Data
UMaterialInstanceDynamic* GetDefaultDynamicMaterial()callableA material instance of this block's own, created over the style's material the first time it is asked for -- UMG's GetDefaultDynamicMaterial.
UDreamUIFontData_BaseObject* GetDefaultFont()pureThe DEFAULT typeface for undecorated prose -- UMG's SetDefaultFont, minus what FSlateFontInfo packs in beside it: the size is Style.FontSize and the outline is Style.TextStyle. Markup may still switch the face per run; this is what a run that says nothing gets.
EDreamUITextParagraphHorizontalAlign GetHorizontalAlignment()pureGet Horizontal Alignment
UDreamUIRichTextImageData_BaseObject* GetImageData()pureGet Image Data
FString GetLanguage()pureGet Language
EDreamTextLastLineAlign GetLastLineAlign()pureGet Last Line Align
float GetMinDesiredWidth()pureGet Min Desired Width
EDreamUITextOverflowType GetOverflowType()pureGet Overflow Type
EDreamTextSmallTextRaster GetSmallTextRaster()pureGet Small Text Raster
FDreamRichTextStyle GetStyle()pureGet Style
float GetTabSize()pureGet Tab Size
int32 GetTagFilterFlags()pureGet Tag Filter Flags
FText GetText()pureGet Text
EDreamTextJustify GetTextJustify()pureGet Text Justify
EDreamUITextTransformPolicy GetTextTransformPolicy()pureGet Text Transform Policy
EDreamUITextParagraphVerticalAlign GetVerticalAlignment()pureGet Vertical Alignment
void RefreshTextLayout()callableRe-parse the markup and lay the paragraph out again -- UMG's RefreshTextLayout.
void SetAutoWrapText(bool bInAutoWrapText)callableSet Auto Wrap Text
void SetCustomStyleData(UDreamUIRichTextCustomStyleData* InCustomStyleData)callableWhat the custom tags mean. UMG's TextStyleSet under the name this library gives it: a data asset mapping tag to style, which is the same job its RichTextStyleRow table does.
void SetDefaultFont(UDreamUIFontData_BaseObject* InFont)callableSet Default Font
void SetHorizontalAlignment(EDreamUITextParagraphHorizontalAlign InHorizontalAlignment)callableSet Horizontal Alignment
void SetImageData(UDreamUIRichTextImageData_BaseObject* InImageData)callableSet Image Data
void SetJustification(EDreamUITextParagraphHorizontalAlign InJustification)callableUMG's Justification, which on a paragraph is the horizontal alignment. One implementation.
void SetLanguage(FString InLanguage)callableSet Language
void SetLastLineAlign(EDreamTextLastLineAlign InLastLineAlign)callableSet Last Line Align
void SetMinDesiredWidth(float InMinDesiredWidth)callableSet Min Desired Width
void SetOverflowType(EDreamUITextOverflowType InOverflowType)callableSet Overflow Type
void SetSmallTextRaster(EDreamTextSmallTextRaster InSmallTextRaster)callableSet Small Text Raster
void SetStyle(FDreamRichTextStyle InStyle)callableThe whole look at once, re-pushed.
void SetTabSize(float InTabSize)callableSet Tab Size
void SetTagFilterFlags(int32 InTagFilterFlags)callableSet Tag Filter Flags
void SetText(FText InText)callableReplace the prose. Re-parsed on the way in, which is what the markup costs.
void SetTextJustify(EDreamTextJustify InTextJustify)callableSet Text Justify
void SetTextOverflowPolicy(EDreamUITextOverflowType InOverflowPolicy)callableUMG's name for the same decision. Forwards, so there is one writer and one truth.
void SetTextTransformPolicy(EDreamUITextTransformPolicy InTransformPolicy)callableSet Text Transform Policy
void SetVerticalAlignment(EDreamUITextParagraphVerticalAlign InVerticalAlignment)callableSet Vertical Alignment

Compared with UMG

Every Blueprint-facing member of the UMG class, and where it went. adopt: same name, same meaning. map: here under another name or on another type. reject: deliberately absent, with the reason.

UMGMemberStatusHereNote
URichTextBlockTextadoptTextFText here, like UMG's -- a rich text block is prose, not a field's value.
URichTextBlockTextStyleSetmapCustomStyleDataA data ASSET mapping tag to style rather than a UDataTable of RichTextStyleRow, which is the same job in this library's own shape. Its sibling ImageData answers <img=key/>, which UMG spells as a decorator.
URichTextBlockDecoratorClassesmapImageDataThe extension point for markup here is a pair of DATA ASSETS, not a list of subclasses: ImageData answers <img=key/> exactly as UMG's built-in image decorator answers one from its brush table, and CustomStyleData answers <MyTag>. Both are authored properties with setters that re-parse, which is the whole of what a decorator list buys in UMG.
URichTextBlockDefaultTextStyleOverridemapStyleFDreamRichTextStyle IS the inline default style: colour, size, and now the outline/shadow/glow struct. Which of it is in effect is EDreamUIStyleSource plus the per-field bOverride_ bits, rather than one bOverrideDefaultStyle flag.
URichTextBlockMinDesiredWidthadoptMinDesiredWidthPushed onto the paragraph, which is what a content-sized parent measures: a rich text block IS its paragraph, stretched to the control's rect.
URichTextBlockbOverrideDefaultStylemapUDreamUIControl::StyleSourceThe same question with three answers instead of two: the project sheet, this instance, or the sheet with this instance's ticked fields written over it. Lives on UDreamUIControl, shared by every control in the family.
URichTextBlockTextTransformPolicyadoptTextTransformPolicyEDreamUITextTransformPolicy -- the library's own None/ToLower/ToUpper. The authored string is untouched; only the drawing changes.
URichTextBlockTextOverflowPolicymapOverflowTypeEDreamUITextOverflowType, which has UMG's two answers (Truncate is Clip, Ellipsis is Ellipsis) plus the two that decide whether a long line wraps. SetTextOverflowPolicy carries the UMG name.
URichTextBlockSetDefaultColorAndOpacitymapFDreamRichTextStyle::TextColorAppearance lives in the style struct, so the colour moves through SetStyle or the project sheet. A second setter writing the inline struct would be silently inert whenever StyleSource is the sheet.
URichTextBlockSetDefaultShadowColorAndOpacitymapFDreamTextStyle::UnderlayColorA drop shadow here is the UNDERLAY, carried by FDreamRichTextStyle::TextStyle. Alpha zero means no shadow, which is the shipped default and therefore what every existing block draws.
URichTextBlockSetDefaultShadowOffsetmapFDreamTextStyle::UnderlayOffsetIn em rather than pixels, so the shadow reads the same at every font size.
URichTextBlockSetDefaultFontmapFDreamRichTextStyle::FontA font DATA ASSET rather than an FSlateFontInfo: the size is Style.FontSize and the outline is Style.TextStyle. SetDefaultFont/GetDefaultFont read and write Style.Font, and markup may still switch the face per run -- this is what a run that says nothing gets. Null leaves the paragraph on the font it has.
URichTextBlockSetDefaultStrikeBrushrejectA strike-through here is drawn by the text renderer from UDreamText::bStrikethrough, not composited from a replaceable Slate brush. There is no image in that path for a brush to be.
URichTextBlockSetMinDesiredWidthadoptSetMinDesiredWidth
URichTextBlockSetAutoWrapTextadoptSetAutoWrapTextOff by default, the paragraph's own default. It only bites under the overflow types that do not already wrap -- VerticalOverflow always does.
URichTextBlockSetTextTransformPolicyadoptSetTextTransformPolicy
URichTextBlockSetTextOverflowPolicyadoptSetTextOverflowPolicyForwards to SetOverflowType; one writer, two spellings.
URichTextBlockSetDefaultTextStylemapSetStyleThe whole default look at once, which is what a style struct is.
URichTextBlockSetDefaultMaterialmapFDreamRichTextStyle::OverrideMaterialNull keeps the library's own text material, which is what every existing block uses.
URichTextBlockClearAllDefaultStyleOverridesmapUDreamUIControl::SetStyleSourceGoing back to the sheet is what clearing the overrides means here: SetStyleSource(ProjectStyleSheet). Per-field clearing is the bOverride_ bits on the struct.
URichTextBlockGetDefaultDynamicMaterialadoptGetDefaultDynamicMaterialInstances over the style's material and pushes it onto the paragraph; asked twice, the same instance comes back. Null when the style names no material -- an instance of the library's shared text material would let one caller edit every paragraph in the project.
URichTextBlockSetDecoratorsmapSetImageDataReplacing what the markup resolves against, which is what SetDecorators does in UMG. SetCustomStyleData is the same road for tag styles. Both re-parse, because which tag means what is read while parsing and not afterwards.
URichTextBlockGetTextadoptGetText
URichTextBlockSetTextadoptSetTextRe-parses on the way in, which is what the markup costs.
URichTextBlockGetTextStyleSetmapGetCustomStyleData
URichTextBlockSetTextStyleSetmapSetCustomStyleDataRe-parses, because which tag means what is read while parsing and not afterwards.
URichTextBlockGetDecoratorByClassrejectThere is no decorator object to return. FRichTextParser evaluates every tag directly against the two data assets and hands the result to the text renderer; nothing in that path is an object a caller could be given, hold on to, or reconfigure. Extension here is done by authoring a data asset, not by subclassing a decorator.
URichTextBlockRefreshTextLayoutadoptRefreshTextLayoutPushes the same prose through the parser again, which is what picks up a style or image asset edited in place since the last parse.

On this page