• 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: Custom line breaking in NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom line breaking in NSTextView


  • Subject: Re: Custom line breaking in NSTextView
  • From: email@hidden (Stefan Haller)
  • Date: Thu, 28 Jul 2005 11:30:12 +0200
  • Organization: Ableton

Aki Inoue <email@hidden> wrote:

> > 1) Determine which is the first character that no longer fits on the
> >    current line;
> >
> > 2) Once that character is found, go back from there and look for a
> >    suitable place where to break the line.
> >
> > Your suggestion would allow me to customize 2), which is not what I
> > want; I need to customize 1).
>
> I really don't see why you think it doesn't work.

Because I tried it.  :-)

> In order to fit a pre-defined number of characters in a line, you need to
> specify sufficiently large number for the container width.  From there,
> the glyph position passed to the method should be always larger than the
> number of characters.

It doesn't appear to work that way.  For a text container that is wider
than my line of text, lineBreakBeforeIndex:withinRange: is not called at
all (why should it).  The method is only called after the typesetter
determined that the line doesn't fit into the container rect, and then
it passes a range up to the first character that doesn't fit.  That's
too late for me; I need to hook into the decision which characters do or
don't fit on a line.

I really don't know how else to put it: you told me how to customize 2)
(see top of mail), which I don't need to do; I need to customize 1), and
I can't figure out how to do that easily.


--
Stefan Haller
Ableton
http://www.ableton.com/
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Custom line breaking in NSTextView (From: Aki Inoue <email@hidden>)

  • Prev by Date: Make NSTextView a binary editor : performance issues
  • Next by Date: CoreData and NSCalendarDate/NSDate attributes
  • Previous by thread: Re: Custom line breaking in NSTextView
  • Next by thread: NSMutableCopy Issue - New to Cocoa and Objective-C
  • Index(es):
    • Date
    • Thread