Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(672)

Unified Diff: Source/core/rendering/svg/SVGTextLayoutEngineSpacing.cpp

Issue 656913006: Remove SVG fonts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update tests for landing Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/rendering/svg/SVGTextLayoutEngineSpacing.cpp
diff --git a/Source/core/rendering/svg/SVGTextLayoutEngineSpacing.cpp b/Source/core/rendering/svg/SVGTextLayoutEngineSpacing.cpp
index 5fcb4996fd861c268d3a7af1f1f6e1d04b35cfde..d42df58652631a27a93ca0d6d7b5c07c553e6b93 100644
--- a/Source/core/rendering/svg/SVGTextLayoutEngineSpacing.cpp
+++ b/Source/core/rendering/svg/SVGTextLayoutEngineSpacing.cpp
@@ -25,64 +25,16 @@
#include "platform/fonts/Character.h"
#include "platform/fonts/Font.h"
-#if ENABLE(SVG_FONTS)
-#include "core/svg/SVGFontData.h"
-#include "core/svg/SVGFontElement.h"
-#include "core/svg/SVGFontFaceElement.h"
-#endif
-
namespace blink {
SVGTextLayoutEngineSpacing::SVGTextLayoutEngineSpacing(const Font& font, float effectiveZoom)
: m_font(font)
, m_lastCharacter(0)
, m_effectiveZoom(effectiveZoom)
-#if ENABLE(SVG_FONTS)
- , m_lastGlyph(0)
-#endif
{
ASSERT(m_effectiveZoom);
}
-float SVGTextLayoutEngineSpacing::calculateSVGKerning(bool isVerticalText, Glyph currentGlyph)
-{
-#if ENABLE(SVG_FONTS)
- const SimpleFontData* fontData = m_font.primaryFont();
- if (!fontData->isSVGFont()) {
- m_lastGlyph = 0;
- return 0;
- }
-
- ASSERT(fontData->isCustomFont());
- ASSERT(fontData->isSVGFont());
-
- RefPtr<CustomFontData> customFontData = fontData->customFontData();
- SVGFontFaceElement* svgFontFace = toSVGFontData(customFontData)->svgFontFaceElement();
- ASSERT(svgFontFace);
-
- SVGFontElement* svgFont = svgFontFace->associatedFontElement();
- if (!svgFont) {
- m_lastGlyph = 0;
- return 0;
- }
-
- float kerning = 0;
- if (m_lastGlyph) {
- if (isVerticalText)
- kerning = svgFont->verticalKerningForPairOfGlyphs(m_lastGlyph, currentGlyph);
- else
- kerning = svgFont->horizontalKerningForPairOfGlyphs(m_lastGlyph, currentGlyph);
-
- kerning *= m_font.fontDescription().computedSize() / m_font.fontMetrics().unitsPerEm();
- }
-
- m_lastGlyph = currentGlyph;
- return kerning;
-#else
- return 0;
-#endif
-}
-
float SVGTextLayoutEngineSpacing::calculateCSSSpacing(UChar currentCharacter)
{
UChar lastCharacter = m_lastCharacter;

Powered by Google App Engine
This is Rietveld 408576698