summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontengine_qpf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/text/qfontengine_qpf.cpp')
-rw-r--r--src/gui/text/qfontengine_qpf.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/gui/text/qfontengine_qpf.cpp b/src/gui/text/qfontengine_qpf.cpp
index ed8abb8c39..e7826cc2ae 100644
--- a/src/gui/text/qfontengine_qpf.cpp
+++ b/src/gui/text/qfontengine_qpf.cpp
@@ -326,8 +326,8 @@ QFontEngineQPF::QFontEngineQPF(const QFontDef &def, int fileDescriptor, QFontEng
fileName.replace(QLatin1Char(' '), QLatin1Char('_'));
fileName.prepend(qws_fontCacheDir());
- const QByteArray encodedName = QFile::encodeName(fileName);
- if (::access(encodedName, F_OK) == 0) {
+ encodedFileName = QFile::encodeName(fileName);
+ if (::access(encodedFileName, F_OK) == 0) {
#if defined(DEBUG_FONTENGINE)
qDebug() << "found existing qpf:" << fileName;
#endif
@@ -506,15 +506,21 @@ QFontEngineQPF::QFontEngineQPF(const QFontDef &def, int fileDescriptor, QFontEng
#endif
#if defined(Q_WS_QWS)
if (isValid() && renderingFontEngine)
- qt_fbdpy->sendFontCommand(QWSFontCommand::StartedUsingFont, QFile::encodeName(fileName));
+ qt_fbdpy->sendFontCommand(QWSFontCommand::StartedUsingFont, encodedFileName);
#endif
}
QFontEngineQPF::~QFontEngineQPF()
{
#if defined(Q_WS_QWS)
- if (isValid() && renderingFontEngine)
- qt_fbdpy->sendFontCommand(QWSFontCommand::StoppedUsingFont, QFile::encodeName(fileName));
+ if (isValid() && renderingFontEngine) {
+ QT_TRY {
+ qt_fbdpy->sendFontCommand(QWSFontCommand::StoppedUsingFont, encodedFileName);
+ } QT_CATCH(...) {
+ qDebug("QFontEngineQPF::~QFontEngineQPF: Out of memory");
+ // ignore.
+ }
+ }
#endif
delete renderingFontEngine;
if (fontData) {
@@ -1165,6 +1171,11 @@ void QPFGenerator::writeTaggedQFixed(QFontEngineQPF::HeaderTag tag, QFixed value
#endif // QT_NO_QWS_QPF2
+/*
+ Creates a new multi qws engine.
+
+ This function takes ownership of the QFontEngine, increasing it's refcount.
+*/
QFontEngineMultiQWS::QFontEngineMultiQWS(QFontEngine *fe, int _script, const QStringList &fallbacks)
: QFontEngineMulti(fallbacks.size() + 1),
fallbackFamilies(fallbacks), script(_script)