improv: extract decoration metrics from the font
This commit is contained in:
parent
2758919c80
commit
c12b3a9bf2
4 changed files with 62 additions and 13 deletions
|
|
@ -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)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue