embedded_mogeefont/lib.rs
1//! 
2//!
3//! MogeeFont was originally created by Nadya Kuzmina for a pixel game that had to fit on a 64×64 pixel screen. You can read about [the history of MogeeFont here](https://nadyakuzmina.com/story-of-mogeefont.html).
4//!
5//! This crate brings the font to embedded systems, it should be used together with [embedded-graphics](https://github.com/embedded-graphics/embedded-graphics) and [embedded-text](https://github.com/embedded-graphics/embedded-text).
6//!
7//! 
8//!
9//! # Usage
10//!
11//! ```rust
12//! use embedded_text::{style::TextBoxStyle, TextBox};
13//! use embedded_mogeefont::MogeeTextStyle;
14//! use embedded_graphics::{
15//! geometry::{Size, Point},
16//! mock_display::MockDisplay,
17//! pixelcolor::BinaryColor,
18//! primitives::Rectangle,
19//! Drawable,
20//! };
21//!
22//! let mut display = MockDisplay::new();
23//! let character_style = MogeeTextStyle::new(BinaryColor::On);
24//! let textbox_style = TextBoxStyle::default();
25//! let textbox_bounds = Rectangle::new(Point::zero(), Size::new(42, 22));
26//! let textbox = TextBox::with_textbox_style(
27//! "Hello, world!",
28//! textbox_bounds,
29//! character_style,
30//! textbox_style,
31//! );
32//! textbox.draw(&mut display).unwrap();
33//! assert_eq!(
34//! display,
35//! MockDisplay::from_pattern(&[
36//! " ",
37//! "# # # # # # #",
38//! "# # # # # # #",
39//! "# # ## # # ## # # # ## ## # ## #",
40//! "#### # # # # # # # # # # # # # # # # #",
41//! "# # ### # # # # # # # # # # # # # # #",
42//! "# # # # # # # # # # # # # # # # ",
43//! "# # ## # # ## # ## # ## # # ## #",
44//! " # ",
45//! " # ",
46//! ]),
47//! );
48//! ```
49//!
50//! # Supported characters
51//!
52//START-SPECIMEN
53//! | Charset | Specimen, upscaled to 2x |
54//! |---------|----------|
55//! | `ASCII` |  |
56//END-SPECIMEN
57//!
58#![no_std]
59#![deny(missing_docs)]
60#![deny(missing_debug_implementations)]
61#![deny(missing_copy_implementations)]
62#![deny(trivial_casts)]
63#![deny(trivial_numeric_casts)]
64#![deny(unsafe_code)]
65#![deny(unstable_features)]
66#![deny(unused_import_braces)]
67#![deny(unused_qualifications)]
68#![deny(rustdoc::broken_intra_doc_links)]
69#![deny(rustdoc::private_intra_doc_links)]
70mod charset;
71mod draw_target;
72mod generated;
73mod kerning;
74mod ligatures;
75mod side_bearings;
76mod text_style;
77
78pub use text_style::TextStyle as MogeeTextStyle;