1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*!
Riddle crate for loading font files and rendering text to riddle_image images.

Built largely on the back of `rusttype` and its dependencies.

# Example

```
# use riddle_font::*;
# fn main() -> Result<(), FontError> {
// Load font from TTF file
let ttf_bytes = include_bytes!("../../example_assets/Roboto-Regular.ttf");
let font = TTFont::new(&ttf_bytes[..])?;

// Render the loaded font to a Riddle image
let image = font.render_simple("Simple String", 24)?;
# Ok(())
# }
```
*/

mod error;
mod ttfont;

pub use error::*;
pub use ttfont::TTFont;

use riddle_common::CommonError;

type Result<R> = std::result::Result<R, FontError>;