epaint_default_fonts/lib.rs
1//! A library containing built-in fonts for `epaint`, embedded as bytes.
2//!
3//! This is intended to be consumed through the `epaint` crate.
4
5#![warn(clippy::std_instead_of_alloc)]
6
7pub mod special_emojis;
8
9/// A typeface designed for source code.
10///
11/// Hack is designed to be a workhorse typeface for source code. It has deep
12/// roots in the free, open source typeface community and expands upon the
13/// contributions of the [Bitstream Vera](https://www.gnome.org/fonts/) and
14/// [DejaVu](https://dejavu-fonts.github.io/) projects. The large x-height +
15/// wide aperture + low contrast design make it legible at commonly used source
16/// code text sizes with a sweet spot that runs in the 8 - 14 range.
17///
18/// See [the Hack repository](https://github.com/source-foundry/Hack) for more
19/// information.
20pub const HACK_REGULAR: &[u8] = include_bytes!("../fonts/Hack-Regular.ttf");
21
22/// A typeface containing emoji characters as designed for the Noto font family.
23///
24/// Requires the `monochrome_emoji_fonts` feature.
25///
26/// Noto is a collection of high-quality fonts with multiple weights and widths
27/// in sans, serif, mono, and other styles, in more than 1,000 languages and
28/// over 150 writing systems. Noto Emoji contains black-and-white emoji
29/// characters that match Google's emoji designs.
30///
31/// See [Google Fonts](https://fonts.google.com/noto/specimen/Noto+Emoji) for
32/// more information.
33#[cfg(feature = "monochrome_emoji_fonts")]
34pub const NOTO_EMOJI_REGULAR: &[u8] = include_bytes!("../fonts/NotoEmoji-Regular.ttf");
35
36/// A typeface designed for use by Ubuntu.
37///
38/// The Ubuntu typeface has been specially created to complement the Ubuntu tone
39/// of voice. It has a contemporary style and contains characteristics unique to
40/// the Ubuntu brand that convey a precise, reliable and free attitude.
41///
42/// See [Ubuntu design](https://design.ubuntu.com/font) for more information.
43pub const UBUNTU_LIGHT: &[u8] = include_bytes!("../fonts/Ubuntu-Light.ttf");
44
45/// Requires the `monochrome_emoji_fonts` feature.
46///
47/// An experimental typeface that uses standardized
48/// [UNICODE planes](http://en.wikipedia.org/wiki/Plane_(Unicode))
49/// for icon fonts.
50///
51/// The icons in this font are designed to be styled with minimal effort. Each
52/// icon is solid, which is useful for changing icon colors.
53///
54/// See [the `emoji-icon-font` repository](https://github.com/jslegers/emoji-icon-font)
55/// for more information.
56#[cfg(feature = "monochrome_emoji_fonts")]
57pub const EMOJI_ICON: &[u8] = include_bytes!("../fonts/emoji-icon-font.ttf");
58
59/// The few icons that egui exposes as `egui::special_emojis`:
60/// the Android, Apple, GitHub, and Windows logos, and the word `git`.
61///
62/// This is a small (3.5 kB) subset of the
63/// [`emoji-icon-font`](https://github.com/jslegers/emoji-icon-font), bundled
64/// unconditionally because no platform font has these private-use codepoints.
65///
66/// See `fonts/egui-icons.txt` for how to regenerate it.
67pub const EGUI_ICONS: &[u8] = include_bytes!("../fonts/egui-icons.ttf");