• 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: How to change default font for NSTextView?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to change default font for NSTextView?


  • Subject: Re: How to change default font for NSTextView?
  • From: Douglas Davidson <email@hidden>
  • Date: Wed, 13 Feb 2002 09:40:20 -0800

On Wednesday, February 13, 2002, at 04:27 AM, Manfred Lippert wrote:

how can I set the default font of an NSTextView?
In my program it is always set to Helvetica, but it would fit better to the
rest of the system if it was Lucida Grande.

The default font for text that has no font attribute set is 12-pt Helvetica. However, it is always possible for you to set the font or fonts for any text, by calling the appropriate NSMutableAttributedString methods on your text storage. Given a textview, you can call the NSText method setFont: (always check the superclass) which will set the font for the entire text and also in the typing attributes, which determine the attributes to be applied to newly typed-in text. You can also set the typing attributes directly, if that is what you want. If your textview does not allow rich text, then after you set the font the user will not be able to change it. If your textview does allow rich text, then the user can change the font. Also bear in mind that characters that cannot be displayed in the font you choose will be displayed in some other suitable font.

Douglas Davidson
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: How to change default font for NSTextView?
      • From: Manfred Lippert <email@hidden>
    • Re: How to change default font for NSTextView?
      • From: David Rehring <email@hidden>
References: 
 >How to change default font for NSTextView? (From: Manfred Lippert <email@hidden>)

  • Prev by Date: Truncating strings in NSTextField?
  • Next by Date: Re: How do I open an NSDrawer in awakeFromNib?
  • Previous by thread: How to change default font for NSTextView?
  • Next by thread: Re: How to change default font for NSTextView?
  • Index(es):
    • Date
    • Thread