VpeWrite

<< Click to Display Table of Contents >>

Navigation:  Text Functions >

VpeWrite

Previous pageReturn to chapter overviewNext page

Outputs text formatted with the current alignment settings within a rectangle at position x, y, with the right border at x2 and the bottom border at y2.

The pen is invisible.

VpeCoord VpeWrite(

VpeHandle hDoc,

VpeCoord x,

VpeCoord y,

VpeCoord x2,

VpeCoord y2,

LPCSTR text

)

VpeHandle hDoc

Document Handle

VpeCoord x, y, x2, y2

position and dimensions

LPCSTR text

the text to output

Returns:

the bottom y-coordinate generated by the output

Remarks:

Do not use leading blanks for text output. You will realize, that this might result under special circumstances in a x- direction misalignment at the beginning of the lines, even if you are using a non-proportional font like "Courier New". This is normal and happens due to the technique, how VPE renders text. Instead of using leading blanks, eliminate those blanks and position the first character as needed by setting a correct x-start coordinate.

 

You should never use static values for Y2 when doing text output, e.g. Write(1, 1, 5, 3, "Hello"). It may happen that you see text on the screen and on some printers, but not on other printers. This is, because some printer-drivers clip complete lines, in case only one pixel is outside their clipping rectangle. Also some printer-drivers add internal offsets to the bottom of text, so that it is even clipped if the text itself fits into the rectangle.

Use VFREE - or for performance reasons: Render the height of a line and use this value.

 

It is not possible to change font styles within one string. For such need, you should use the Professional Edition, which can interpret and display Rich Text Format (RTF).

 

VPE offers several methods to attach an object's position to margins and relative to the position of previously inserted objects. In addition Text, Rich Text and Picture objects are able to compute their dimensions automatically depending on their visual content.
For details please see "Dynamic Positioning" in the Programmer's Manual.

 

If the very first character of the output string is a '[' (square bracket), VPE expects a sequence of Embedded Flags. In order to print a square bracket as the very first character, output two consecutive square brackets, i.e. '[['. For details, see "Embedded Flag-Setting" in the Programmer's Manual.