I print a lot of similar documents with varying headlines. The headline must be on one line. Fontsize should be 40 if possible, but if it doesn't fit in one line, fontsize should be reduced.
I use VPE for Visual DataFlex from StarZen. To calculate the biggest possible font size, I try to run a loop and decrement fontsize until the length of the headline is short enough. My statements are:
Get DoVpeRenderWrite VLEFTMARGIN VTOPMARGIN VFREE VFREE sText to iTest
Get DoVpeGet VRENDERWIDTH to iTextWidth
The problem is that if the headline is to long it will be printed on two lines and iTextWidth will not be the length of the total headline but the length of one of the two lines. After reading the VPE manual, I thought iTest would be >0 if a textbreak occur, buit even in that case, iTest is zero.
Is there a solution to this problem?
Bengt