May 12 2008

Tech Book :: Core Animation for OS X

Categories: Books, Programming
Tags:

I ordered a copy of Core Animation for OS X about a week ago. I ordered both the PDF and print book version (which should arrive when it’s actually published). I must say, I really like the Beta Book program from the Pragmatic Programmers guys.

Anyway, I finished reading the book just before leaving for Seattle and I must say, I quite enjoyed it. It’s well written and everything seems to have made sense. There are really good introductions to transitions and keyframe animations in there. If you’re interested in doing any work with Core Animation and are looking for a good introduction you might want to pick this one up.

Hopefully I’ll be able to leverage off of Core Animation for OS X to start doing some cool Core Animation work. We’ll see how it goes.


May 12 2008

Cocoa, Core Animation, Text Size, a Lost 2 Hours

Categories: Programming
Tags: ,

So, as you can tell by the title I’ve been struggling with a font size issue when working for Core Animation. I’ve been trying to call [NSFont boldSystemFontOfSize:144.0f] to get a font of a given size and then setting it on the layer through the font property.

This hasn’t been working. I’ve been struggling, using other ways to query the font. Nothing was working.

Eventually, I figured out, if you’re working with a CALayer you have to set the size through the fontSize property. If you don’t set this property you seem to always get the default font size of 36.0.

I also discovered that you can pass a font name to the font property. So, doing something like layer.font = @"Helvetica" works.