• 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
RE: NSFontManager and convertFont
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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" 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

References: 
 >NSFontManager and convertFont (From: Jason Maskell <email@hidden>)

  • Prev by Date: Re: Confirming NSTextField when a button is pressed
  • Next by Date: NSButtonCell darkened when state is NSOnState
  • Previous by thread: NSFontManager and convertFont
  • Next by thread: Focus ring changed
  • Index(es):
    • Date
    • Thread