2022-04-12 07:00:38 +10:00
|
|
|
//! Binary assets for use with `nih_plug_vizia`. These fonts first need to be registered by calling
|
|
|
|
//! [`nih_plug_vizia::assets::register_fonts()`][register_fonts()].
|
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::*;
|
|
|
|
|
2022-03-19 05:12:38 +11:00
|
|
|
/// Register the fonts from this module so they can be used with VIZIA. This is automatically called
|
|
|
|
/// for you when using [`create_vizia_editor()`][super::create_vizia_editor()].
|
2022-03-18 10:22:58 +11:00
|
|
|
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);
|
2022-03-18 11:35:05 +11:00
|
|
|
cx.add_font_mem(NOTO_SANS_THIN, fonts::NOTO_SANS_THIN);
|
|
|
|
cx.add_font_mem(NOTO_SANS_THIN_ITALIC, fonts::NOTO_SANS_THIN_ITALIC);
|
2022-03-18 10:22:58 +11:00
|
|
|
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";
|
2022-03-18 11:35:05 +11:00
|
|
|
pub const NOTO_SANS_THIN: &str = "Noto Sans Thin";
|
|
|
|
pub const NOTO_SANS_THIN_ITALIC: &str = "Noto Sans Thin Italic";
|
2022-03-18 10:22:58 +11:00
|
|
|
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";
|