The Shape of Everything
A website mostly about Mac stuff, written by August "Gus" Mueller
» Acorn
» Retrobatch
» Mastodon
» Micro.blog
» Instagram
» Github
» Maybe Pizza?
» Archives
» Feed
» Micro feed
March 25, 2020

This is a quick developer PSA. MacOS 10.15.4 was just released, and there was a minor change in the way NSAttributedString's -initWithHTML:options:documentAttributes method works. Previously (10.15.3 and earlier) if you passed a HTML snippet using HelveticaNeue with a size of 20, the minimum line height for the attributed string was set to 25 (and if you passed 40 for the font size, you'd get 49). With 10.15.4 the minimum line height is now set to 0. I'm actually in favor of this change, but if you were expecting certain layouts to happen based on the previous defaults, things might look different for you.

How did this happen? I'm guessing something in WebKit probably changed, which AppKit probably uses to convert the HTML to an attributed string. Why did this happen? Beats me.

You can test it out on your Mac using Python.