79641289

Date: 2025-05-27 22:49:17
Score: 0.5
Natty:
Report link

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
    }
}
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: raphinzo