I was able to solve this oddity by converting text into image.
As far as my testing goes: Liquid Retina (camera notch) has a slightly different vertical alignment for text and will behave oddly (passive vs active desktop focus, aligns opposite ways, etc), unlike all other displays I've checked (external 4K 16:9, M1 Air 16:10).
However, the images were always aligned, so:
class AppDelegate {
//...
let status: NSMutableAttributedString() = NSAttributedString(string: "Hello World"))
DispatchQueue.main.async {
let size = status.size()
let image = NSImage(size: size)image.lockFocus()
status.draw(at: .zero)
image.isTemplate = true
image.unlockFocus()
button.image = image
}
}