views:

115

answers:

2

Hello, I would like to draw a nice looking fonts in Cocoa Touch (by "nice looking" I mean white font with blurred black border that looks like shadow) The question is either:

  1. Is it possible to display bitmap fonts in coca touch
  2. Is it possible to render a border for a font (for each character)
+1  A: 

If you want the text to have a shadow, why not just give it a shadow?

Peter Hosey
Well, thats certainly an idea worth considering - the problem here is that i am not certain if it will be enough to achieve an effect I want to have, and i suppose the performance of my app can suffer using this approach? Nevertheless I will try it, thanks
adrin
Drawing the text with any kind of effect will incur a performance hit. That said, drawing the text at all will incur a performance hit; putting the shadow on it probably isn't cheap, but also isn't the hard part. Profile your app and see how many milliseconds you're spending in text drawing, then try to do it as little as possible. Then, if you're still not satisfied with your app's performance, try caching to a layer or something.
Peter Hosey
+1  A: 

If you want a drop-in element for shadowed / glowing text, I created a UITextField subclass that lets you specify shadow color, offset, etc. that can be downloaded here. Look for the MATCShadowLabel class in that package. This can also be used to blur text, if you set the right colors.

I explain how this works, and show an example of it in action, as part of my iPhone development class on iTunes U (look for the Quartz 2D class from the Spring semester).

Brad Larson