RE: NSFontManager and convertFont
RE: NSFontManager and convertFont
- Subject: RE: NSFontManager and convertFont
- From: "Jonathan E. Jackel" <email@hidden>
- Date: Mon, 15 Nov 2004 16:07:22 -0500
- Importance: Normal
You
might actually be having memory management issues. You don't retain font,
so it might be getting deallocated by the time you try to make newfont out of
it. Try doing [font retain] right after you create it.
Jonathan
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"/color> traits:0/color> weight:5/color> size:11/color>];
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