summaryrefslogtreecommitdiffstats
path: root/WebCore/rendering/SVGRootInlineBox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/rendering/SVGRootInlineBox.cpp')
-rw-r--r--WebCore/rendering/SVGRootInlineBox.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/WebCore/rendering/SVGRootInlineBox.cpp b/WebCore/rendering/SVGRootInlineBox.cpp
index 03b9db4..89b4375 100644
--- a/WebCore/rendering/SVGRootInlineBox.cpp
+++ b/WebCore/rendering/SVGRootInlineBox.cpp
@@ -28,9 +28,11 @@
#include "SVGRootInlineBox.h"
#include "Editor.h"
+#include "FloatConversion.h"
#include "Frame.h"
#include "GraphicsContext.h"
#include "RenderBlock.h"
+#include "RenderSVGResourceFilter.h"
#include "RenderSVGRoot.h"
#include "SVGInlineFlowBox.h"
#include "SVGInlineTextBox.h"
@@ -38,7 +40,6 @@
#include "SVGPaintServer.h"
#include "SVGRenderStyleDefs.h"
#include "SVGRenderSupport.h"
-#include "SVGResourceFilter.h"
#include "SVGTextPositioningElement.h"
#include "SVGURIReference.h"
#include "Text.h"
@@ -336,7 +337,7 @@ static float calculateKerning(RenderObject* item)
// Helper class for paint()
struct SVGRootInlineBoxPaintWalker {
- SVGRootInlineBoxPaintWalker(SVGRootInlineBox* rootBox, SVGResourceFilter* rootFilter, RenderObject::PaintInfo paintInfo, int tx, int ty)
+ SVGRootInlineBoxPaintWalker(SVGRootInlineBox* rootBox, RenderSVGResourceFilter* rootFilter, RenderObject::PaintInfo paintInfo, int tx, int ty)
: m_rootBox(rootBox)
, m_chunkStarted(false)
, m_paintInfo(paintInfo)
@@ -668,8 +669,8 @@ private:
RenderObject::PaintInfo m_savedInfo;
FloatRect m_boundingBox;
- SVGResourceFilter* m_filter;
- SVGResourceFilter* m_rootFilter;
+ RenderSVGResourceFilter* m_filter;
+ RenderSVGResourceFilter* m_rootFilter;
SVGPaintServer* m_fillPaintServer;
SVGPaintServer* m_strokePaintServer;
@@ -691,7 +692,7 @@ void SVGRootInlineBox::paint(RenderObject::PaintInfo& paintInfo, int tx, int ty)
RenderObject::PaintInfo savedInfo(paintInfo);
paintInfo.context->save();
- SVGResourceFilter* filter = 0;
+ RenderSVGResourceFilter* filter = 0;
FloatRect boundingBox(tx + x(), ty + y(), width(), height());
// Initialize text rendering
@@ -1413,7 +1414,7 @@ void SVGRootInlineBox::buildLayoutInformationForTextBox(SVGCharacterLayoutInfo&
}
}
- double kerning = 0.0;
+ float kerning = 0.0f;
#if ENABLE(SVG_FONTS)
SVGFontElement* svgFont = 0;
if (style->font().isSVGFont())
@@ -1422,25 +1423,26 @@ void SVGRootInlineBox::buildLayoutInformationForTextBox(SVGCharacterLayoutInfo&
if (lastGlyph.isValid && style->font().isSVGFont()) {
SVGHorizontalKerningPair kerningPair;
if (svgFont->getHorizontalKerningPairForStringsAndGlyphs(lastGlyph.unicode, lastGlyph.glyphName, unicodeStr, glyphName, kerningPair))
- kerning = kerningPair.kerning;
+ kerning = narrowPrecisionToFloat(kerningPair.kerning);
}
if (style->font().isSVGFont()) {
lastGlyph.unicode = unicodeStr;
lastGlyph.glyphName = glyphName;
lastGlyph.isValid = true;
+ kerning *= style->font().size() / style->font().primaryFont()->unitsPerEm();
} else
lastGlyph.isValid = false;
#endif
- svgChar.x -= (float)kerning;
+ svgChar.x -= kerning;
// Advance to new position
if (isVerticalText) {
svgChar.drawnSeperated = true;
info.cury += glyphAdvance + spacing;
} else
- info.curx += glyphAdvance + spacing - (float)kerning;
+ info.curx += glyphAdvance + spacing - kerning;
// Advance to next character group
for (int k = 0; k < charsConsumed; ++k) {