FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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).

    View source

    Members

    typeface

    fn typeface(self: &Self) -> &Typeface
    

    Run typeface.

    Source

    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.

    Source

    font_rendering_em_size

    fn font_rendering_em_size(self: &Self) -> f64
    

    Font size requested by the source, before a fallback multiplier.

    Source

    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.

    Source

    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.

    Source

    text_decorations

    fn text_decorations(self: &Self) -> Option<&TextDecorationCollection>
    

    Run text decorations.

    Source

    foreground_brush

    fn foreground_brush(self: &Self) -> Option<&Rc<dyn IBrush>>
    

    Brush used to fill text.

    Source

    background_brush

    fn background_brush(self: &Self) -> Option<&Rc<dyn IBrush>>
    

    Brush used to paint background of run.

    Source

    culture_info

    fn culture_info(self: &Self) -> Option<&Locale>
    

    Run text culture.

    Source

    font_features

    fn font_features(self: &Self) -> Option<&FontFeatureCollection>
    

    Optional features of used font.

    Source

    baseline_alignment

    fn baseline_alignment(self: &Self) -> BaselineAlignment
    

    Run vertical box alignment.

    Source

    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.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.