MXGDI_CALCRECTX (opcode 6) has been added to MX_GDICALC for the purpose of calculating rectangular XTEXT metrics. This is used in conjunction with the GDI printing directive XTEXT, which permits the printing a text or RTF file via XTEXT into a specified rectangle.
XCALL MIAMEX, MX_GDICALC, MXGDI_CALCRECTX, handle, status, lft, top, rght, btm, file$, height, offset
This is essentially the same as the existing OP 3 (MXGDI_CALCRECT) except:
• | The MEMO$ argument in OP 3 is replaced here by FILE$, which specifies the filespec of the text file to analyze. |
• | The OVERFLOW$ argument in OP 3 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 fit 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 OP 3, where the font and other spacing factors must be set in advance (via MX_GDICALC OP 2), with XTEXT printing, the font and other layout parameters are set within the text file (particularly in the case of RTF files). |
The MMOGDI sample program in [908,37] of the EXLIB illustrates the use of //XTEXT and MX_GDICALC, MXGDI_CALCRECTX