diff --git a/examples/cosmic-sctk/src/window.rs b/examples/cosmic-sctk/src/window.rs index 1665118b..4a3976d0 100644 --- a/examples/cosmic-sctk/src/window.rs +++ b/examples/cosmic-sctk/src/window.rs @@ -367,7 +367,8 @@ impl Application for Window { vec!["Option 1", "Option 2", "Option 3", "Option 4"], self.pick_list_selected, Message::PickListSelected, - ), + ) + .text_size(14.0), )) .add(settings::item( "Slider", diff --git a/examples/cosmic/src/window.rs b/examples/cosmic/src/window.rs index d5977a11..d25e053e 100644 --- a/examples/cosmic/src/window.rs +++ b/examples/cosmic/src/window.rs @@ -225,7 +225,7 @@ impl Window { } fn page_title(&self, page: Page) -> Element { - row!(text(page.title()).size(30), horizontal_space(Length::Fill),).into() + row!(text(page.title()).size(28), horizontal_space(Length::Fill),).into() } fn is_condensed(&self) -> bool { @@ -245,14 +245,14 @@ impl Window { column!( iced::widget::Button::new(row!( icon("go-previous-symbolic", 16).style(theme::Svg::SymbolicLink), - text(page.title()).size(16), + text(page.title()).size(14), )) .padding(0) .style(theme::Button::Link) // .id(BTN.clone()) .on_press(Message::from(page)), row!( - text(sub_page.title()).size(30), + text(sub_page.title()).size(28), horizontal_space(Length::Fill), ), ) @@ -276,8 +276,8 @@ impl Window { .style(theme::Svg::Symbolic) .into(), column!( - text(sub_page.title()).size(18), - text(sub_page.description()).size(12), + text(sub_page.title()).size(14), + text(sub_page.description()).size(10), ) .spacing(2) .into(), diff --git a/iced b/iced index 0f90f496..cb7f2b56 160000 --- a/iced +++ b/iced @@ -1 +1 @@ -Subproject commit 0f90f49692c1773abe1d161c7e60f6f64f621f2f +Subproject commit cb7f2b566bde194a0aaed869f5f903939a979c03 diff --git a/src/font.rs b/src/font.rs index 8a2a4cc6..e971a3b4 100644 --- a/src/font.rs +++ b/src/font.rs @@ -6,14 +6,33 @@ use iced::{ font::{load, Error}, Command, }; +use iced_core::font::Family; + +pub const FONT: Font = Font { + family: Family::Name("Fira Sans"), + weight: iced_core::font::Weight::Normal, + stretch: iced_core::font::Stretch::Normal, + monospaced: false, +}; -pub const FONT: Font = Font::with_name("Fira Sans Regular"); pub const FONT_DATA: &[u8] = include_bytes!("../res/Fira/FiraSans-Regular.otf"); -pub const FONT_LIGHT: Font = Font::with_name("Fira Sans Light"); +pub const FONT_LIGHT: Font = Font { + family: Family::Name("Fira Sans"), + weight: iced_core::font::Weight::Light, + stretch: iced_core::font::Stretch::Normal, + monospaced: false, +}; + pub const FONT_LIGHT_DATA: &[u8] = include_bytes!("../res/Fira/FiraSans-Light.otf"); -pub const FONT_SEMIBOLD: Font = Font::with_name("Fira Sans SemiBold"); +pub const FONT_SEMIBOLD: Font = Font { + family: Family::Name("Fira Sans"), + weight: iced_core::font::Weight::Semibold, + stretch: iced_core::font::Stretch::Normal, + monospaced: false, +}; + pub const FONT_SEMIBOLD_DATA: &[u8] = include_bytes!("../res/Fira/FiraSans-SemiBold.otf"); pub fn load_fonts() -> Command> { diff --git a/src/widget/header_bar.rs b/src/widget/header_bar.rs index 64e4bc3d..51fec134 100644 --- a/src/widget/header_bar.rs +++ b/src/widget/header_bar.rs @@ -5,7 +5,6 @@ use crate::{theme, Element}; use apply::Apply; use derive_setters::Setters; use iced::{self, widget, Length}; -use iced_core::renderer::BorderRadius; use std::borrow::Cow; #[must_use] @@ -99,7 +98,7 @@ impl<'a, Message: Clone + 'static> HeaderBar<'a, Message> { std::mem::swap(&mut title, &mut self.title); super::text(title) - .size(18) + .size(16) .font(crate::font::FONT_SEMIBOLD) .apply(widget::container) .center_x() diff --git a/src/widget/segmented_button/widget.rs b/src/widget/segmented_button/widget.rs index 58756b38..272bb217 100644 --- a/src/widget/segmented_button/widget.rs +++ b/src/widget/segmented_button/widget.rs @@ -147,7 +147,7 @@ where font_active: None, font_hovered: None, font_inactive: None, - font_size: 17.0, + font_size: 14.0, icon_size: 16, height: Length::Shrink, width: Length::Fill, diff --git a/src/widget/settings/item.rs b/src/widget/settings/item.rs index 078c322f..83eebdc0 100644 --- a/src/widget/settings/item.rs +++ b/src/widget/settings/item.rs @@ -15,7 +15,7 @@ pub fn item<'a, Message: 'static>( widget: impl Into>, ) -> Row<'a, Message, Renderer> { item_row(vec![ - text(title).size(20).into(), + text(title).into(), horizontal_space(iced::Length::Fill).into(), widget.into(), ]) @@ -65,12 +65,12 @@ impl<'a, Message: 'static> Item<'a, Message> { } if let Some(description) = self.description { - let title = text(self.title).size(20); - let desc = text(description).size(14); + let title = text(self.title); + let desc = text(description).size(10); contents.push(column!(title, desc).spacing(2).into()); } else { - contents.push(text(self.title).size(20).into()); + contents.push(text(self.title).into()); } contents.push(horizontal_space(iced::Length::Fill).into()); diff --git a/src/widget/settings/section.rs b/src/widget/settings/section.rs index 511c2c16..59fa7ce8 100644 --- a/src/widget/settings/section.rs +++ b/src/widget/settings/section.rs @@ -31,10 +31,7 @@ impl<'a, Message: 'static> Section<'a, Message> { impl<'a, Message: 'static> From> for Element<'a, Message> { fn from(data: Section<'a, Message>) -> Self { - let title = text(data.title) - .size(20) - .font(crate::font::FONT_SEMIBOLD) - .into(); + let title = text(data.title).font(crate::font::FONT_SEMIBOLD).into(); column(vec![title, data.children.into_element()]) .spacing(8)