Last active
March 25, 2020 19:36
-
-
Save ccgus/9bddc5b273b0f5e3b014db93fe16630c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On 10.15.3 you get:
25.0
0.0
On 10.15.4 you get:
0.0
0.0