2022-12-06 16:12:59 +01:00
|
|
|
// Copyright 2022 System76 <info@system76.com>
|
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
|
2022-09-30 09:35:55 -06:00
|
|
|
pub use iced::Font;
|
2023-05-10 13:15:56 -04:00
|
|
|
use iced::{
|
|
|
|
|
font::{load, Error},
|
|
|
|
|
Command,
|
|
|
|
|
};
|
2022-09-30 09:35:55 -06:00
|
|
|
|
2023-05-08 18:22:10 -04:00
|
|
|
pub const FONT: Font = Font::with_name("Fira Sans Regular");
|
2023-05-10 13:15:56 -04:00
|
|
|
pub const FONT_DATA: &[u8] = include_bytes!("../res/Fira/FiraSans-Regular.otf");
|
2022-09-30 09:35:55 -06:00
|
|
|
|
2023-05-08 18:22:10 -04:00
|
|
|
pub const FONT_LIGHT: Font = Font::with_name("Fira Sans Light");
|
2023-05-10 13:15:56 -04:00
|
|
|
pub const FONT_LIGHT_DATA: &[u8] = include_bytes!("../res/Fira/FiraSans-Light.otf");
|
2023-05-08 18:22:10 -04:00
|
|
|
|
|
|
|
|
pub const FONT_SEMIBOLD: Font = Font::with_name("Fira Sans SemiBold");
|
2023-05-10 13:15:56 -04:00
|
|
|
pub const FONT_SEMIBOLD_DATA: &[u8] = include_bytes!("../res/Fira/FiraSans-SemiBold.otf");
|
2023-05-08 18:22:10 -04:00
|
|
|
|
2023-05-10 13:15:56 -04:00
|
|
|
pub fn load_fonts() -> Command<Result<(), Error>> {
|
|
|
|
|
Command::batch(vec![
|
|
|
|
|
load(FONT_DATA),
|
|
|
|
|
load(FONT_LIGHT_DATA),
|
|
|
|
|
load(FONT_SEMIBOLD_DATA),
|
|
|
|
|
])
|
|
|
|
|
}
|