diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2014-06-05 13:53:12 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-06-05 22:12:50 +0200 |
commit | 27428976e442973a4dd1cf323f555dd2583a3ee9 (patch) | |
tree | 6ae5f7e73092d871d2db2508118f7f1e31b573c0 | |
parent | 9e99dad77b3e885e5c5a1622ba12fbc947984250 (diff) | |
download | qtwebkit-27428976e442973a4dd1cf323f555dd2583a3ee9.tar.gz |
Do not crash or assert on SVG font fallbacks
Fonts falling back to SVG fonts may not have a rendering context, so
just skip kerning in this case.
Task-number: QTBUG-38356
Change-Id: I9d1473bbb8517bfae927e7b020a9c2102c6497b4
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
-rw-r--r-- | Source/WebCore/platform/graphics/WidthIterator.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/WebCore/platform/graphics/WidthIterator.cpp b/Source/WebCore/platform/graphics/WidthIterator.cpp index e8b620f8a..48a59a27c 100644 --- a/Source/WebCore/platform/graphics/WidthIterator.cpp +++ b/Source/WebCore/platform/graphics/WidthIterator.cpp @@ -124,9 +124,9 @@ static inline float applyFontTransforms(GlyphBuffer* glyphBuffer, bool ltr, int& #if ENABLE(SVG_FONTS) // We need to handle transforms on SVG fonts internally, since they are rendered internally. if (fontData->isSVGFont()) { - ASSERT(iterator.run().renderingContext()); + // SVG font fallbacks doesn't work properly and will not have a renderingContext. see: textRunNeedsRenderingContext() // SVG font ligatures are handled during glyph selection, only kerning remaining. - if (typesettingFeatures & Kerning) + if (iterator.run().renderingContext() && (typesettingFeatures & Kerning)) iterator.run().renderingContext()->applySVGKerning(fontData, iterator, glyphBuffer, lastGlyphCount); } else #endif |