• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Missing font?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Missing font?


  • Subject: Missing font?
  • From: Matt Baker <email@hidden>
  • Date: Fri, 9 Sep 2005 00:17:28 -0500

I'm trying to read an RTF file into an editor in Cocoa, and setting the default font to a font with a particular name. I need to check to see if the font exists (and if the fonts in the RTF exist on my machine, since the RTF may come from another machine).


For example,

[textView setFont:[NSFont fontWithName:[plist valueForKeyPath:@"defaultFont"] size:[[plist valueForKeyPath:@"defaultSize"] doubleValue]]];

Will crash if the defaultFont described in the plist file doesn't exist.

How do I check if the font exists first?

Thanks,

Matt
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Missing font?
      • From: Fritz Anderson <email@hidden>
  • Prev by Date: Re: Contextual menu click in window title
  • Next by Date: scaling NSPDFImageRep?
  • Previous by thread: Scrolling notification
  • Next by thread: Re: Missing font?
  • Index(es):
    • Date
    • Thread