• 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: Getting temporary attributes set in NSLayoutManager to print
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting temporary attributes set in NSLayoutManager to print


  • Subject: Re: Getting temporary attributes set in NSLayoutManager to print
  • From: Douglas Davidson <email@hidden>
  • Date: Wed, 7 Feb 2007 15:47:38 -0800


On Feb 7, 2007, at 3:33 PM, email@hidden wrote:

I have a custom NSTextView where I set the NSLayoutManager temporary attribute NSBackgroundColorAttributeName for certain ranges in my string. Everything displays properly on screen. However, when I try to print onto paper, the text is printed without the colors - I realise that this is the correct behaviour. So my question is what is the best way of getting getting these attributes to print? Has anyone done this?

What you are seeing is the intended behavior, but we understand that some clients do wish to change it. We have addressed this with new API for Leopard, but for Tiger you would probably need to override - [NSLayoutManager drawBackgroundForGlyphRange:atPoint:]. If all you're interested in is NSBackgroundColorAttributeName, that should be feasible: call super, check to see if the context is drawing to the screen, and if not, then for each character range to be colored, call - rectArrayForCharacterRange:withinSelectedCharacterRange:inTextContainer: rectCount: to get a list of rects to color.


Douglas Davidson

_______________________________________________

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


References: 
 >Getting temporary attributes set in NSLayoutManager to print (From: email@hidden)

  • Prev by Date: Getting temporary attributes set in NSLayoutManager to print
  • Next by Date: Re: How do I display a sheet as soon as the main window has displayed
  • Previous by thread: Getting temporary attributes set in NSLayoutManager to print
  • Next by thread: dropping file issue?
  • Index(es):
    • Date
    • Thread