Putting text in text frames at the bottom of the frame

Previous topic - Next topic

amasa

Two questions, both relating to the same issue.

When I put some text in a text frame, using the Story Editor usually, the text starts at the top and fills down to the bottom.  Which is what I usually want.  But sometimes I want to put the text at the bottom and fill upwards. Is this possible?

The reason for this is that sometimes I surround an image frame with a text frame to label the image, and for this I want the text at the bottom.  I can push the text down using the top margin in the 'text' page in the Properties window, but only 300pt.  Can I increase this limit?

utnik

hi chris

Quote from: chrisbagley on February 16, 2014, 09:27:09 AM...put the text at the bottom and fill upwards. Is this possible?

no – not in this way.

QuoteI can push the text down using the top margin in the 'text' page in the Properties window, but only 300pt.  Can I increase this limit?

don't use the margin, pull down the top border of the text box!

utnik

amasa

Hi Utnik
My problem is I want to leave the top border of the text frame where it is, on the top edge of the image frame it is wrapped around.  I am wondering why there is a 300pt limit to pushing the text down. It seems odd.

Chris

utnik

hi chris

Quote from: chrisbagley on February 16, 2014, 12:30:59 PMI want to leave the top border of the text frame ... on the top edge of the image frame...

tell me a good reason to do it this way! – to label an image at its bottom i would always place the text frame below the image.
the only reason i could imagine is a colored textbox or a frame around it. for this you lay a colored rectangle below the text frame...

utnik

amasa

Yes, I can put a text box at the bottom of the image, and I have to do that when the image is too big, i.e. taller than 300pts. 
However, I prefer to wrap the text frame around the image so that I can leave some space on one of other of the sides of the image to push the surrounding or adjacent text away from it.  It would be convenient therefore to be able to put the text at the bottom of the wrapping text frame.  However, I can't see a way.  I am wondering why there is the limit of 300pts in "pushing down" the text from the top of the frame.

Nermander

Quote from: chrisbagley on February 17, 2014, 01:46:26 AM
I prefer to wrap the text frame around the image so that I can leave some space on one of other of the sides of the image to push the surrounding or adjacent text away from it.

There are better ways to to that, for example edit the contour line of the image frame.


Nermander

But to be able do "bottom justify" a text frame would be a nice feature, for example for page footers, footnotes, endnotes etc.

GarryP

I agree with you there Nermander. Some kind of "vertical alignment/justification" option would be a nice-to-have feature as it could also include "centre vertical" which other users have asked for.

However, I've a feeling that it would be difficult to achieve efficiently.

Here's my thinking: To find the Y-offset, to start drawing the glyphs from, the software would have to calculate the height of all of the text that will fit into the frame by, essentially, drawing them "in its head" until it got to the last glyph - keeping track of the overall height - and then calculating the offset from the frame height. (With all of the justification and hyphenation options available I don't know how else it could do it otherwise accurately.) It would therefore have to draw the glyphs twice, once "invisibly" and then again "properly", thus doing twice the work for frames that had that option applied. (And it would have to recalculate every time any object on the same page moved if text flow was switched on for that frame.)

I could well be totally wrong though and it might be much easier than I think. This is just my first guess at how it could work. Someone more intelligent than me - and there will be lots and lots of them - may have a better solution. (And I'd be very interested in knowing what that was, if anyone knows of one.)

It could be a good project for a student to do either way.

Nermander

Well isn't that the same way it has to be done in top adjusted frames?

GarryP

Well, you're correct but it only needs to draw the glyphs once for top-alligned text frames. And it doesn't need to calculate the height of the text; it just keeps drawing until the frame is full.

However, thinking about it a bit more - I did say it was my first guess - I've managed to blow away my own reasoning.

Drawing the glyphs to find out how high the whole block of text will be is totally useless because it doesn't know where the text will start from.

Any intrusion into the text flow would make the calculation incorrect. I.e. It needs to know where the text will start from in order to find out how high the block of text will be but it needs the height to calculate the start point. It's gibberish.

I've been looking at the problem all wrong. A bad thought had stuck in my head that made all of my reasoning go wrong. This is why I don't think too much. (For some reason I'd assumed that the start of the text had to be contained in the frame. Silly me.)

The answer is obviously to start drawing the last glyph from the bottom-right of the text frame - assuming LTR writing - and moving up when the "line" is full. So simple, yet my initial stupid mistake made the whole thing look way too complicated. There's a lesson somewhere in that.

Anyway, ignore the ramblings of this foolish old man; "justify vertical bottom" would be a great feature.

"Justify vertical centre" on the other hand... Oh no... Nurse... It's happening again!

Nermander

I would thing that you could draw the text on a virtual "canvas" with the correct width, to find out what the height if the text will be. And then the text can be "moved down" to the correct starting location.

And I don't think the text has to be drawn, the numbers can probably be calculated using font metrics.

GarryP

That was what I was thinking with my first idea but it won't work.

See the attached screenshot for a basic example.

(It was drawn very crudely so please ignore the fact that stuff isn't totally accurate, it's the idea I'm trying to get across.)

In Scenario A you calculate the height of the text via font metrics (which was what I meant by 'drawing them "in its head"') - and all is well.

In Scenario B you take the height of the text from the frame height and use that as a "Y offset" to start from - and all is still well.

However, in Scenario C, if you introduce an image (or whatever) that you want to flow around there's a big problem.

When you calculate the height of the text you need to take into account all of the objects that it might need to flow around. And you won't know what they are or how they'll interact with the text until you know where the text will be. So it can't work.

However, if you start drawing the glyphs from the last character in the text at the bottom right of the frame - assuming LTR - and moving left, then up, you can take other objects into account, as in Scenario D.

I have no idea how this would affect the hyphenation and horizontal justification features etc. I've a feeling that would be a lot more complicated but I'm just not going to think about that right now.

[attachment deleted by admin]