pub struct FontCache { /* private fields */ }Implementations§
Source§impl FontCache
impl FontCache
pub fn new() -> Self
pub fn is_loaded(&self) -> bool
pub fn loaded_from(&self) -> Option<&Path>
pub fn load_for_project(&mut self, project_dir: &Path) -> bool
pub fn load_from_font_dir(&mut self, font_dir: &Path) -> bool
pub fn render_text( &self, images: &mut ImageManager, text: &str, font_px: f32, max_w: u32, max_h: u32, ) -> Option<ImageId>
pub fn render_mwnd_text( &self, images: &mut ImageManager, text: &str, font_px: f32, max_w: u32, max_h: u32, moji_space: Option<(i64, i64)>, ) -> Option<ImageId>
pub fn render_mwnd_text_styled( &self, images: &mut ImageManager, text: &str, font_px: f32, max_w: u32, max_h: u32, moji_space: Option<(i64, i64)>, style: TextStyle, ) -> Option<ImageId>
pub fn render_mwnd_text_styled_into( &self, images: &mut ImageManager, target: Option<ImageId>, text: &str, font_px: f32, max_w: u32, max_h: u32, moji_space: Option<(i64, i64)>, style: TextStyle, ) -> Option<ImageId>
pub fn render_text_into( &self, images: &mut ImageManager, target: Option<ImageId>, text: &str, font_px: f32, max_w: u32, max_h: u32, ) -> Option<ImageId>
pub fn render_text_rgba( &self, text: &str, font_px: f32, max_w: u32, max_h: u32, ) -> Option<RgbaImage>
pub fn render_mwnd_text_rgba( &self, text: &str, font_px: f32, max_w: u32, max_h: u32, moji_space: Option<(i64, i64)>, ) -> Option<RgbaImage>
pub fn render_mwnd_text_rgba_styled( &self, text: &str, font_px: f32, max_w: u32, max_h: u32, moji_space: Option<(i64, i64)>, style: TextStyle, ) -> Option<RgbaImage>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FontCache
impl !RefUnwindSafe for FontCache
impl Send for FontCache
impl Sync for FontCache
impl Unpin for FontCache
impl UnsafeUnpin for FontCache
impl !UnwindSafe for FontCache
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.