Alex Rivera | Logout

How do I get an NSFont object from a CGFont or CTFont object?

Asked 2011-02-09T08:30:25.767
11

I am dealing with loading a TTF from Resource only. This question helped me answer part 1. But now I need a NSFont from a CGFont or CTFont.

This is for a Mac only application.

Edit
Report

1 Answer

17

How to get an NSFont from a CGFont

Use CTFontCreateWithGraphicsFont.

How to get an NSFont from a CTFont

Do nothing. You already have one. NSFont and CTFont are toll-free bridged, so a CTFont is an NSFont and vice versa.

answered 2011-02-09T19:05:17.020

Your Answer