Commit 673dd5df authored by krit@webkit.org's avatar krit@webkit.org
Browse files

2009-03-18 Dirk Schulze <krit@webkit.org>

        Reviewed by Holger Freyther.

        Added support for SVG's stroked texts to Qt.

        [Qt] SVGs stroked text support missing
        https://bugs.webkit.org/show_bug.cgi?id=24262

        * platform/graphics/qt/FontQt.cpp:
        (WebCore::Font::drawComplexText):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@41808 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent f24d9e6d
2009-03-18 Dirk Schulze <krit@webkit.org>
Reviewed by Holger Freyther.
Added support for SVG's stroked texts to Qt.
[Qt] SVGs stroked text support missing
https://bugs.webkit.org/show_bug.cgi?id=24262
* platform/graphics/qt/FontQt.cpp:
(WebCore::Font::drawComplexText):
2009-03-18 Mark Rowe <mrowe@apple.com>
 
Reviewed by Alexey Proskuryakov.
......@@ -104,12 +104,12 @@ void Font::drawComplexText(GraphicsContext* ctx, const TextRun& run, const Float
if (ctx->strokeGradient()) {
QBrush brush(*ctx->strokeGradient()->platformGradient());
brush.setTransform(ctx->strokeGradient()->gradientSpaceTransform());
p->setPen(QPen(brush, 0));
p->setPen(QPen(brush, ctx->strokeThickness()));
} else if (ctx->strokePattern()) {
TransformationMatrix affine;
p->setPen(QPen(QBrush(ctx->strokePattern()->createPlatformPattern(affine)), 0));
p->setPen(QPen(QBrush(ctx->strokePattern()->createPlatformPattern(affine)), ctx->strokeThickness()));
} else
p->setPen(QColor(ctx->strokeColor()));
p->setPen(QPen(QColor(ctx->strokeColor()), ctx->strokeThickness()));
}
const QString string = fixSpacing(qstring(run));
......@@ -174,7 +174,13 @@ void Font::drawComplexText(GraphicsContext* ctx, const TextRun& run, const Float
p->drawText(pt, string, flags, run.padding());
p->restore();
}
p->drawText(pt, string, flags, run.padding());
if (ctx->textDrawingMode() & cTextStroke) {
QPainterPath path;
path.addText(pt, font(), string);
p->strokePath(path, p->pen());
}
if (ctx->textDrawingMode() & cTextFill)
p->drawText(pt, string, flags, run.padding());
}
float Font::floatWidthForComplexText(const TextRun& run) const
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment