From dcc8cf2e65d1aa555cce12431a16547e66b469ee Mon Sep 17 00:00:00 2001 From: Steve Block Date: Tue, 27 Apr 2010 16:31:00 +0100 Subject: Merge webkit.org at r58033 : Initial merge by git Change-Id: If006c38561af287c50cd578d251629b51e4d8cd1 --- WebCore/svg/SVGFont.cpp | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'WebCore/svg/SVGFont.cpp') diff --git a/WebCore/svg/SVGFont.cpp b/WebCore/svg/SVGFont.cpp index b7ca5f2..dacbac2 100644 --- a/WebCore/svg/SVGFont.cpp +++ b/WebCore/svg/SVGFont.cpp @@ -1,5 +1,6 @@ /** * Copyright (C) 2007, 2008 Nikolas Zimmermann + * Copyright (C) Research In Motion Limited 2010. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -528,22 +529,16 @@ void Font::drawTextUsingSVGFont(GraphicsContext* context, const TextRun& run, glyphOrigin.setY(identifier.verticalOriginY * scale); } - context->translate(xStartOffset + currentPoint.x() + glyphOrigin.x(), currentPoint.y() + glyphOrigin.y()); - context->scale(FloatSize(scale, -scale)); + AffineTransform glyphPathTransform; + glyphPathTransform.translate(xStartOffset + currentPoint.x() + glyphOrigin.x(), currentPoint.y() + glyphOrigin.y()); + glyphPathTransform.scale(scale, -scale); - context->beginPath(); - context->addPath(identifier.pathData); + Path glyphPath = identifier.pathData; + glyphPath.transform(glyphPathTransform); - // FIXME: setup() tries to get objectBoundingBox() from run.referencingRenderObject() - // which is wrong. We need to change setup() to take a bounding box instead, or pass - // a RenderObject which would return the bounding box for identifier.pathData + context->beginPath(); + context->addPath(glyphPath); if (activePaintServer->setup(context, run.referencingRenderObject(), targetType)) { - // Spec: Any properties specified on a text elements which represents a length, such as the - // 'stroke-width' property, might produce surprising results since the length value will be - // processed in the coordinate system of the glyph. (TODO: What other lengths? miter-limit? dash-offset?) - if (targetType == ApplyToStrokeTargetType && scale != 0.0f) - context->setStrokeThickness(context->strokeThickness() / scale); - activePaintServer->renderPath(context, run.referencingRenderObject(), targetType); activePaintServer->teardown(context, run.referencingRenderObject(), targetType); } -- cgit v1.1