Chromium Code Reviews| Index: Source/platform/fonts/skia/SimpleFontDataSkia.cpp |
| =================================================================== |
| --- Source/platform/fonts/skia/SimpleFontDataSkia.cpp (revision 173391) |
| +++ Source/platform/fonts/skia/SimpleFontDataSkia.cpp (working copy) |
| @@ -131,12 +131,13 @@ |
| m_fontMetrics.setLineGap(lineGap); |
| m_fontMetrics.setLineSpacing(lroundf(ascent) + lroundf(descent) + lroundf(lineGap)); |
| - float underlineThickness = SkScalarToFloat(metrics.fUnderlineThickness); |
| - m_fontMetrics.setUnderlineThickness(underlineThickness); |
| + SkScalar underlineThickness, underlinePosition; |
| + if (metrics.hasUnderlineThickness(&underlineThickness) |
| + && metrics.hasUnderlinePosition(&underlinePosition)) { |
|
reed1
2014/05/12 12:34:12
nit: not sure you need the LF
|
| + m_fontMetrics.setUnderlineThickness(SkScalarToFloat(underlineThickness)); |
| + m_fontMetrics.setUnderlinePosition(SkScalarToFloat(-underlinePosition)); |
| + } |
| - float underlinePosition = SkScalarToFloat(metrics.fUnderlinePosition); |
| - m_fontMetrics.setUnderlineThickness(underlinePosition); |
| - |
| if (platformData().orientation() == Vertical && !isTextOrientationFallback()) { |
| static const uint32_t vheaTag = SkSetFourByteTag('v', 'h', 'e', 'a'); |
| static const uint32_t vorgTag = SkSetFourByteTag('V', 'O', 'R', 'G'); |