Struct glyphon::TextRenderer
source · pub struct TextRenderer { /* private fields */ }
Expand description
A text renderer that uses cached glyphs to render text into an existing render pass.
Implementations§
source§impl TextRenderer
impl TextRenderer
sourcepub fn new(
atlas: &mut TextAtlas,
device: &Device,
multisample: MultisampleState,
depth_stencil: Option<DepthStencilState>
) -> Self
pub fn new( atlas: &mut TextAtlas, device: &Device, multisample: MultisampleState, depth_stencil: Option<DepthStencilState> ) -> Self
Creates a new TextRenderer
.
sourcepub fn prepare_with_depth<'a>(
&mut self,
device: &Device,
queue: &Queue,
font_system: &mut FontSystem,
atlas: &mut TextAtlas,
screen_resolution: Resolution,
text_areas: impl IntoIterator<Item = TextArea<'a>>,
cache: &mut SwashCache,
metadata_to_depth: impl FnMut(usize) -> f32
) -> Result<(), PrepareError>
pub fn prepare_with_depth<'a>( &mut self, device: &Device, queue: &Queue, font_system: &mut FontSystem, atlas: &mut TextAtlas, screen_resolution: Resolution, text_areas: impl IntoIterator<Item = TextArea<'a>>, cache: &mut SwashCache, metadata_to_depth: impl FnMut(usize) -> f32 ) -> Result<(), PrepareError>
Prepares all of the provided text areas for rendering.
pub fn prepare<'a>( &mut self, device: &Device, queue: &Queue, font_system: &mut FontSystem, atlas: &mut TextAtlas, screen_resolution: Resolution, text_areas: impl IntoIterator<Item = TextArea<'a>>, cache: &mut SwashCache ) -> Result<(), PrepareError>
sourcepub fn render<'pass>(
&'pass self,
atlas: &'pass TextAtlas,
pass: &mut RenderPass<'pass>
) -> Result<(), RenderError>
pub fn render<'pass>( &'pass self, atlas: &'pass TextAtlas, pass: &mut RenderPass<'pass> ) -> Result<(), RenderError>
Renders all layouts that were previously provided to prepare
.
Auto Trait Implementations§
impl !RefUnwindSafe for TextRenderer
impl Send for TextRenderer
impl Sync for TextRenderer
impl Unpin for TextRenderer
impl !UnwindSafe for TextRenderer
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