Check font is installed
Check font is installed
- Subject: Check font is installed
- From: Keith Blount <email@hidden>
- Date: Mon, 2 Oct 2006 11:46:03 -0700 (PDT)
Hello,
I'm probably missing the obvious here, but searches on
"installed" and "fonts" only bring up information
about putting together a menu of installed fonts, and
adding "check" to ths search only returns very little
indeed. :)
My program sets up certain default fonts for its
various editors and views in its Preferences. If any
of these fonts are not installed on the user's
machine, however, this can cause my program to act in
very weird ways - it completely messes up the
interface and renders it unusable until the user
alters the Preferences so that the fonts are set to
something that is actually on the system and then
restarts.
What is the best way to check whether a given font is
on the system and return a different font if not?
Would something like this be enough:
NSString *defaultFontName = [[[NSFontManager
sharedFontManager] availableFonts]
containsObject:@"Optima"] ? @"Optima" : @"Helvetica";
Even then, what if the user has deleted "Helvetica"?
Is this safe or is there a better way?
Thanks in advance,
Keith
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
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