summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-06-10 10:00:34 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-06-10 10:00:34 +0200
commit0eff16611f65c1459ab73bde1ad2175614dd84eb (patch)
tree3eec6162b3f9fd283c1fb675c7d437baf6c37565 /src/gui
parent9095210c0b57f75fe2fecf7289fabbdfdf64e198 (diff)
parentebea15cb33da8063a630867e38eacf7857b0b936 (diff)
Merge remote-tracking branch 'origin/release' into stable
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qguiapplication.cpp4
-rw-r--r--src/gui/text/qfontengine_ft.cpp18
-rw-r--r--src/gui/text/qfontengine_ft_p.h1
3 files changed, 18 insertions, 5 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 2a1d7e3bcc..29a7e87d46 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -2251,8 +2251,8 @@ void QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::E
if (!p->receivedExpose) {
if (p->resizeEventPending) {
// as a convenience for plugins, send a resize event before the first expose event if they haven't done so
- QSize size = p->geometry.size();
- QResizeEvent e(size, size);
+ // window->geometry() should have a valid size as soon as a handle exists.
+ QResizeEvent e(window->geometry().size(), p->geometry.size());
QGuiApplication::sendSpontaneousEvent(window, &e);
p->resizeEventPending = false;
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp
index 10225febcb..4545645dc6 100644
--- a/src/gui/text/qfontengine_ft.cpp
+++ b/src/gui/text/qfontengine_ft.cpp
@@ -1316,6 +1316,12 @@ void QFontEngineFT::doKerning(QGlyphLayout *g, QFontEngine::ShaperFlags flags) c
unlockFace();
}
}
+
+ if (shouldUseDesignMetrics(flags) && !(fontDef.styleStrategy & QFont::ForceIntegerMetrics))
+ flags |= DesignMetrics;
+ else
+ flags &= ~DesignMetrics;
+
QFontEngine::doKerning(g, flags);
}
@@ -1571,12 +1577,18 @@ bool QFontEngineFT::stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs
return true;
}
+bool QFontEngineFT::shouldUseDesignMetrics(QFontEngine::ShaperFlags flags) const
+{
+ if (!FT_IS_SCALABLE(freetype->face))
+ return false;
+
+ return default_hint_style == HintNone || default_hint_style == HintLight || (flags & DesignMetrics);
+}
+
void QFontEngineFT::recalcAdvances(QGlyphLayout *glyphs, QFontEngine::ShaperFlags flags) const
{
FT_Face face = 0;
- bool design = (default_hint_style == HintNone ||
- default_hint_style == HintLight ||
- (flags & DesignMetrics)) && FT_IS_SCALABLE(freetype->face);
+ bool design = shouldUseDesignMetrics(flags);
for (int i = 0; i < glyphs->numGlyphs; i++) {
Glyph *g = cacheEnabled ? defaultGlyphSet.getGlyph(glyphs->glyphs[i]) : 0;
// Since we are passing Format_None to loadGlyph, use same default format logic as loadGlyph
diff --git a/src/gui/text/qfontengine_ft_p.h b/src/gui/text/qfontengine_ft_p.h
index 434eb76c33..e09fa6f94f 100644
--- a/src/gui/text/qfontengine_ft_p.h
+++ b/src/gui/text/qfontengine_ft_p.h
@@ -325,6 +325,7 @@ private:
friend class QFontEngineMultiFontConfig;
int loadFlags(QGlyphSet *set, GlyphFormat format, int flags, bool &hsubpixel, int &vfactor) const;
+ bool shouldUseDesignMetrics(ShaperFlags flags) const;
GlyphFormat defaultFormat;
FT_Matrix matrix;