-
-
Notifications
You must be signed in to change notification settings - Fork 265
Expand file tree
/
Copy pathassets.rs
More file actions
38 lines (33 loc) · 1.64 KB
/
assets.rs
File metadata and controls
38 lines (33 loc) · 1.64 KB
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
31
32
33
34
35
36
37
38
//! Binary assets for use with `nih_plug_iced`.
use std::borrow::Cow;
use crate::core::Font;
use iced_baseview::runtime::{font, Command};
// This module provides a re-export and simple font wrappers around the re-exported fonts.
pub use nih_plug_assets::*;
pub const NOTO_SANS_REGULAR: Font = Font::with_name("Noto Sans Regular");
pub const NOTO_SANS_REGULAR_ITALIC: Font = Font::with_name("Noto Sans Regular Italic");
pub const NOTO_SANS_THIN: Font = Font::with_name("Noto Sans Thin");
pub const NOTO_SANS_THIN_ITALIC: Font = Font::with_name("Noto Sans Thin Italic");
pub const NOTO_SANS_LIGHT: Font = Font::with_name("Noto Sans Light");
pub const NOTO_SANS_LIGHT_ITALIC: Font = Font::with_name("Noto Sans Light Italic");
pub const NOTO_SANS_BOLD: Font = Font::with_name("Noto Sans Bold");
pub const NOTO_SANS_BOLD_ITALIC: Font = Font::with_name("Noto Sans Bold Italic");
/// Useful for initializing the Settings, like this:
/// ```rust
/// Settings {
/// ...
/// fonts: noto_sans_fonts_data().into_iter().collect(),
/// }
/// ```
pub const fn noto_sans_fonts_data() -> [Cow<'static, [u8]>; 8] {
[
Cow::Borrowed(nih_plug_assets::fonts::NOTO_SANS_REGULAR),
Cow::Borrowed(nih_plug_assets::fonts::NOTO_SANS_REGULAR_ITALIC),
Cow::Borrowed(nih_plug_assets::fonts::NOTO_SANS_THIN),
Cow::Borrowed(nih_plug_assets::fonts::NOTO_SANS_THIN_ITALIC),
Cow::Borrowed(nih_plug_assets::fonts::NOTO_SANS_LIGHT),
Cow::Borrowed(nih_plug_assets::fonts::NOTO_SANS_LIGHT_ITALIC),
Cow::Borrowed(nih_plug_assets::fonts::NOTO_SANS_BOLD),
Cow::Borrowed(nih_plug_assets::fonts::NOTO_SANS_BOLD_ITALIC),
]
}