On 12/20/2014, 1:18 PM, J. Landman Gay wrote:

I found that by adding a small number of pixels to the top margin I
could get it close, which is what Bernd was doing too. I've been trying
to figure out where the problem is, but like him, I don't see anything
offhand. I'm pretty sure the engine must either be adding padding to the
top line, or else not reporting the underhang of the last line, which
makes the formattedWhatever functions not quite exact.

On the theory that the problem isn't at the top but rather at the bottom, I calculated the amount of space occupied by the (imaginary) line 0 in the field. I think in general 2/3 of the text is placed above the baseline and 1/3 of it is placed below that. So the top line would be offset by 1/3 the textheight of the (nonexistent) line 0.

This seems to come closer to what we want:

put round(the effective textheight of fld 1 * .66) into tUnderHang
set the topmargin of fld 1 to (the height of fld 1 - (the formattedheight of line 1 to -1 of fld 1) + tUnderHang) div 2

--
Jacqueline Landman Gay         |     jac...@hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to