cosmic/
font.rs

1// Copyright 2022 System76 <info@system76.com>
2// SPDX-License-Identifier: MPL-2.0
3
4//! Select preferred fonts.
5
6pub use iced::Font;
7use iced_core::font::Weight;
8
9#[inline]
10pub fn default() -> Font {
11    Font::from(crate::config::interface_font())
12}
13
14#[inline]
15pub fn light() -> Font {
16    Font {
17        weight: Weight::Light,
18        ..default()
19    }
20}
21
22#[inline]
23pub fn semibold() -> Font {
24    Font {
25        weight: Weight::Semibold,
26        ..default()
27    }
28}
29
30#[inline]
31pub fn bold() -> Font {
32    Font {
33        weight: Weight::Bold,
34        ..default()
35    }
36}
37
38#[inline]
39pub fn mono() -> Font {
40    Font::from(crate::config::monospace_font())
41}