Struct bottomless_pit::text::Font
source · pub struct Font { /* private fields */ }Expand description
A struct to ensure Font Families are created properly.
Implementations§
source§impl Font
impl Font
sourcepub fn new<P: AsRef<Path>>(path: P, engine: &mut Engine) -> ResourceId<Font>
pub fn new<P: AsRef<Path>>(path: P, engine: &mut Engine) -> ResourceId<Font>
Attempts to load in a Shader from file. This will halt the engine for more information on this halting behavior check the resource module.
Examples found in repository?
examples/text.rs (line 16)
10 11 12 13 14 15 16 17 18 19 20 21 22
fn main() {
let mut engine = EngineBuilder::new()
.set_clear_colour(Colour::BLACK)
.build()
.unwrap();
let comic = Font::new("examples/Comic.ttf", &mut engine);
let text_mat = TextMaterial::new("AA", Colour::RED, 100.0, 100.0, &mut engine);
let text_example = TextExample { text_mat, comic };
engine.run(text_example);
}sourcepub fn from_bytes(data: &[u8], engine: &mut Engine) -> ResourceId<Font>
pub fn from_bytes(data: &[u8], engine: &mut Engine) -> ResourceId<Font>
Attempts to load in a Shader from a byte array. This will not halt the engine, please check the resource module for more information.
Auto Trait Implementations§
impl RefUnwindSafe for Font
impl Send for Font
impl Sync for Font
impl Unpin for Font
impl UnwindSafe for Font
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