From 27428976e442973a4dd1cf323f555dd2583a3ee9 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 5 Jun 2014 13:53:12 +0200 Subject: 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 --- Source/WebCore/platform/graphics/WidthIterator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source') 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 -- cgit v1.2.1