Re: Controlling line tightening

2008-03-12 Thread John Stiles
BTW, I've just documented this limitation in Radar: rdar://5795937 AppKit string tightening should work with non-truncating line break modes This one is up to you—if you think it would be a useful addition, great; if not, I guess you can punt it as "Behaves Correctly" or something. John

Re: Controlling line tightening

2008-03-12 Thread John Stiles
Right, we went over this a month or two ago. But in this case, I actually needed finer-grained control over the tightening—for instance, I didn't want an ellipsis when the tightening threshold is exceeded. Instead, when the tightening threshold is exceeded, I just want it to use the maximum tig

Re: Controlling line tightening

2008-03-12 Thread Aki Inoue
John, The tightening is controlled by -[NSParagraphStyle tighteningFactorForTruncation]. http://developer.apple.com/documentation/Cocoa/Reference/ ApplicationKit/Classes/NSParagraphStyle_Class/Reference/ Reference.html#//apple_ref/occ/instm/NSParagraphStyle/ tighteningFactorForTruncation

Re: Controlling line tightening

2008-03-12 Thread John Stiles
Followup: this requires a bit of math but it works great in practice. I have a lot more control over the tightening now, which is just what I needed. Thanks! John Stiles wrote: Interesting! I didn't think to use kerning directly. Thank you for the idea!! It makes sense since obviously I am try

Re: Controlling line tightening

2008-03-12 Thread John Stiles
Interesting! I didn't think to use kerning directly. Thank you for the idea!! It makes sense since obviously I am trying to do something a little more sophisticated than the default "tighten" functionality. How does "line tightening" pick an appropriate kerning value? I'm thinking you could us

Re: Controlling line tightening

2008-03-12 Thread glenn andreas
On Mar 11, 2008, at 9:54 PM, John Stiles wrote: Gah, I spoke too soon. This "solution" actually disables tightening entirely. So I'm back to square one. Please help! You could try to manually squeeze the result by setting an attributed string's NSKernAttributeName value, but that would b

Re: Controlling line tightening

2008-03-11 Thread John Stiles
Gah, I spoke too soon. This "solution" actually disables tightening entirely. So I'm back to square one. Please help! John Stiles wrote: Whoops, this is easy! [myParagraphStyle setLineBreakMode:NSLineBreakByClipping]; I guess I didn't get enough sleep last night :) I don't think th

Re: Controlling line tightening

2008-03-11 Thread John Stiles
Whoops, this is easy! [myParagraphStyle setLineBreakMode:NSLineBreakByClipping]; I guess I didn't get enough sleep last night :) I don't think this completely addresses my question—when the text field gets too full, it looks like it does lose its tightening—but it's good enough for m

Controlling line tightening

2008-03-11 Thread John Stiles
I'm using line tightening in some of my dialogs and 99% of the time it works great, but there are a few aspects of it that don't work for my app. In particular, when line tightening kicks in, first it attempts to shrink the text to fit the box, which is awesome. But when it still doesn't fit ev