improv: extract decoration metrics from the font

This commit is contained in:
Hojjat 2026-02-24 14:18:31 -07:00 committed by Jeremy Soller
parent 2758919c80
commit c12b3a9bf2
4 changed files with 62 additions and 13 deletions

View file

@ -2,7 +2,7 @@
use core::fmt::Display;
use crate::{math, CacheKey, CacheKeyFlags, Color, TextDecoration};
use crate::{math, CacheKey, CacheKeyFlags, Color, DecorationMetrics, TextDecoration};
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
@ -60,6 +60,10 @@ pub struct LayoutGlyph {
pub cache_key_flags: CacheKeyFlags,
/// Text decoration (underline, strikethough, overline)
pub text_decoration: TextDecoration,
/// Underline offset and thickness extracted from the font
pub underline_metrics: DecorationMetrics,
/// Strikethrough offset and thickness extracted from the font
pub strikethrough_metrics: DecorationMetrics,
}
#[derive(Clone, Debug)]