2022-11-06 23:48:12 +11:00
|
|
|
//! Binary assets for use with `nih_plug_vizia`. These fonts first need to be registered using their
|
|
|
|
//! associated registration function.
|
2022-03-18 10:22:58 +11:00
|
|
|
|
2022-06-18 09:59:53 +10:00
|
|
|
use vizia::prelude::*;
|
2022-03-18 10:22:58 +11:00
|
|
|
|
|
|
|
// This module provides a re-export and simple font wrappers around the re-exported fonts.
|
|
|
|
pub use nih_plug_assets::*;
|
|
|
|
|
2023-11-06 08:05:28 +11:00
|
|
|
/// The font name for the Noto Sans font family. Comes in regular, thin, light and bold versions,
|
|
|
|
/// with italic variations for each. Register the variations you want to use with
|
|
|
|
/// [`register_noto_sans_regular()`], [`register_noto_sans_regular_italic()`],
|
|
|
|
/// [`register_noto_sans_thin()`], [`register_noto_sans_thin_italic()`],
|
|
|
|
/// [`register_noto_sans_light()`], [`register_noto_sans_light_italic()`],
|
|
|
|
/// [`register_noto_sans_bold()`], and [`register_noto_sans_bold_italic()`], Use the font weight and
|
|
|
|
/// font style properties to select a specific variation.
|
|
|
|
pub const NOTO_SANS: &str = "Noto Sans";
|
2022-11-06 23:48:12 +11:00
|
|
|
|
|
|
|
pub fn register_noto_sans_regular(cx: &mut Context) {
|
2023-11-06 08:05:28 +11:00
|
|
|
cx.add_font_mem(fonts::NOTO_SANS_REGULAR);
|
2022-11-06 23:48:12 +11:00
|
|
|
}
|
|
|
|
pub fn register_noto_sans_regular_italic(cx: &mut Context) {
|
2023-11-06 08:05:28 +11:00
|
|
|
cx.add_font_mem(fonts::NOTO_SANS_REGULAR_ITALIC);
|
2022-11-06 23:48:12 +11:00
|
|
|
}
|
|
|
|
pub fn register_noto_sans_thin(cx: &mut Context) {
|
2023-11-06 08:05:28 +11:00
|
|
|
cx.add_font_mem(fonts::NOTO_SANS_THIN);
|
2022-11-06 23:48:12 +11:00
|
|
|
}
|
|
|
|
pub fn register_noto_sans_thin_italic(cx: &mut Context) {
|
2023-11-06 08:05:28 +11:00
|
|
|
cx.add_font_mem(fonts::NOTO_SANS_THIN_ITALIC);
|
2022-11-06 23:48:12 +11:00
|
|
|
}
|
|
|
|
pub fn register_noto_sans_light(cx: &mut Context) {
|
2023-11-06 08:05:28 +11:00
|
|
|
cx.add_font_mem(fonts::NOTO_SANS_LIGHT);
|
2022-11-06 23:48:12 +11:00
|
|
|
}
|
|
|
|
pub fn register_noto_sans_light_italic(cx: &mut Context) {
|
2023-11-06 08:05:28 +11:00
|
|
|
cx.add_font_mem(fonts::NOTO_SANS_LIGHT_ITALIC);
|
2022-11-06 23:48:12 +11:00
|
|
|
}
|
|
|
|
pub fn register_noto_sans_bold(cx: &mut Context) {
|
2023-11-06 08:05:28 +11:00
|
|
|
cx.add_font_mem(fonts::NOTO_SANS_BOLD);
|
2022-11-06 23:48:12 +11:00
|
|
|
}
|
|
|
|
pub fn register_noto_sans_bold_italic(cx: &mut Context) {
|
2023-11-06 08:05:28 +11:00
|
|
|
cx.add_font_mem(fonts::NOTO_SANS_BOLD_ITALIC);
|
2022-03-18 10:22:58 +11:00
|
|
|
}
|