class

Egui::RichText

Inherits Reference < Object

Constructors

new(text : String, size : Float64 | Nil = nil, color : Color32 | Nil = nil, underline : Bool = false, bold : Bool = false, italic : Bool = false, code : Bool = false, strikethrough : Bool = false)
Source

Class methods

fade_code_runs(runs : Array(TextRun), visuals : Visuals) : Array(TextRun)

When no monospace stack is installed (Context#mono_fonts nil), monospace runs draw in the SAME proportional font and inline code stops reading as code — retint them weaker so the span stays visible. Runs are immutable; this rebuilds the affected ones (explicitly colored runs keep their color). No-op for non-monospace runs.

Source

Instance methods

bold

Base bold for the whole string (headings): routes to the real bold variant face when one is installed.

Source
bold?
Source
code

Base monospace family for the whole string (code blocks).

Source
code?
Source
color(c : Color32) : RichText
Source
color
Source
heading(default_size : Float64) : RichText
Source
italic

Base italic for the whole string: routes to the real italic variant face when one is installed.

Source
italic?
Source
runs(default_size : Float64, default_color : Color32, override_size : Float64 | Nil = nil, override_bold : Bool | Nil = nil) : Array(TextRun)
Source
size(s : Float64) : RichText
Source
size
Source
small(default_size : Float64) : RichText
Source
strikethrough

Line through the middle of the text (markdown ~~text~~).

Source
strikethrough?
Source
text
Source
underline
Source
underline?
Source
weak(visuals : Visuals) : RichText
Source

Nested types