pub struct GsvText { /* private fields */ }Expand description
Geometric stroke vector text renderer.
Renders text using a built-in stroke-based font. Each character is described as a series of stroked line segments, making the output resolution-independent.
Port of C++ gsv_text.
Implementations§
Source§impl GsvText
impl GsvText
pub fn new() -> Self
Sourcepub fn set_font(&mut self, font: Option<&'static [u8]>)
pub fn set_font(&mut self, font: Option<&'static [u8]>)
Set the font data. If None, uses the loaded font (if any).
pub fn flip(&mut self, flip_y: bool)
pub fn size(&mut self, height: f64, width: f64)
pub fn space(&mut self, space: f64)
pub fn line_space(&mut self, line_space: f64)
pub fn start_point(&mut self, x: f64, y: f64)
pub fn text(&mut self, text: &str)
Sourcepub fn load_font_data(&mut self, data: &[u8])
pub fn load_font_data(&mut self, data: &[u8])
Load font data from a byte slice (replaces C++ file-based load_font).
Sourcepub fn text_width(&mut self) -> f64
pub fn text_width(&mut self) -> f64
Compute the bounding width of the current text.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GsvText
impl RefUnwindSafe for GsvText
impl Send for GsvText
impl Sync for GsvText
impl Unpin for GsvText
impl UnwindSafe for GsvText
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