bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextField problems


From: Alexander Malmberg
Subject: Re: NSTextField problems
Date: Wed, 29 Jan 2003 14:14:30 +0100

Serg Stoyan wrote:
[snip]
> Take a look at following pictures please:
> 
> 1. http://stepmaker.sourceforge.net/stepmaker/TF1.jpg - textfield is in
> focus, cursor is inside.
> 
> 2. http://stepmaker.sourceforge.net/stepmaker/TF2.jpg - textfield is out of 
> focus.
> 
> 3. http://stepmaker.sourceforge.net/stepmaker/TF3.jpg - textfield after
> Return (or Tab) key pressed.
> 
> On the pictures 1 and 3 bottom of the text is lower bottom side of
> textfield. Isn't it a reason of exceptions? I'll look at code probably
> tommorow.

I don't think this has anything to do with the problems. The current
typesetter places the gap between the "line height" and real "text
height" above the text, which is probably what's causing the text to
appear further down. (In other words, the text touches the lower edge of
the line height rectangle.) I'll change this so the gap is below the
text instead. (So the text touches the upper edge of the line height
rectangle.)

> > I'm not really sure what the best way to really fix it is, though. The
> > typesetter and layout manager are correct in not laying out any glyphs,
> > since the text actually doesn't fit in the cell. On the other hand, the
> > current behavior isn't good, since it breaks very easily (if a cell
> > isn't tall enough, or if someone uses larger fonts).
> 
> I think that better solution is place text centered horizontally in
> textfield even if text size is bigger than texfield. For example, textfield
> height is 10 pixels, text font 14 pixels. Placing text centered mean loss 2
> pixels of text at top and 2 at bottom. This is looks ugly, but application
> programmer will know what the problem is.

I should have been clearer. It isn't the point size of the text that's
too high, it's the line height. Anyway, I could add some magic when
placing the baseline when the container is too small to fit anything,
but I'd prefer not to. I think moving the text up (in it's line height)
will take care of this in all sane cases. :)

- Alexander Malmberg




reply via email to

[Prev in Thread] Current Thread [Next in Thread]