Text rendering on Mac OS X showing different results for app target OS 10.14 vs lower versions

33 Views Asked by At

I have been trying to do a POC on custom text rendering on Mac OS X and I am facing a situation where if I build my app for Mac OS version 10.14, I get different results vs when I compile the app for lower version say OS 10.13.

If we compare attached images we can see after zooming both images that one captured for app compiled for target OS 10.13 has more space above text than the other image captured for app compiled for target OS 10.14.

Does anyone have any idea what has changed in OS 10.14?

Image from app compiled for OS 10.13

Image from app compiled for OS 10.14

I am using a NSView to render my text.

 - (void)drawRect:(NSRect)dirtyRect 

{

    [backColor setFill];
    NSRectFill(dirtyRect);
    [super drawRect:dirtyRect];

    // Drawing code here.
    if(text != nil)
    {
        NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:font, NSFontAttributeName,fontColor, NSForegroundColorAttributeName, nil];
        NSAttributedString * currentText=[[NSAttributedString alloc] initWithString:text attributes: attributes];
        [currentText drawAtPoint:NSMakePoint(0, 0)];
    }

}

0

There are 0 best solutions below