slint icon indicating copy to clipboard operation
slint copied to clipboard

Add support for text underline/overline/strikeout

Open tronical opened this issue 2 years ago • 2 comments

Besides the existing support for font-italic, font-weight, and font-size, we should also support text line decorations, such as underline, overline, strikeout.

The number of properties are becoming a little too much, so part of the acceptance criteria for this issue should also be that we can keep a nice API with what looks like individual properties, but in the implementation attempt to consolidate these into fewer Property instances.

tronical avatar Jul 31 '23 09:07 tronical

We can have a pass that lowers all these property to a struct {italic: bool, underline:bool, striked: bool, weight: u16, size: length} What properties exactly will he have? I think it makes sense to keep some property appart like size

ogoffart avatar Jul 31 '23 09:07 ogoffart

Yes, size makes sense to keep apart. Combining italic, underline, etc. might be worth it.

I wonder how to handle a case like this:

component Foo inherits Text {
    font-underline: { some expression }
}

component Bar {
    in-out property <bool> font-italic; 
    Foo {
        font-underline <=> font-italic;
    }
}

I can see how we could perhaps at compile time combine multiple binding expressions into one big binding expression for a struct, but how could this be done when there's a two-way binding on one of the fields?

tronical avatar Jul 31 '23 10:07 tronical