toptensoftware / RichTextKit

Rich text rendering for SkiaSharp
Other
366 stars 73 forks source link

possible formatting bug #19

Closed eman1986 closed 4 years ago

eman1986 commented 4 years ago

considering the following code:

var rs = new RichString("Test Text")
    .FontSize(14)
    .TextColor(SkColors.Blue);

when I do it this way the color and size are not taking.

daltonks commented 4 years ago

Try it like this:

var rs = new RichString()
    .FontSize(14)
    .TextColor(SKColors.Blue)
    .Add("Test Text");

When you add text, it uses the styling that came before the call to add it.

eman1986 commented 4 years ago

When I do it that way it works, I just wanted to make sure I didn't discover a bug

toptensoftware commented 4 years ago

Yep, that's correct. RichString's fluent style api uses formatting change methods to change the format of subsequently added text - not text that's already been added.