TextRunProperties
trait · ferroui-base · v0.5.0
trait TextRunProperties: 'static
Properties that can change from one run to the next, such as typeface or foreground brush.
Handled as Rc<dyn TextRunProperties>; compare with == on the trait
object (value equality of the members, as upstream's Equals).
Members
typefacerequested_font_familyfont_rendering_em_sizefont_scaleeffective_font_rendering_em_sizetext_decorationsforeground_brushbackground_brushculture_infofont_featuresbaseline_alignmentcached_glyph_typeface
typeface
fn typeface(self: &Self) -> &Typeface
Run typeface.
requested_font_family
fn requested_font_family(self: &Self) -> &FontFamily
The family requested by the source before glyph fallback. The family metrics policy uses its regular face without changing the glyphs drawn.
font_rendering_em_size
fn font_rendering_em_size(self: &Self) -> f64
Font size requested by the source, before a fallback multiplier.
font_scale
fn font_scale(self: &Self) -> f64
Provider fallback multiplier relative to the source em size. Existing run implementations use one. Custom values must be finite and positive.
effective_font_rendering_em_size
fn effective_font_rendering_em_size(self: &Self) -> f64
Effective em size for glyph shaping, drawing and font metrics. The
source's font_rendering_em_size remains unchanged by fallback.
text_decorations
fn text_decorations(self: &Self) -> Option<&TextDecorationCollection>
Run text decorations.
foreground_brush
fn foreground_brush(self: &Self) -> Option<&Rc<dyn IBrush>>
Brush used to fill text.
background_brush
fn background_brush(self: &Self) -> Option<&Rc<dyn IBrush>>
Brush used to paint background of run.
culture_info
fn culture_info(self: &Self) -> Option<&Locale>
Run text culture.
font_features
fn font_features(self: &Self) -> Option<&FontFeatureCollection>
Optional features of used font.
baseline_alignment
fn baseline_alignment(self: &Self) -> BaselineAlignment
Run vertical box alignment.
cached_glyph_typeface
fn cached_glyph_typeface(self: &Self) -> Rc<GlyphTypeface>
The glyph typeface of TextRunProperties::typeface.
Upstream caches it in a field of the base class; implementations that
are used for more than a handful of runs should do the same (as
GenericTextRunProperties does) and override this method.
Trait implementations
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.