开发者

Creating nice looking fonts with "blurred" borders in Cocoa Touch / Core graphics

I would like to draw a ni开发者_Python百科ce 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)


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).


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜