1
0
Fork 0
nih-plug/nih_plug_vizia/src/assets.rs

25 lines
1.2 KiB
Rust
Raw Normal View History

2022-03-18 10:22:58 +11:00
//! Binary assets for use with `nih_plug_iced. These fonts first need to be registered by calling
//! [`nih_plug_iced::assets::register_fonts()`][register_fonts()`].
use crate::vizia::Context;
// This module provides a re-export and simple font wrappers around the re-exported fonts.
pub use nih_plug_assets::*;
/// Register the fonts from this module so they can be used with VIZIA.
pub fn register_fonts(cx: &mut Context) {
cx.add_font_mem(NOTO_SANS_REGULAR, fonts::NOTO_SANS_REGULAR);
cx.add_font_mem(NOTO_SANS_REGULAR_ITALIC, fonts::NOTO_SANS_REGULAR_ITALIC);
cx.add_font_mem(NOTO_SANS_LIGHT, fonts::NOTO_SANS_LIGHT);
cx.add_font_mem(NOTO_SANS_LIGHT_ITALIC, fonts::NOTO_SANS_LIGHT_ITALIC);
cx.add_font_mem(NOTO_SANS_BOLD, fonts::NOTO_SANS_BOLD);
cx.add_font_mem(NOTO_SANS_BOLD_ITALIC, fonts::NOTO_SANS_BOLD_ITALIC);
}
pub const NOTO_SANS_REGULAR: &str = "Noto Sans Regular";
pub const NOTO_SANS_REGULAR_ITALIC: &str = "Noto Sans Regular Italic";
pub const NOTO_SANS_LIGHT: &str = "Noto Sans Light";
pub const NOTO_SANS_LIGHT_ITALIC: &str = "Noto Sans Light Italic";
pub const NOTO_SANS_BOLD: &str = "Noto Sans Bold";
pub const NOTO_SANS_BOLD_ITALIC: &str = "Noto Sans Bold Italic";