• 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
Setting fixed pitch font (temporary) for NSTextView object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Setting fixed pitch font (temporary) for NSTextView object


  • Subject: Setting fixed pitch font (temporary) for NSTextView object
  • From: Gerben Wierda <email@hidden>
  • Date: Tue, 19 Mar 2002 11:28:09 +0100

I have looked at the documentation and tried a lot of calls, but so far I have not been able to set a text view to a fixed pitch font temporarily (the same view sometimes displays RTF as well).

For instance, I tried:

[displayView setRichText:NO];
[displayView selectAll:nil];
[[displayView textStorage] applyFontTraits:NSFixedPitchFontMask range:[displayView selectedRange]];
[displayView setString:stringData];

I also tried a different order of these calls, but whatever I do, the font in this text view stays Helvetica. Is there a way to set this in a simple manner so that I can use a normal non-attributed NSString? Or do I have to do complex juggling with NSFont and attributed strings?

Thanks,

G
_______________________________________________
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: Setting fixed pitch font (temporary) for NSTextView object
      • From: Ingvar Nedrebo <email@hidden>
  • Prev by Date: Re: Why the name Cocoa?
  • Next by Date: PseudoTTY -- updated
  • Previous by thread: Re: Memory Requirements
  • Next by thread: Re: Setting fixed pitch font (temporary) for NSTextView object
  • Index(es):
    • Date
    • Thread