• 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
size of a NSFont
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

size of a NSFont


  • Subject: size of a NSFont
  • From: email@hidden
  • Date: Wed, 7 Mar 2007 08:43:50 +0100 (CET)
  • Importance: Normal

Hello all,

 even after reading the documentation I'm still confused on how to access
the size of a NSFont. I need it  in a piece of code like this :

 (*starting with an NSFont oldFont*)

   float oldSize=[myFont size];
  float newSize=oldSize/2;

   NSFont* newFont=[[NSFontManager sharedFontManager]
                   convertFont: oldFont toSize: newSize];

  Unfortunately, there's no method called "size" for an NSFont. In terms
of  figure 1 in
Text&Fonts>Font Handling>Getting Font Metrics, that would be the "line
height."
There are "capHeight,xHeight" methods for NSFont, why is there not a
"lineHeight" method ?


  In the documentation I have seen many methods for NSFont that are
certainly related,
but it's not clear to me which one I should use. I should like the method
to make no
assumption of the font, since it is intended for use in a text editor ;
even if
it is initialized with a standard user font, it may have been
modified arbitrarily by the user afterwards.

                                                                               Ewan




_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: size of a NSFont
      • From: Half Activist <email@hidden>
  • Prev by Date: NIB file problems (possibly corrupt)
  • Next by Date: Re: size of a NSFont
  • Previous by thread: Re: NIB file problems (possibly corrupt)
  • Next by thread: Re: size of a NSFont
  • Index(es):
    • Date
    • Thread