We will fallback to box engine when no usable font is available,
and QRawFont (which scenegraph depends on) won't allocate glyph
index array on certain occasions. In those cases, QFontEngineBox
needs to support GlyphIndicesOnly flag.
Change-Id: I408ddd1b2f1a5f7ac2b6681cb7bf531bbbfc68e6
Reviewed-on: http://codereview.qt-project.org/6360
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
{
}
-bool QFontEngineBox::stringToCMap(const QChar *, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags) const
+bool QFontEngineBox::stringToCMap(const QChar *, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const
{
if (*nglyphs < len) {
*nglyphs = len;
for (int i = 0; i < len; i++) {
glyphs->glyphs[i] = 0;
- glyphs->advances_x[i] = _size;
- glyphs->advances_y[i] = 0;
+ if (!(flags & QTextEngine::GlyphIndicesOnly)) {
+ glyphs->advances_x[i] = _size;
+ glyphs->advances_y[i] = 0;
+ }
}
*nglyphs = len;