Quartz2D, scaling particular letters inside a string

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

  1. Chirone
    Expand Collapse
    macrumors 6502

    Joined:
    Mar 2, 2009
    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. kainjow
    Expand Collapse
    Moderator emeritus

    kainjow

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

    Joined:
    Oct 13, 2008
    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. Chirone
    Expand Collapse
    thread starter macrumors 6502

    Joined:
    Mar 2, 2009
    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