#include "core/rendering/style/SVGRenderStyle.h"
#include "core/svg/SVGLengthContext.h"
+#include "platform/fonts/Character.h"
#include "platform/fonts/Font.h"
#if ENABLE(SVG_FONTS)
m_lastGlyph = currentGlyph;
m_lastGlyph.isValid = true;
- kerning *= m_font.size() / m_font.fontMetrics().unitsPerEm();
+ kerning *= m_font.fontDescription().computedSize() / m_font.fontMetrics().unitsPerEm();
return kerning;
#else
return false;
float kerning = 0;
RefPtr<SVGLength> kerningLength = style->kerning();
if (kerningLength->unitType() == LengthTypePercentage)
- kerning = kerningLength->valueAsPercentage() * m_font.pixelSize();
+ kerning = kerningLength->valueAsPercentage() * m_font.fontDescription().computedPixelSize();
else {
SVGLengthContext lengthContext(contextElement);
kerning = kerningLength->value(lengthContext);
UChar lastCharacter = m_lastCharacter;
m_lastCharacter = currentCharacter;
- if (!kerning && !m_font.letterSpacing() && !m_font.wordSpacing())
+ if (!kerning && !m_font.fontDescription().letterSpacing() && !m_font.fontDescription().wordSpacing())
return 0;
- float spacing = m_font.letterSpacing() + kerning;
- if (currentCharacter && lastCharacter && m_font.wordSpacing()) {
- if (Font::treatAsSpace(currentCharacter) && !Font::treatAsSpace(lastCharacter))
- spacing += m_font.wordSpacing();
+ float spacing = m_font.fontDescription().letterSpacing() + kerning;
+ if (currentCharacter && lastCharacter && m_font.fontDescription().wordSpacing()) {
+ if (Character::treatAsSpace(currentCharacter) && !Character::treatAsSpace(lastCharacter))
+ spacing += m_font.fontDescription().wordSpacing();
}
return spacing;