diff --git a/crates/notedeck/src/style.rs b/crates/notedeck/src/style.rs index 160e3e6b..2a890457 100644 --- a/crates/notedeck/src/style.rs +++ b/crates/notedeck/src/style.rs @@ -1,7 +1,9 @@ -use egui::{FontFamily, TextStyle}; +use egui::{Context, FontFamily, FontId, TextStyle}; use strum_macros::EnumIter; +use crate::fonts::get_font_size; + #[derive(Copy, Clone, Eq, PartialEq, Debug, EnumIter)] pub enum NotedeckTextStyle { Heading, @@ -43,4 +45,8 @@ impl NotedeckTextStyle { Self::Tiny => FontFamily::Proportional, } } + + pub fn get_font_id(&self, ctx: &Context) -> FontId { + FontId::new(get_font_size(ctx, self), self.font_family()) + } }