2022-11-07 00:02:48 +11:00
|
|
|
//! Registration functions for Vizia's built-in fonts. These are not enabled by default in
|
|
|
|
//! `nih_plug_vizia` to save on binary size.
|
|
|
|
|
|
|
|
use vizia::prelude::*;
|
|
|
|
|
|
|
|
// This module provides a re-export and simple font wrappers around the re-exported fonts.
|
|
|
|
pub use vizia::fonts;
|
|
|
|
|
|
|
|
/// The font name for the Roboto (Regular) font, needs to be registered using [`register_roboto()`]
|
|
|
|
/// first.
|
2023-01-13 04:49:55 +11:00
|
|
|
pub const ROBOTO: &str = "Roboto";
|
2022-11-07 00:02:48 +11:00
|
|
|
/// The font name for the Roboto Bold font, needs to be registered using [`register_roboto_bold()`]
|
|
|
|
/// first.
|
2023-01-13 04:49:55 +11:00
|
|
|
pub const ROBOTO_BOLD: &str = "Roboto Bold";
|
2022-11-07 00:02:48 +11:00
|
|
|
/// The font name for the icon font (Entypo), needs to be registered using [`register_icons()`]
|
|
|
|
/// first.
|
2023-01-13 04:49:55 +11:00
|
|
|
pub const ICONS: &str = "Entypo";
|
2022-11-07 00:02:48 +11:00
|
|
|
/// The font name for the emoji font (Open Sans Eomji), needs to be registered using
|
|
|
|
/// [`register_emoji()`] first.
|
2023-01-13 04:49:55 +11:00
|
|
|
pub const EMOJI: &str = "OpenSansEmoji";
|
2022-11-07 00:02:48 +11:00
|
|
|
/// The font name for the arabic font (Amiri Regular), needs to be registered using
|
|
|
|
/// [`register_arabic()`] first.
|
2023-01-13 04:49:55 +11:00
|
|
|
pub const ARABIC: &str = "Amiri";
|
2022-11-07 00:02:48 +11:00
|
|
|
/// The font name for the material font (Material Icons), needs to be registered using
|
|
|
|
/// [`register_material()`] first.
|
2023-01-13 04:49:55 +11:00
|
|
|
pub const MATERIAL: &str = "Material Icons";
|
2022-11-07 00:02:48 +11:00
|
|
|
|
|
|
|
pub fn register_roboto(cx: &mut Context) {
|
2023-01-13 04:49:55 +11:00
|
|
|
cx.add_fonts_mem(&[fonts::ROBOTO_REGULAR]);
|
2022-11-07 00:02:48 +11:00
|
|
|
}
|
|
|
|
pub fn register_roboto_bold(cx: &mut Context) {
|
2023-01-13 04:49:55 +11:00
|
|
|
cx.add_fonts_mem(&[fonts::ROBOTO_BOLD]);
|
2022-11-07 00:02:48 +11:00
|
|
|
}
|
|
|
|
pub fn register_icons(cx: &mut Context) {
|
2023-01-13 04:49:55 +11:00
|
|
|
cx.add_fonts_mem(&[fonts::ENTYPO]);
|
2022-11-07 00:02:48 +11:00
|
|
|
}
|
|
|
|
pub fn register_emoji(cx: &mut Context) {
|
2023-01-13 04:49:55 +11:00
|
|
|
cx.add_fonts_mem(&[fonts::OPEN_SANS_EMOJI]);
|
2022-11-07 00:02:48 +11:00
|
|
|
}
|
|
|
|
pub fn register_arabic(cx: &mut Context) {
|
2023-01-13 04:49:55 +11:00
|
|
|
cx.add_fonts_mem(&[fonts::AMIRI_REGULAR]);
|
2022-11-07 00:02:48 +11:00
|
|
|
}
|
|
|
|
pub fn register_material(cx: &mut Context) {
|
2023-01-13 04:49:55 +11:00
|
|
|
cx.add_fonts_mem(&[fonts::MATERIAL_ICONS_REGULAR]);
|
2022-11-07 00:02:48 +11:00
|
|
|
}
|