Closed typemytype closed 9 months ago
@justvanrossum this would be super handy to have!!
Neat!
Could there be a need/use to set the properties from the dict as well? Or is this a read-only thing (from the API's perspective)?
you can use this properties dict to initiate a new FormattedString("hi Just", **textProperties)
this super handy when you loop over all textBoxCharacterBounds
to get properties and only change for the alpha value of the fill color... over an animation
And in between adding text?
fs = Formattedtring(...)
fs.append("Hey ")
fs.???(**textProperties)
fs.append("Frederik")
works also with append
fs = Formattedtring(...)
fs.append("Hey ", **textProperties)
textProperties returns a dict with all current properties of an formattedString.
While building the nsAttributedString those properties are stored in the nsAttributedString with the key:
"drawBot.formattedString.properties"
. This allows to slice a formattedString and restore the attributes from the nsAttributedString.The method is a public one as this can be used to check text properties after creating/building the formattedString.
fixing #518