Quartz2D, scaling particular letters inside a string

Discussion in 'Mac Programming' started by Chirone, Apr 2, 2009.

  1. macrumors 6502

    Joined:
    Mar 2, 2009
    Messages:
    279
    Location:
    NZ
    #1
    Hi all,

    I was wondering if anyone knows to how to make individual letters inside a string different scales to the rest of a letter in the quartz2d framework

    so if i draw the word "hello" i can make the 'h' scaled up from the substring 'ello'
     
  2. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    Messages:
    7,743
    #2
    You would have to draw each character separately. Easiest way to scale it nicely is with NSAffineTransform/CGAffineTransform.
     
  3. macrumors regular

    Joined:
    Oct 13, 2008
    Messages:
    144
    Location:
    Achewood, CA
    #3
    An NSAttributedString and the drawAtPoint: method might do what you want if you make the font size of the "h" larger than the font size of the "ello."
     
  4. macrumors 6502

    Joined:
    Mar 2, 2009
    Messages:
    279
    Location:
    NZ
    #4
    kainjow: i thought as much
    the only problem i thought of doing it that way has been solved too...

    autorelease: i saw the options of doing it in attributed strings, but i don't think you can use attributed strings inside the quartz's draw text method

    thanks for your replies!
     

Share This Page