@ -20,6 +20,7 @@
# include <kmimetype.h>
# include <kmimetype.h>
# include <QFile>
# include <QFile>
# include <QFontDatabase>
# include <QImage>
# include <QImage>
# include <QPainter>
# include <QPainter>
@ -421,11 +422,17 @@ void dviRenderer::epsf_special(const QString& cp)
QFont f = foreGroundPainter - > font ( ) ;
QFont f = foreGroundPainter - > font ( ) ;
f . setPointSize ( 8 ) ;
f . setPointSize ( 8 ) ;
foreGroundPainter - > setFont ( f ) ;
foreGroundPainter - > setFont ( f ) ;
if ( QFile : : exists ( EPSfilename ) )
/* if the fonts are mapped for some reason to X bitmap fonts,
foreGroundPainter - > drawText ( bbox , ( int ) ( Qt : : AlignCenter ) , EPSfilename ) ;
the call to drawText ( ) in the non - GUI thread will produce a crash .
else
Ensure that the rendering of the text is performed only if
foreGroundPainter - > drawText ( bbox , ( int ) ( Qt : : AlignCenter ) ,
the threaded font rendering is available */
i18n ( " File not found: \n %1 " , EPSfilename_orig ) ) ;
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 ( ) ;
foreGroundPainter - > restore ( ) ;
}
}