cosmic/
font.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright 2022 System76 <info@system76.com>
// SPDX-License-Identifier: MPL-2.0

//! Select preferred fonts.

pub use iced::Font;
use iced_core::font::Weight;

pub fn default() -> Font {
    Font::from(crate::config::interface_font())
}

pub fn light() -> Font {
    Font {
        weight: Weight::Light,
        ..default()
    }
}

pub fn semibold() -> Font {
    Font {
        weight: Weight::Semibold,
        ..default()
    }
}

pub fn bold() -> Font {
    Font {
        weight: Weight::Bold,
        ..default()
    }
}

pub fn mono() -> Font {
    Font::from(crate::config::monospace_font())
}