FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ITextDrawingSink

    trait · ferroui-base · v0.5.0

    trait ITextDrawingSink
    

    The drawing calls text needs.

    Upstream draws text lines, glyph runs and decorations onto a DrawingContext. Text is written against this trait, which mirrors the corresponding DrawingContext members one to one; the drawing context implements it, so a drawing context is passed wherever a sink is taken.

    View source

    Members

    draw_glyph_run

    fn draw_glyph_run(self: &mut Self, foreground: Option<&Rc<dyn IBrush>>, glyph_run: &Rc<GlyphRun>)
    

    Draws a glyph run (DrawingContext.DrawGlyphRun(IBrush? foreground, GlyphRun glyphRun)).

    Source

    draw_rectangle

    fn draw_rectangle(self: &mut Self, brush: Option<&Rc<dyn IBrush>>, pen: Option<&Rc<dyn IPen>>, rect: Rect)
    

    Draws a rectangle with the specified brush and pen (DrawingContext.DrawRectangle(IBrush? brush, IPen? pen, Rect rect)).

    Source

    draw_line

    fn draw_line(self: &mut Self, pen: &Rc<dyn IPen>, p1: Point, p2: Point)
    

    Draws a line (DrawingContext.DrawLine(IPen pen, Point p1, Point p2)).

    Source

    push_transform

    fn push_transform(self: &mut Self, matrix: Matrix)
    

    Pushes a matrix transformation (DrawingContext.PushTransform(Matrix matrix)). Every push is balanced by one ITextDrawingSink::pop_transform.

    Source

    pop_transform

    fn pop_transform(self: &mut Self)
    

    Pops the transformation pushed last (disposing upstream's PushedState).

    Source

    Trait implementations

    Availability

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