Antonio,
thanks for your help! However, the problem didn't happen with choosefont directly, but with oFont:Choose(). That was an error in my sourcecode research. But it seems to me there can be made an improvement to the Choose method in the TFont class, because the handle of the printer (hPrinterDC) isn't passed through to choosefont()
I made following modification:
if nRGBColor != nil
aFont := ChooseFont( { ::nInpHeight, ::nInpWidth, ::nEscapement,;
::nOrientation, ::nWeight, ::lItalic,;
::lUnderLine, ::lStrikeOut, ::nCharSet,;
::nOutPrecision, ::nClipPrecision,;
::nQuality, ::nPitchFamily, ::cFaceName },;
@nRGBColor )
else
aFont := ChooseFont( { ::nInpHeight, ::nInpWidth, ::nEscapement,;
::nOrientation, ::nWeight, ::lItalic,;
::lUnderLine, ::lStrikeOut, ::nCharSet,;
::nOutPrecision, ::nClipPrecision,;
::nQuality, ::nPitchFamily, ::cFaceName } )
endif
to
DO CASE
CASE nRGBColor == nil .AND. hPrinterDC == nil
aFont := ChooseFont( { ::nInpHeight, ::nInpWidth, ::nEscapement,;
::nOrientation, ::nWeight, ::lItalic,;
::lUnderLine, ::lStrikeOut, ::nCharSet,;
::nOutPrecision, ::nClipPrecision,;
::nQuality, ::nPitchFamily, ::cFaceName },;
)
CASE nRGBColor == nil .AND. hPrinterDC != nil
aFont := ChooseFont( { ::nInpHeight, ::nInpWidth, ::nEscapement,;
::nOrientation, ::nWeight, ::lItalic,;
::lUnderLine, ::lStrikeOut, ::nCharSet,;
::nOutPrecision, ::nClipPrecision,;
::nQuality, ::nPitchFamily, ::cFaceName },;
, hPrinterDC )
CASE nRGBColor != nil .AND. hPrinterDC == nil
aFont := ChooseFont( { ::nInpHeight, ::nInpWidth, ::nEscapement,;
::nOrientation, ::nWeight, ::lItalic,;
::lUnderLine, ::lStrikeOut, ::nCharSet,;
::nOutPrecision, ::nClipPrecision,;
::nQuality, ::nPitchFamily, ::cFaceName },;
@nRGBColor, )
CASE nRGBColor != nil .AND. hPrinterDC != nil
aFont := ChooseFont( { ::nInpHeight, ::nInpWidth, ::nEscapement,;
::nOrientation, ::nWeight, ::lItalic,;
::lUnderLine, ::lStrikeOut, ::nCharSet,;
::nOutPrecision, ::nClipPrecision,;
::nQuality, ::nPitchFamily, ::cFaceName },;
@nRGBColor, hPrinterDC )
ENDCASE
And now it works fine!