Index: third_party/WebKit/Source/core/layout/svg/SVGTextLayoutEngineBaseline.cpp |
diff --git a/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutEngineBaseline.cpp b/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutEngineBaseline.cpp |
index 09ca76898f0e42b3fc0b095b6de492f5903211d0..cc298e984eb08c3281503030a11e438b1bd4ab99 100644 |
--- a/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutEngineBaseline.cpp |
+++ b/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutEngineBaseline.cpp |
@@ -148,87 +148,4 @@ float SVGTextLayoutEngineBaseline::calculateAlignmentBaselineShift(bool isVertic |
} |
} |
-float SVGTextLayoutEngineBaseline::calculateGlyphOrientationAngle(bool isVerticalText, const SVGComputedStyle& style, const UChar32 character) const |
-{ |
- switch (isVerticalText ? style.glyphOrientationVertical() : style.glyphOrientationHorizontal()) { |
- case GO_AUTO: { |
- // Spec: Fullwidth ideographic and fullwidth Latin text will be set with a glyph-orientation of 0-degrees. |
- // Text which is not fullwidth will be set with a glyph-orientation of 90-degrees. |
- if (!Character::isUprightInMixedVertical(character)) |
- return 90; |
- |
- return 0; |
- } |
- case GO_90DEG: |
- return 90; |
- case GO_180DEG: |
- return 180; |
- case GO_270DEG: |
- return 270; |
- case GO_0DEG: |
- default: |
- return 0; |
- } |
-} |
- |
-static inline bool glyphOrientationIsMultiplyOf180Degrees(float orientationAngle) |
-{ |
- return !fabsf(fmodf(orientationAngle, 180)); |
-} |
- |
-float SVGTextLayoutEngineBaseline::calculateGlyphAdvanceAndOrientation(bool isVerticalText, const SVGTextMetrics& metrics, float angle, float& xOrientationShift, float& yOrientationShift) const |
-{ |
- bool orientationIsMultiplyOf180Degrees = glyphOrientationIsMultiplyOf180Degrees(angle); |
- |
- // The function is based on spec requirements: |
- // |
- // Spec: If the 'glyph-orientation-horizontal' results in an orientation angle that is not a multiple of |
- // of 180 degrees, then the current text position is incremented according to the vertical metrics of the glyph. |
- // |
- // Spec: If if the 'glyph-orientation-vertical' results in an orientation angle that is not a multiple of |
- // 180 degrees, then the current text position is incremented according to the horizontal metrics of the glyph. |
- |
- const FontMetrics& fontMetrics = m_font.fontMetrics(); |
- |
- float ascent = fontMetrics.floatAscent() / m_effectiveZoom; |
- float descent = fontMetrics.floatDescent() / m_effectiveZoom; |
- |
- // Vertical orientation handling. |
- if (isVerticalText) { |
- float ascentMinusDescent = ascent - descent; |
- |
- if (!angle) { |
- xOrientationShift = (ascentMinusDescent - metrics.width()) / 2; |
- yOrientationShift = ascent; |
- } else if (angle == 180) { |
- xOrientationShift = (ascentMinusDescent + metrics.width()) / 2; |
- } else if (angle == 270) { |
- yOrientationShift = metrics.width(); |
- xOrientationShift = ascentMinusDescent; |
- } |
- |
- // Vertical advance calculation. |
- if (angle && !orientationIsMultiplyOf180Degrees) |
- return metrics.width(); |
- |
- return metrics.height(); |
- } |
- |
- // Horizontal orientation handling. |
- if (angle == 90) { |
- yOrientationShift = -metrics.width(); |
- } else if (angle == 180) { |
- xOrientationShift = metrics.width(); |
- yOrientationShift = -ascent; |
- } else if (angle == 270) { |
- xOrientationShift = metrics.width(); |
- } |
- |
- // Horizontal advance calculation. |
- if (angle && !orientationIsMultiplyOf180Degrees) |
- return metrics.height(); |
- |
- return metrics.width(); |
-} |
- |
} |