• 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
Text layout responsibility
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Text layout responsibility


  • Subject: Text layout responsibility
  • From: Rimas <email@hidden>
  • Date: Thu, 11 Dec 2008 22:16:18 +0200

Hello list,

I have performed quick search through  the list and couldn't find
answer to my question.

I am trying to implement editable text view which changes text
position (paragraphs positions, to be exact) according to the some
text attributes. I know, that NSTextContainer is responsible for line
rects calculation when text should be placed in known shape. Is it
responsible for this when position depends on text attributes also?
Reason I am asking is that in method
lineFragmentRectForProposedRect:sweepDirection:movementDirection:remainingRect:
I do not have any information about glyphs or characters range to be
placed in proposed rect, only rect coordinates. Should I do this
manually by accessing container -> text view -> text storage? Maybe
NSLayoutManager or NSTypeSetter subclass would be better choice?

Another thing I'd like to ask, is where should I adjust text view/text
container size if this is necessary while typing? I have tried to do
this after getting NSTextStorageDidProcessEditingNotification
notification. But that raises an exception:

>> Exception raised during posting of notification.  Ignored.  exception: '*** NSRunStorage, _NSBlockNumberForIndex(): index (0) beyond array bounds (0)'  invoked observer method: '*** -[MyTestController _TextStorageContentChanged:]'  observer: 0x14d60b10  notification name: 'NSTextStorageDidProcessEditingNotification'  <<

Any help is very appreciate.

Regards,
Rimas M.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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: Text layout responsibility
      • From: Martin Wierschin <email@hidden>
  • Prev by Date: Re: Is it useful to make a 64 bit app? [Was]: How can users check if their mac is 64-bit-capable?
  • Next by Date: Arggg...overrelease in table view cell, but where?
  • Previous by thread: Re: Blunt edges to Window
  • Next by thread: Re: Text layout responsibility
  • Index(es):
    • Date
    • Thread