summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPierre Rossi <pierre.rossi@nokia.com>2011-07-19 16:36:05 (GMT)
committerPierre Rossi <pierre.rossi@nokia.com>2011-08-15 19:02:37 (GMT)
commit1bea92a96e3007667d23058be03b75cef315608b (patch)
tree541398160eb244605eb3f85e8a12e83d1da28329 /src
parentb90a0139a4f63c730bb4668e04ab3f8c81ead04f (diff)
downloadQt-1bea92a96e3007667d23058be03b75cef315608b.zip
Qt-1bea92a96e3007667d23058be03b75cef315608b.tar.gz
Qt-1bea92a96e3007667d23058be03b75cef315608b.tar.bz2
Add support for rawFonts loaded from data in FaceId
The problem was that with an empty filename and index of 0, all raw fonts loaded from data had the same FaceId, and we wouldn't bother to load another one after doing this once. This commit introduces a uuid in FaceId to help distinguish them in that case. Change-Id: I93655ff07a7d8856af1f854024e207c519f8ed1a Reviewed-on: http://codereview.qt.nokia.com/1882 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/text/qfontengine_p.h3
-rw-r--r--src/gui/text/qrawfont_ft.cpp2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h
index a70aec1..8d81acb 100644
--- a/src/gui/text/qfontengine_p.h
+++ b/src/gui/text/qfontengine_p.h
@@ -155,6 +155,7 @@ public:
struct FaceId {
FaceId() : index(0), encoding(0) {}
QByteArray filename;
+ QByteArray uuid;
int index;
int encoding;
};
@@ -295,7 +296,7 @@ inline bool operator ==(const QFontEngine::FaceId &f1, const QFontEngine::FaceId
inline uint qHash(const QFontEngine::FaceId &f)
{
- return qHash((f.index << 16) + f.encoding) + qHash(f.filename);
+ return qHash((f.index << 16) + f.encoding) + qHash(f.filename + f.uuid);
}
diff --git a/src/gui/text/qrawfont_ft.cpp b/src/gui/text/qrawfont_ft.cpp
index 5bba221..1666df3 100644
--- a/src/gui/text/qrawfont_ft.cpp
+++ b/src/gui/text/qrawfont_ft.cpp
@@ -45,6 +45,7 @@
#include "qrawfont_p.h"
#include "qfontengine_ft_p.h"
+#include "quuid.h"
#if defined(Q_WS_X11) && !defined(QT_NO_FONTCONFIG)
# include "qfontengine_x11_p.h"
@@ -87,6 +88,7 @@ public:
FaceId faceId;
faceId.filename = "";
faceId.index = 0;
+ faceId.uuid = QUuid::createUuid().toByteArray();
return init(faceId, true, Format_None, fontData);
}