embedded_icon/lib.rs
1#![no_std]
2
3//! # Icons for Embedded and Resource Constrained Systems
4//! The embedded-icon crate allows you to use over 7300 icons on all platforms and displays
5//! that support [embedded_graphics].
6//!
7//! ## Usage
8//!
9//! ```rust
10//! # use embedded_graphics::image::Image;
11//! # use embedded_graphics::pixelcolor::{BinaryColor};
12//! # use embedded_graphics::prelude::*;
13//! # use embedded_graphics::mock_display::MockDisplay;
14//! # let mut display = MockDisplay::new();
15//! // Import icons and traits
16//! use embedded_icon::prelude::*;
17//!
18//! // Create an icon
19//! let icon = icons::size24px::Download::new(BinaryColor::On);
20//!
21//! // Wrap it in an embedded_graphics image
22//! let image = Image::new(&icon, Point::zero());
23//!
24//! // Draw it to a display
25//! image.draw(&mut display).unwrap();
26//! ```
27//!
28//! ## Storage Size
29//! Using the crate will - without using any icons - not increase your binary size at all.
30//! All icons that you use are automatically included in the binary. If you use an icon
31//! multiple times, it'll only increase your binary size *once per resolution*.
32//!
33//! ## Resolutions
34//! You can choose which resolutions to enable via features. Available resolutions are:
35//!
36//! | Resolution | Module | Bytes per Icon |
37//! |------------|-------------|----------------|
38//! | 12px | [size12px] | 18 |
39//! | 18px | [size18px] | 41 |
40//! | 24px | [size24px] | 72 |
41//! | 32px | [size32px] | 128 |
42//! | 48px | [size48px] | 288 |
43//! | 96px | [size96px] | 1152 (== 1.2kb)|
44//! | 144px | [size144px] | 2592 (== 2.6kb)|
45//!
46//! ## Preview or find an icon
47//! To see a preview of the included icons, please check out the
48//! [Pictogrammers Website](https://pictogrammers.com/library/mdi/).//!
49//!
50//! ## Contributing
51//!
52//! If you found a bug, or think that a feature is missing, please open an issue on [GitHub](https://github.com/patrickelectric/embedded-icon).
53//! Of course, Pull Requests are also very much appreciated.
54//!
55//!
56//!
57
58pub mod prelude {
59 pub use crate::icon::*;
60 pub use crate::icons;
61}
62
63mod icon;
64pub use icon::*;
65
66pub mod icons;
67pub use icons::*;