use kurbo::{BezPath, Line, ParamCurve}; use ttf_parser::{GlyphId, OutlineBuilder}; use super::TextNode; use crate::font::FontStore; use crate::library::prelude::*; /// Typeset underline, stricken-through or overlined text. #[derive(Debug, Hash)] pub struct DecoNode(pub Template); /// Typeset underlined text. pub type UnderlineNode = DecoNode; /// Typeset stricken-through text. pub type StrikethroughNode = DecoNode; /// Typeset overlined text. pub type OverlineNode = DecoNode; #[class] impl DecoNode { /// Stroke color of the line, defaults to the text color if `None`. #[shorthand] pub const STROKE: Option = None; /// Thickness of the line's strokes (dependent on scaled font size), read /// from the font tables if `None`. #[shorthand] pub const THICKNESS: Option = None; /// Position of the line relative to the baseline (dependent on scaled font /// size), read from the font tables if `None`. pub const OFFSET: Option = None; /// Amount that the line will be longer or shorter than its associated text /// (dependent on scaled font size). pub const EXTENT: Linear = Linear::zero(); /// Whether the line skips sections in which it would collide /// with the glyphs. Does not apply to strikethrough. pub const EVADE: bool = true; fn construct(_: &mut Context, args: &mut Args) -> TypResult