Skip to content

Commit 6f33438

Browse files
committed
Set hardcoded font (fix #20)
1 parent d00f70d commit 6f33438

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

assets/FiraSans-Light.ttf

439 KB
Binary file not shown.

src/consts.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ pub const PROG_PREFERENCES: &str = "TimeKeeper.toml";
2222
/// Статистика (сколько на каждый день циклов работа/отдых и сколько длился
2323
/// каждый такой цикл)
2424
pub const PROG_STATISTICS: &str = "stat.toml";
25+
26+
/// Стандартный шрифт программы, как и логотип, жёстко указанный в исходниках программы и не поддающийся замене
27+
pub const DEFAULT_FONT: &[u8] = include_bytes!("../assets/FiraSans-Light.ttf");

src/ui.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use iced::{
3131

3232
use crate::{
3333
conf::Config,
34-
consts::{PROG_LOGO, PROG_NAME},
34+
consts::{DEFAULT_FONT, PROG_LOGO, PROG_NAME},
3535
pathes,
3636
stats::Stats,
3737
time::Time,
@@ -61,6 +61,7 @@ pub fn ui() -> iced::Result {
6161
.centered()
6262
.window_size((300., 300.))
6363
.resizable(false)
64+
.font(DEFAULT_FONT)
6465
.theme(TimeKeeper::theme)
6566
.subscription(TimeKeeper::subscription)
6667
.run()

0 commit comments

Comments
 (0)