The MXGDI_CALCRECT opcode was returning invalid results if multiple MXGDI_SETFONT and MXGDI_CALCRECT operations were performed with a single printer device context (i.e. with a single MXGDI_OPENPTR call). This was particularly noticeable if calling the routine multiple times in a loop with different font sizes to determine the optimum font size needed for a particular string to fit in a specified rectangle.
A new test program, GDICALC.BP, has been added to the EXLIB in [908,37] to illustrate this kind of logic.
Note: MXGDI_CALCRECT assumes vertical spacing optimum for the font, i.e. as if a //RESETLPP command had been executed after the //SETFONT. (If you don't do this in the actual GDI print file, the spacing for the print operation may not match that used for the calculations.)