diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2009-11-30 11:57:10 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2009-11-30 12:06:51 (GMT) |
commit | 98a23b974509bd1b6d9459e6c79677bdcbaa0108 (patch) | |
tree | 575f65a07424356dbdb9e3c6fa7f2b9efe33629e | |
parent | 56c8393c5830045f599a22edbe4fd17c18dc827d (diff) | |
download | Qt-98a23b974509bd1b6d9459e6c79677bdcbaa0108.zip Qt-98a23b974509bd1b6d9459e6c79677bdcbaa0108.tar.gz Qt-98a23b974509bd1b6d9459e6c79677bdcbaa0108.tar.bz2 |
X11: Avoid loading all fonts in system for text with line breaks
The line separator code point has no glyph in any font, something we
would detect by running through a complete font merging loop and trying
all fonts in the system on X11. This would cause the memory consumption
to sky rocket the first time you added text with line breaks to an
application, and it was an unnecessary performance hit. Now we special
case the line separator and do no attempt to search for it in the
fonts.
Task-number: QTBUG-4537
Reviewed-by: Simon Hausmann
-rw-r--r-- | src/gui/text/qfontengine.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index 21b9cca..27fc3c1 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -1370,8 +1370,8 @@ bool QFontEngineMulti::stringToCMap(const QChar *str, int len, for (int i = 0; i < len; ++i) { bool surrogate = (str[i].unicode() >= 0xd800 && str[i].unicode() < 0xdc00 && i < len-1 && str[i+1].unicode() >= 0xdc00 && str[i+1].unicode() < 0xe000); - if (glyphs->glyphs[glyph_pos] == 0) { + if (glyphs->glyphs[glyph_pos] == 0 && str[i].category() != QChar::Separator_Line) { QGlyphLayoutInstance tmp = glyphs->instance(glyph_pos); for (int x = 1; x < engines.size(); ++x) { QFontEngine *engine = engines.at(x); |