Open connordavenport opened 11 months ago
this seems to work on Ventura.
will test on older macOS, as I remember this didnt worked like the article, you linked, mentioned.
import AppKit
f = FormattedString()
f.font("Times", 200)
f.underline("single")
f += "hello"
attributes = {
AppKit.NSFontAttributeName : AppKit.NSFont.systemFontOfSize_(96),
AppKit.NSForegroundColorAttributeName : AppKit.NSColor.blueColor(),
AppKit.NSStrikethroughStyleAttributeName : AppKit.NSUnderlineStyleThick
}
txt = AppKit.NSAttributedString.alloc().initWithString_attributes_("striked", attributes)
f._attributedString.appendAttributedString_(txt)
print(f)
f += "foo"
text(f, (100, 100))
Hey @typemytype ! Oh this is awesome!, thanks I will finally update to Ventura and test it soon:) I can confirm that it is not working on 11.4 Big Sur
looks like this on Ventura:
Looks like this on 10.15:
At least it doesn't crash :)
Hey! Is it possible to add support for strikethrough in text? I was doing some googling and it came across this, not sure if its useful.