NSFontManager and convertFont
NSFontManager and convertFont
- Subject: NSFontManager and convertFont
- From: Jason Maskell <email@hidden>
- Date: Mon, 15 Nov 2004 12:25:21 -0800
Hey there, I'm a relative Cocoa newbie (long time windows dev).. And I seem to be having some font "issues".
The problem is that fonts seem to be relatively opaque to me. My current problem.
I have a font, say, Arial 11 point - created with:
font=[[NSFontManager sharedFontManager] fontWithFamily:@"Arial" traits:0 weight:5 size:11];
Now, I want to change the size of that font, so I go like this:
newfont=[[NSFontManager sharedFontManager] convertFont:font toSize:size];
Where font is the current font and size is (float) 20.
I get an "invalid" font back AND font is changed to that same invalid font. WTF.
The documentation says that if it can't convert it, it returns font. It's not doing that. And why is it failing in the first place? Is it so hard to up the bloody font size?
As an aside - how can I use NSFontDescriptor - it seems perfect for my purposes, but there's no way that I can see to feed that descriptor info to an init routine to get that font back (when I load it from my XML)..
_______________________________________________
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