diff --git a/crates/epaint/src/text/font.rs b/crates/epaint/src/text/font.rs index 80fb1245b..150aca34a 100644 --- a/crates/epaint/src/text/font.rs +++ b/crates/epaint/src/text/font.rs @@ -337,9 +337,6 @@ pub struct FontFace { font: FontCell, tweak: FontTweak, - /// The font weight (100-900) if available from the font file. - weight: Option, - /// Variable font location (for weight axis, etc.) location: skrifa::instance::Location, glyph_info_cache: ahash::HashMap, @@ -436,18 +433,12 @@ impl FontFace { name, font, tweak, - weight, location, glyph_info_cache: Default::default(), glyph_alloc_cache: Default::default(), }) } - /// Get the font weight (100-900) if available from the font file. - pub fn weight(&self) -> Option { - self.weight - } - /// Code points that will always be replaced by the replacement character. /// /// See also [`invisible_char`]. diff --git a/crates/epaint/src/text/fonts.rs b/crates/epaint/src/text/fonts.rs index 8ca78064d..19876b571 100644 --- a/crates/epaint/src/text/fonts.rs +++ b/crates/epaint/src/text/fonts.rs @@ -861,26 +861,6 @@ impl FontsImpl { atlas: &mut self.atlas, } } - - /// Get the weight of a font by name, if available. - /// - /// Returns the weight value (100-900) read from the font file's OS/2 table, - /// or `None` if the font is not found or doesn't contain weight information. - /// - /// # Example - /// ``` - /// # use epaint::text::{FontDefinitions, FontsImpl}; - /// # use epaint::TextOptions; - /// let fonts_impl = FontsImpl::new(TextOptions::default(), FontDefinitions::default()); - /// if let Some(weight) = fonts_impl.font_weight("Hack") { - /// println!("Hack font weight: {}", weight); - /// } - /// ``` - pub fn font_weight(&self, font_name: &str) -> Option { - let key = self.fonts_by_name.get(font_name)?; - let font_face = self.fonts_by_id.get(key)?; - font_face.weight() - } } // ----------------------------------------------------------------------------