Cocoa, Core Animation, Text Size, a Lost 2 Hours
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.