[][src]Trait penrose::draw::DrawContext

pub trait DrawContext {
    pub fn font(&mut self, font_name: &str, point_size: i32) -> Result<()>;
pub fn color(&mut self, color: &Color);
pub fn clear(&mut self);
pub fn translate(&self, dx: f64, dy: f64);
pub fn set_x_offset(&self, x: f64);
pub fn set_y_offset(&self, y: f64);
pub fn rectangle(&self, x: f64, y: f64, w: f64, h: f64);
pub fn text(
        &self,
        s: &str,
        h_offset: f64,
        padding: (f64, f64)
    ) -> Result<(f64, f64)>;
pub fn text_extent(&self, s: &str) -> Result<(f64, f64)>;
pub fn flush(&self); }

Used for simple drawing to the screen

Required methods

pub fn font(&mut self, font_name: &str, point_size: i32) -> Result<()>[src]

Set the active font, must have been registered on the partent Draw

pub fn color(&mut self, color: &Color)[src]

Set the color used for subsequent drawing operations

pub fn clear(&mut self)[src]

Clears the context

pub fn translate(&self, dx: f64, dy: f64)[src]

Translate this context by (dx, dy) from its current position

pub fn set_x_offset(&self, x: f64)[src]

Set the x offset for this context absolutely

pub fn set_y_offset(&self, y: f64)[src]

Set the y offset for this context absolutely

pub fn rectangle(&self, x: f64, y: f64, w: f64, h: f64)[src]

Draw a filled rectangle using the current color

pub fn text(
    &self,
    s: &str,
    h_offset: f64,
    padding: (f64, f64)
) -> Result<(f64, f64)>
[src]

Render 's' using the current font with the supplied padding. returns the extent taken up by the rendered text

pub fn text_extent(&self, s: &str) -> Result<(f64, f64)>[src]

Determine the pixel width of a given piece of text using the current font

pub fn flush(&self)[src]

Flush pending actions

Loading content...

Implementors

impl DrawContext for XcbDrawContext[src]

Loading content...