Re: NSFont & bold
Re: NSFont & bold
- Subject: Re: NSFont & bold
- From: Henry McGilton <email@hidden>
- Date: Thu, 21 Apr 2005 10:39:59 -0700
On Apr 21, 2005, at 10:15 AM, Luc Vandal wrote:
It seems that it's not possible to set a font as bold. Is there a way
to do this or fonts handling is very different compared to Windows?
If you want a bold (or italic, or both) font, you ask for
a bold (or italic, or both) font:
[NSFont fontWithName: (NSString *)fontName size:(float)fontSize];
So in this case, you would write:
NSFont myFont = [NSFont fontWithName: @"Optima-Bold" size: 10];
to get a ten-point Optima-Bold font.
You can also add or remove 'traits' using NSFontManager. Read
the 'Constants' section of NSFontManager, and look at addFontTrait:,
removeFontTrait:, convertFont:toHaveTrait, convertFont:toNotHaveTrait:
methods.
Cheers,
........ Henry
===============================+============================
Henry McGilton, Boulevardier | Trilithon Software
Objective-C/Java Composer | Seroia Research
-------------------------------+----------------------------
mailto:email@hidden | http://www.trilithon.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