Skip navigation.
 
mlRe: Finding the height of a piece of text
FROM : Aki Inoue
DATE : Mon Nov 26 19:11:34 2007

Vincent,

One thing unclear from your description is how the height returned 
from the code snippet is incorrect.  You mentioned the height is too 
small.
We need to know how it's small compared to what.  Are you measuring 
using the layout manager and rendering with something else ?

If you're using either NSStringDrawing or NSCell, as Steve mentioned, 
it's most likely typesetter behavior mismatch.

Thanks,

Aki

On 2007/11/23, at 1:16, Vincent Coetzee wrote:

> Dear List
>
> I tried your suggestions, alas, it makes no difference ?
>
> HELP !
>
> Vincent
>
> On 23 Nov 2007, at Friday 23/11/200708:39 , Nygard Steve wrote:
>

>>
>> On Nov 22, 2007, at 5:56 PM, Vincent Coetzee wrote:
>>

>>> I however always end up with the same problem, in that the height 
>>> that I calculate for my text (as per the code in the "Text Layout 
>>> Programming Guide") is always too small (by about ~1 line 
>>> height) . Does anyone have a working solution to this problem or a 
>>> more elegant method of solving it ?

>>
>> To calculate a height that matches an NSTextFieldCell, the line 
>> fragment padding should be 2 (or 4 for a center alignment).  And 
>> the layout manager's typesetter behavior should be 
>> NSTypesetterBehavior_10_2_WithCompatibility.
>>
>> --
>> Steve
>>
>> _______________________________________________
>>
>> Cocoa-dev mailing list (<email_removed>)
>>
>> 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:
>> http://lists.apple.com/mailman/options/cocoa-dev/vincent.<email_removed>
>>
>> This email sent to vincent.<email_removed>

>
> _______________________________________________
>
> Cocoa-dev mailing list (<email_removed>)
>
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
>
> This email sent to <email_removed>

Related mailsAuthorDate
mlFinding the height of a piece of text Vincent Coetzee Nov 23, 01:56
mlRe: Finding the height of a piece of text Nygard Steve Nov 23, 07:39
mlRe: Finding the height of a piece of text Vincent Coetzee Nov 23, 10:16
mlRe: Finding the height of a piece of text Jerry Krinock Nov 23, 16:00
mlRe: Finding the height of a piece of text Aki Inoue Nov 26, 19:11
mlRe: Finding the height of a piece of text Aki Inoue Nov 26, 22:04