RenderContext

Struct RenderContext 

Source
pub struct RenderContext<'t, 'f> { /* private fields */ }

Implementations§

Source§

impl<'t, 'f> RenderContext<'t, 'f>

Source

pub fn new<T>(render_target: &'t mut T) -> Self
where T: RenderTarget<'f>,

Source

pub fn flush(&mut self)

Source

pub fn width(&self) -> f32

Source

pub fn height(&self) -> Option<f32>

Source

pub fn font_library(&self) -> &'f FontLibrary

Source

pub fn style(&self) -> &Style

Source

pub fn line_width(&mut self, line_width: f32)

Source

pub fn font_id(&mut self, font_id: u32)

Source

pub fn font(&mut self, font_family: &str, font_variant: FontVariant)

Source

pub fn font_family(&mut self, font_family: &str)

Source

pub fn font_variant(&mut self, font_variant: FontVariant)

Source

pub fn underline(&mut self, underline: bool)

Source

pub fn font_size(&mut self, font_size: f32)

Source

pub fn line_height(&mut self, line_height: f32)

Source

pub fn enable_scripts(&mut self, scripts: impl Into<ScriptSet>)

Source

pub fn disable_scripts(&mut self, scripts: impl Into<ScriptSet>)

Source

pub fn enable_languages(&mut self, languages: impl Into<LanguageSet>)

Source

pub fn disable_languages(&mut self, languages: impl Into<LanguageSet>)

Source

pub fn enable_features(&mut self, features: impl Into<FeatureSet>)

Source

pub fn disable_features(&mut self, features: impl Into<FeatureSet>)

Source

pub fn draw_color(&mut self, draw_color: Color)

Source

pub fn fill_color(&mut self, fill_color: Color)

Source

pub fn text_color(&mut self, text_color: Color)

Source

pub fn block(&self) -> Block<'f>

Source

pub fn fits(&self, h: f32) -> bool

Source

pub fn put(&mut self, block: &Block<'_>)

Source

pub fn place(&mut self, origin: (f32, f32), block: &Block<'_>)

Source

pub fn cursor(&self) -> (f32, f32)

Source

pub fn indent(&mut self, left: f32, right: f32)

Source

pub fn unindent(&mut self, left: f32, right: f32)

Source

pub fn path(&mut self) -> PathContext<'_>

Source

pub fn line(&mut self, start: (f32, f32), stop: (f32, f32))

Source

pub fn rectangle( &mut self, origin: (f32, f32), size: (f32, f32), style: PathStyle, )

Source

pub fn rounded_rectangle( &mut self, origin: (f32, f32), size: (f32, f32), radius: (f32, f32, f32, f32), style: PathStyle, )

Source

pub fn text(&mut self, origin: (f32, f32), text: &str)

Source

pub fn text_width(&self, text: &str) -> f32

Source

pub fn cell( &mut self, w: f32, text: &str, border: impl Into<BorderSet>, target: CursorTarget, align: TextAlign, fill: bool, )

Source

pub fn write_nb(&mut self, text: &str, target: CursorTarget)

Source

pub fn write(&mut self, text: &str, target: CursorTarget)

Source

pub fn ln(&mut self, h: impl Into<Option<f32>>)

Source

pub fn image(&mut self, image: ImageRef, origin: (f32, f32), size: (f32, f32))

Auto Trait Implementations§

§

impl<'t, 'f> Freeze for RenderContext<'t, 'f>

§

impl<'t, 'f> !RefUnwindSafe for RenderContext<'t, 'f>

§

impl<'t, 'f> !Send for RenderContext<'t, 'f>

§

impl<'t, 'f> !Sync for RenderContext<'t, 'f>

§

impl<'t, 'f> Unpin for RenderContext<'t, 'f>

§

impl<'t, 'f> !UnwindSafe for RenderContext<'t, 'f>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.