Skip to content

Commit

Permalink
Fix font weights
Browse files Browse the repository at this point in the history
  • Loading branch information
geom3trik committed Oct 20, 2023
1 parent 989f226 commit 06a341e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
4 changes: 4 additions & 0 deletions nih_plug_vizia/assets/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
border-color: blue;
} */

* {
font-weight: light;
}

:root {
background-color: #fafafa;
color: #0a0a0a;
Expand Down
12 changes: 6 additions & 6 deletions nih_plug_vizia/src/assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,30 @@ pub use nih_plug_assets::*;

/// The font name for Noto Sans Regular, needs to be registered using
/// [`register_noto_sans_regular()`] first.
pub const NOTO_SANS_REGULAR: &str = "Noto Sans Regular";
pub const NOTO_SANS_REGULAR: &str = "Noto Sans";
/// The font name for Noto Sans Regular Italic, needs to be registered using
/// [`register_noto_sans_regular_italic()`] first.
pub const NOTO_SANS_REGULAR_ITALIC: &str = "Noto Sans Regular Italic";
pub const NOTO_SANS_REGULAR_ITALIC: &str = "Noto Sans";
/// The font name for Noto Sans Thin, needs to be registered using [`register_noto_sans_thin()`]
/// first.
pub const NOTO_SANS_THIN: &str = "Noto Sans";
/// The font name for Noto Sans Thin Italic, needs to be registered using
/// [`register_noto_sans_thin_italic()`] first.
pub const NOTO_SANS_THIN_ITALIC: &str = "Noto Sans Thin Italic";
pub const NOTO_SANS_THIN_ITALIC: &str = "Noto Sans";
/// The font name for Noto Sans Light, needs to be registered using [`register_noto_sans_light()`]
/// first.
pub const NOTO_SANS_LIGHT: &str = "Noto Sans Light";
pub const NOTO_SANS_LIGHT: &str = "Noto Sans";
/// The font name for Noto Sans Light Italic, needs to be registered using
/// [`register_noto_sans_light_italic()`] first.
pub const NOTO_SANS_LIGHT_ITALIC: &str = "Noto Sans Light Italic";
pub const NOTO_SANS_LIGHT_ITALIC: &str = "Noto Sans";
/// The font name for Noto Sans Bold, needs to be registered using [`register_noto_sans_bold()`]
/// first.
// NOTE: I'd expect this to be an alias for Noto Sans Regular but this is what cosmic-text thinks
// the font is called
pub const NOTO_SANS_BOLD: &str = "Noto Sans";
/// The font name for Noto Sans Bold Italic, needs to be registered using
/// [`register_noto_sans_bold_italic()`] first.
pub const NOTO_SANS_BOLD_ITALIC: &str = "Noto Sans Italic";
pub const NOTO_SANS_BOLD_ITALIC: &str = "Noto Sans";

pub fn register_noto_sans_regular(cx: &mut Context) {
cx.add_font_mem(fonts::NOTO_SANS_REGULAR);
Expand Down
1 change: 1 addition & 0 deletions plugins/crisp/src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ pub(crate) fn create(
.font_family(vec![FamilyOwned::Name(String::from(
assets::NOTO_SANS_THIN,
))])
.font_weight(FontWeightKeyword::Thin)
.font_size(30.0)
.height(Pixels(50.0))
.child_top(Stretch(1.0))
Expand Down
1 change: 1 addition & 0 deletions plugins/examples/gain_gui_vizia/src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ pub(crate) fn create(
.font_family(vec![FamilyOwned::Name(String::from(
assets::NOTO_SANS_THIN,
))])
.font_weight(FontWeightKeyword::Thin)
.font_size(30.0)
.height(Pixels(50.0))
.child_top(Stretch(1.0))
Expand Down
2 changes: 2 additions & 0 deletions plugins/spectral_compressor/src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ fn main_column(cx: &mut Context) {
.font_family(vec![FamilyOwned::Name(String::from(
assets::NOTO_SANS_THIN,
))])
.font_weight(FontWeightKeyword::Thin)
.font_size(30.0)
.on_mouse_down(|_, _| {
// FIXME: On Windows this blocks, and while this is blocking a timer may
Expand Down Expand Up @@ -246,6 +247,7 @@ fn make_column(cx: &mut Context, title: &str, contents: impl FnOnce(&mut Context
.font_family(vec![FamilyOwned::Name(String::from(
assets::NOTO_SANS_THIN,
))])
.font_weight(FontWeightKeyword::Thin)
.font_size(23.0)
.left(Stretch(1.0))
// This should align nicely with the right edge of the slider
Expand Down

0 comments on commit 06a341e

Please sign in to comment.