diff --git a/generators/dvi/special.cpp b/generators/dvi/special.cpp index 4d63e9d67..22ee549fb 100644 --- a/generators/dvi/special.cpp +++ b/generators/dvi/special.cpp @@ -20,6 +20,7 @@ #include #include +#include #include #include @@ -421,11 +422,17 @@ void dviRenderer::epsf_special(const QString& cp) QFont f = foreGroundPainter->font(); f.setPointSize(8); foreGroundPainter->setFont(f); - if (QFile::exists(EPSfilename)) - foreGroundPainter->drawText (bbox, (int)(Qt::AlignCenter), EPSfilename); - else - foreGroundPainter->drawText (bbox, (int)(Qt::AlignCenter), - i18n("File not found: \n %1", EPSfilename_orig)); + /* if the fonts are mapped for some reason to X bitmap fonts, + the call to drawText() in the non-GUI thread will produce a crash. + Ensure that the rendering of the text is performed only if + the threaded font rendering is available */ + if (QFontDatabase::supportsThreadedFontRendering()) { + if (QFile::exists(EPSfilename)) + foreGroundPainter->drawText (bbox, (int)(Qt::AlignCenter), EPSfilename); + else + foreGroundPainter->drawText (bbox, (int)(Qt::AlignCenter), + i18n("File not found: \n %1", EPSfilename_orig)); + } foreGroundPainter->restore(); }