use quicksilver::{
geom::Vector,
graphics::{Color, VectorFont},
run, Graphics, Input, Result, Settings, Window,
};
fn main() {
run(
Settings {
title: "Font Example",
..Settings::default()
},
app,
);
}
async fn app(window: Window, mut gfx: Graphics, mut input: Input) -> Result<()> {
let ttf = VectorFont::load("font.ttf").await?;
let mut font = ttf.to_renderer(&gfx, 72.0)?;
gfx.clear(Color::WHITE);
font.draw(
&mut gfx,
"Hello world!\nHello Quicksilver!",
Color::BLACK,
Vector::new(100.0, 100.0),
)?;
gfx.present(&window)?;
loop {
while let Some(_) = input.next_event().await {}
}
}