daven11
daven11

Reputation: 3035

Using core text on Mac book pro / HD screen different text sizes

I've recently shifted to a MacBook Pro 15" and core text is behaving strangely.

I have an app that uses core text to draw an NSattributedstring with CTFrameDraw. It works as expected on the external 1080p monitor, if I drag the window across to the MacBook Pro screen then the font is displayed very tiny like it's changed from 10 point font to 5 point when painted. Likewise if I repaint the text on the MacBook Pro then it's still small.

I'd guess it's because the MacBook Pro has the high resolution screen, and the font is being rendered to the native pixel resolution. Could anyone point me to docs on how to handle this? I had a google around and came up empty.

Swift 3, Xcode 8.2.1 on OSX 10.12.2

tia

Upvotes: 1

Views: 137

Answers (1)

daven11
daven11

Reputation: 3035

It was me. I had this bit of code

var c = context.ctm
c = c.inverted()
context.concatenate(c)

to set the transformation matrix back to the identity. It screws things up on the double pixel displays.

Upvotes: 0

Related Questions