Re: action for raise and lower baseline of textview
Re: action for raise and lower baseline of textview
- Subject: Re: action for raise and lower baseline of textview
- From: Quincey Morris <email@hidden>
- Date: Mon, 1 Mar 2010 00:24:42 -0800
On Feb 28, 2010, at 23:33, XiaoGang Li wrote:
> When creating my document-based application, there is a default menu
> item, Format->Font->Baseline. select text on the text view, then click the
> Raise or Lower menu, I find something that I can not understand.
> Click Raise menu first, the space between the lines increase.
> But if click Lower menu first, the space between the lines still
> increase. why?
It makes sense to me. Let's pretend that the line spacing is the total of the font ascent plus the font descent. (That's not quite right, but let's pretend.) If you raise the baseline of some text, the line spacing is the total of the font ascent of the raised text, plus the distance between the raised text's baseline and normal text's baseline, plus the normal font descent. That's greater than the normal line spacing.
If you lower some text, the line spacing is the total of the normal font ascent, plus the distance between the normal baseline and the lowered text baseline, plus the lowered text's descent. Again, that's greater than the normal line spacing.
In other words, if you shove some text up, you have to make some extra room above to shove it into. If you drop text down, you have to make extra room below to drop it into.
That's all assuming you don't change the point size. If you make the raised/lowered text smaller, you might not need extra space.
> Another:
> First, click the Raise, the space between the lines increase. then
> click lower, the space decrease. but if still click Lower, the increase will
> increase, (not decrease anymore).
This is just a special case of the above._______________________________________________
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