Important tip for users of CairoPrintGraphics..

From: Martin Sevior <msevior_at_gmail.com>
Date: Tue Jan 13 2009 - 00:53:16 CET

Hi everyone,
                   (Especially Dom). In order to make printing of
maths work, one has to manually set the ratio of the resolution
between the screen and the printer.

See the following comment in GR_CairoPrintGraphics

/*!
 * This number is the ratio of the screen resolution to the printer resolution.
 * It is vital that the method that creates CairoPrintGraphics set this value.
 * Otherwise printing of Maths will look weird.
 *
 * See XAP_UnixDlg_Print::beginPrint(...)
 */
void GR_CairoPrintGraphics::setResolutionRatio(double dres)
{
        m_dResRatio = dres;
}

the code in XAP_UnixDlg_Print::beginPrint(..) is:

        m_pPrintGraphics = (GR_Graphics *) new GR_CairoPrintGraphics(cr,72.0);
        double ScreenRes = m_pView->getGraphics()->getDeviceResolution();
        static_cast<GR_CairoPrintGraphics
*>(m_pPrintGraphics)->setResolutionRatio(72.0/ScreenRes);

Cheers

Martin
Received on Tue Jan 13 00:53:28 2009

This archive was generated by hypermail 2.1.8 : Tue Jan 13 2009 - 00:53:28 CET