Ok, we looked at the file and here is the result:
You are trying to create a table like:
- Code: Select all
xxxxx xxx xxxxx
xxx xxx xxx
You output each line as a single string, e.g.
- Code: Select all
VPE.Write(1, 1, VFREE, VFREE, "xxxxx xxx xxxxx");
VPE.Write(1, 2, VFREE, VFREE, "xxx xxx xxx");
If you would be using a proportional font (like Arial or Times New Roman), the columns wouldn't be vertically aligned due to different text widths.
You would get something like:
xxxxx xxx xxxxx
xxx xxx xxx
Therefore you are using the monospaced font Courier New, which has fixed widths for each character. This looks fine in the preview for a zoom factor of 100% and higher, also for 75% and 50%, but not for 33% and 66%. Using such zoom factors, the columns are misaligned by 1 or 2 pixels, so they are not displayed vertically aligned.
As you mentioned, the problem only affects the preview on the screen, not printing or export to PDF.
The reason is how VPE renders text. Without going too much into detail, VPE does not compute the position of each single character, it uses a different technique to gain very high performance. But the screen has a very low resolution of about 96 DPI. When using a zoom factor of 66% or 33% this equals 63.36 DPI and 31.68 DPI. This is a very poor resolution and here some round off errors occur. However, you will notice that the
endings of all lines of text are aligned correctly.
The solution for your problem is as follows: do not output each line of text as a single string as a whole. Instead output each column separately with aligned coordinates (i.e. like a cell of a spreadsheet).
Example:
- Code: Select all
// First Line
VPE.Write(1, 1, VFREE, VFREE, "xxxxx");
VPE.Write(5, 1, VFREE, VFREE, "xxx");
VPE.Write(10, 1, VFREE, VFREE, "xxxxx");
// Second Line
VPE.Write(1, 2, VFREE, VFREE, "xxxxx");
VPE.Write(5, 2, VFREE, VFREE, "xxx");
VPE.Write(10, 2, VFREE, VFREE, "xxxxx");
When doing so, you can easily align numbers by using right aligned text for such columns (digits are always monospaced, even when using proportional fonts).
This also enables you to use proportional fonts instead of Courier New (which produces the output of an old-style line printer - but we have the 21st century, not 1985).
Hope this helps.
Regards
Thorsten Radde
IDEAL Software GmbH