macroquad-text 0.2.0

A Simple way to draw text in macroquad with support of using glyphs from multiple fonts in a single draw_text call, also known as fallback fonts
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
pub use std::io::{Error as IoError, ErrorKind as IoErrorKind, Result as IoResult};
use std::{fs::File, io::Read, path::Path};

pub fn read_file(path: impl AsRef<Path>) -> IoResult<Vec<u8>> {
  let mut file = File::open(path)?;
  let total_bytes = file.metadata()?.len() as usize;
  let mut bytes = Vec::with_capacity(total_bytes);

  file.read_to_end(&mut bytes)?;

  Ok(bytes)
}