[−][src]Trait penrose::draw::DrawContext
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]
&self,
s: &str,
h_offset: f64,
padding: (f64, f64)
) -> Result<(f64, f64)>
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
Implementors
impl DrawContext for XcbDrawContext
[src]
pub fn font(&mut self, font_name: &str, point_size: i32) -> Result<()>
[src]
pub fn color(&mut self, color: &Color)
[src]
pub fn clear(&mut self)
[src]
pub fn translate(&self, dx: f64, dy: f64)
[src]
pub fn set_x_offset(&self, x: f64)
[src]
pub fn set_y_offset(&self, y: f64)
[src]
pub fn rectangle(&self, x: f64, y: f64, w: f64, h: f64)
[src]
pub fn text(
&self,
txt: &str,
h_offset: f64,
padding: (f64, f64)
) -> Result<(f64, f64)>
[src]
&self,
txt: &str,
h_offset: f64,
padding: (f64, f64)
) -> Result<(f64, f64)>