pub struct Renderer<'a> { /* private fields */ }Implementations§
Source§impl<'a> Renderer<'a>
impl<'a> Renderer<'a>
Sourcepub fn new(
dfont: &'a DFont,
font_size: f32,
direction: Option<Direction>,
script: Option<Script>,
) -> Self
pub fn new( dfont: &'a DFont, font_size: f32, direction: Option<Direction>, script: Option<Script>, ) -> Self
Create a new renderer for a font
Direction and script are needed for correct shaping; no automatic detection is done.
Sourcepub fn string_to_positioned_glyphs(
&mut self,
string: &str,
) -> Option<(String, Vec<Command>)>
pub fn string_to_positioned_glyphs( &mut self, string: &str, ) -> Option<(String, Vec<Command>)>
Render a string to a series of commands
The commands can be used to render the string to an image. This routine also returns a serialized buffer that can be used both for debugging purposes and also to detect glyph sequences which have been rendered already (which helps to speed up the comparison).
Sourcepub fn render_positioned_glyphs(&mut self, pen_buffer: &[Command]) -> GrayImage
pub fn render_positioned_glyphs(&mut self, pen_buffer: &[Command]) -> GrayImage
Render a series of commands to an image
This routine takes a series of commands returned from [string_to_positioned_glyphs] and renders them to an image.
Auto Trait Implementations§
impl<'a> !Freeze for Renderer<'a>
impl<'a> !RefUnwindSafe for Renderer<'a>
impl<'a> Send for Renderer<'a>
impl<'a> Sync for Renderer<'a>
impl<'a> Unpin for Renderer<'a>
impl<'a> UnsafeUnpin for Renderer<'a>
impl<'a> !UnwindSafe for Renderer<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.