summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowsfontengine.cpp
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2012-07-09 16:50:32 +0300
committerQt by Nokia <qt-info@nokia.com>2012-07-10 03:23:41 +0200
commit1db99a6250f96892362f57180b3cccfd09bf7ff4 (patch)
tree69deac3a0fe79053548513c0941d63edb08b72dc /src/plugins/platforms/windows/qwindowsfontengine.cpp
parent84792b5ad5d49013fe31d9cf258e978250d4ed7f (diff)
Move ShaperFlags enum from QTextEngine to QFontEngine
These flags are specific to font engine(s) and has nothing to do with the text engine or the text layout. Change-Id: I4bb793c3c634b3cf0ae0a8a8c23b946fad5874b6 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsfontengine.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowsfontengine.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/plugins/platforms/windows/qwindowsfontengine.cpp b/src/plugins/platforms/windows/qwindowsfontengine.cpp
index eb293c51cd..b3bba55e97 100644
--- a/src/plugins/platforms/windows/qwindowsfontengine.cpp
+++ b/src/plugins/platforms/windows/qwindowsfontengine.cpp
@@ -356,19 +356,18 @@ HGDIOBJ QWindowsFontEngine::selectDesignFont() const
return SelectObject(m_fontEngineData->hdc, designFont);
}
-bool QWindowsFontEngine::stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const
+bool QWindowsFontEngine::stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QFontEngine::ShaperFlags flags) const
{
if (*nglyphs < len) {
*nglyphs = len;
return false;
}
- *nglyphs = getGlyphIndexes(str, len, glyphs, flags & QTextEngine::RightToLeft);
+ *nglyphs = getGlyphIndexes(str, len, glyphs, flags & RightToLeft);
- if (flags & QTextEngine::GlyphIndicesOnly)
- return true;
+ if (!(flags & GlyphIndicesOnly))
+ recalcAdvances(glyphs, flags);
- recalcAdvances(glyphs, flags);
return true;
}
@@ -382,11 +381,11 @@ inline void calculateTTFGlyphWidth(HDC hdc, UINT glyph, int &width)
#endif
}
-void QWindowsFontEngine::recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFlags flags) const
+void QWindowsFontEngine::recalcAdvances(QGlyphLayout *glyphs, QFontEngine::ShaperFlags flags) const
{
HGDIOBJ oldFont = 0;
HDC hdc = m_fontEngineData->hdc;
- if (ttf && (flags & QTextEngine::DesignMetrics)) {
+ if (ttf && (flags & DesignMetrics)) {
for(int i = 0; i < glyphs->numGlyphs; i++) {
unsigned int glyph = glyphs->glyphs[i];
if(int(glyph) >= designAdvancesSize) {