Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
from AppKit import *
from Foundation import *
html = NSString.stringWithString_("<b style='font-size: 20px; font-family: HelveticaNeue'>Hi</b>")
d = html.dataUsingEncoding_(NSUTF8StringEncoding);
ats = NSAttributedString.alloc().initWithHTML_options_documentAttributes_(d, None, None)[0];
ps = ats.attribute_atIndex_effectiveRange_(NSParagraphStyleAttributeName, 0, None)[0]
print(ps.minimumLineHeight())
print(ps.maximumLineHeight())
@ccgus

This comment has been minimized.

Copy link
Owner Author

@ccgus ccgus commented Mar 25, 2020

On 10.15.3 you get:
25.0
0.0

On 10.15.4 you get:
0.0
0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.