CGFontCreateWithFontName is not working for "Casual" font

Discussion in 'Mac Programming' started by anni.saini, Mar 10, 2010.

  1. anni.saini macrumors newbie

    Joined:
    Jul 15, 2009
    #1
    Hi,

    i was trying to create font using

    CGFontRef cgFont = CGFontCreateWithFontName((CFStringRef)@"Casual");

    This function is returning null for some fonts. Can anybody tell me what would be the probable reason for this.

    I was using Mac OS X 10.5.8.

    regards,
    anni
     
  2. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    You could try using "Apple Casual" instead.

    BTW instead of using (CFStringRef)@"Casual" you can use CFSTR("Casual")
     

Share This Page