SwiftRichString icon indicating copy to clipboard operation
SwiftRichString copied to clipboard

FEATURE REQUEST: A font "size" attribute within StandardXMLAttributesResolver would be immensely useful.

Open pkclsoft opened this issue 3 years ago • 0 comments

I've tried to implement this in my own subclass of StandardXMLAttributesResolver, however we don't seem to have enough access to the information required. Originally, I was going to implement it as a string point size (which would be normal), but given the font size of the active style, when the attribute is parsed may provide something specific to a device class, I thought it would be more useful to add an attribute called "fontScale" so that you could scale the font up or down.

For this to work, I think we also need the ability to apply an attribute to whatever the "current" or "active" style is.

e.g.

"This is normal, <activeStyle fontScale="1.5">but this text is larger by half</activeStyle >, and < activeStyle fontScale="0.5">this is smaller by half.</activeStyle >; returning to normal size now".

Would render something like:

image

pkclsoft avatar Feb 24 '22 03:02 pkclsoft