size of text drawn with CGContextShowTextAtPoint

Discussion in 'Mac Programming' started by john903, Aug 24, 2008.

  1. john903
    Expand Collapse
    macrumors member

    Apr 11, 2008
    I doing text drawing with CGContextShowTextAtPoint. How do I get the width and height in pixels of the drawn text?
  2. kainjow
    Expand Collapse
    Moderator emeritus


    Jun 15, 2000
    If you're using Cocoa you can use NSAttributedString to get the size. I'm not sure of a pure C-based way of doing it though (maybe somehow with CFMutableString).

Share This Page