• 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
Font related question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Font related question


  • Subject: Font related question
  • From: Vinay Prabhu <email@hidden>
  • Date: Tue, 1 Jul 2008 16:36:38 +0530

Hi Al,

I am stuck in a peculiar problem related to Fonts.

In my application, the requirement is such that, I need to provide 2 drop down menu's to select font.
One drop down menu will list all fonts available in the system. Another drop down menu lists the Fonts traits like, Bold, Italic etc.
I can not use Font Panel for this requirement.


I am using the NSFont API, + (NSFont *)fontWithName:(NSString *)fontName size:(CGFloat)fontSize to create the NSFont object.

The problem is, while trying to get the font with traits like Bold, Italic etc, the naming scheme is not consistent.
like,
"Helvetica-Bold"
"TimesNewRomanPS-BoldMT"
"Arial-BoldMT"
"CourierNewPS-BoldMT"
"Georgia-Bold"


So, I am not able to get the font traits as required, with the fontWithName: API, because of the inconsistency in the naming scheme.

Is there any other way to get the NSFont object, using the font name and the trait name?
Any suggestions?


Thanks and Regards
Vinay
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Font related question
      • From: "Kyle Sluder" <email@hidden>
  • Prev by Date: Re: NSDateComponents question
  • Next by Date: Отв.: Process app.
  • Previous by thread: Re: [MEET] CocoaHeads Mac Developer Meetings
  • Next by thread: Re: Font related question
  • Index(es):
    • Date
    • Thread