Please enable JavaScript to view this site.

A-Shell Reference

Navigation: Subroutines > MIAMEX > MX_GDICALC

Calculate rectangular XTEXT metrics

Scroll Prev Top Next More

xcall MIAMEX, MX_GDICALC, MXGDI_CALCRECTX, handle, status, lft, top, rght, btm, file, height, offset

This is used to calculated the XTEXT metrics required for use with the GDI print command //XTEXT, and is essentially the same as the existing MXGDI_CALCRECT except:

The memo argument in MXGDI_CALCRECT is replaced here by file, which specifies the filespec of the text file to analyze.
The overflow argument in MXGDI_CALCRECT is replaced here by offset, which indicates the offset within the file. On input, it is the starting offset (default 0). On output, it will be 0 if the entire file fits within the specified rectangle. Otherwise, it will be the offset to the first character that did not fit (which can then be passed to a subsequent MX_GDICALC call).
Note that unlike MXGDI_CALCRECT, where the font and other spacing factors must be set in advance (via MX_GDICALC opcode 2), with XTEXT printing, the font and other layout parameters are set within the text file (particularly in the case of RTF files).

The sample program MMOGDI in EXLIB:[908,37] illustrates the use of //XTEXT and MX_GDICALC, MXGDI_CALCRECTX.

This function also works in ATE. As with XTEXTxs, a file resident on the server will be transferred to ATECACHEDIR on PC. Since the use of MXGDI_CALCRECTX implies that this will happen multiple times per file printed, you might want to optimize the operation, if you are doing it on a lot of files, by pre-transferring the files to the ATECACHEDIR and then referencing the filespec as %atecachedir%\xxxxxx.yyy.