Thanks for your response
Yes, I am "line breaking by word" to obtain a single line of text.
My procedure just iterates through the words in a line, testing the width until it exceeds the desired target width.
Your suggestion of arbitrarily specifying an extended print width using a negative RIGHT is another way to ensure the answer is not distorted by a page limit - I hadn't thought of that. However, I suspect it is not really any different, in effect, from specifying a negative LEFT as I am doing now - the principle is the same.
This leaves two approaches to "getting a single line of text" (leaving aside the idea of optimising either procedure with a binary word-break search for now):
1. Iterate the word breaks testing the output width as you go until it exceeds the required width (then accept the previous word break)
2. Iterate the word breaks until the rendered height for the given width exceeds 1 line (then accept the previous word break)
Aside from option 2 not being affected by the "width truncation issue", I am not sure that either method would be significantly more efficient than the other.
Anyway, this post was not so much about a solution to the issue of identifying lines-of-text as such, but rather about the usefulness of functions that returned a "true" width or height value WITHOUT page margin truncation. eg If a string is 1 metre wide, I want to know that it is 1 metre wide - not 21 cm wide because that is my page size.
Here's another example to illustrate the point:
A report includes output of a "description" or memo field of plain text. Generally, I want to keep the description together on 1 page rather than wrap it (so I'll force a new page before outputing this record if necessary), but, if the field is exceptionally long, I may wrap it rather than leave too much blank space on the current page... There would be an arbitrary algorithm to decide how to handle the text in any given case.
To achieve this, I must know the absolute height of the memo text - I cannot have the answer complicated by the possibility of truncation by a page boundary.
Yes, certainly, I can achieve this reasonably safely by "tricking the page bouandaries" as above - but it would be a lot simpler not to have to worry about this at all, and just obtain an absolute height directly...