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

Unified Diff: third_party/WebKit/Source/platform/fonts/skia/SimpleFontDataSkia.cpp

Issue 280003002: Fix underline position. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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
« no previous file with comments | « no previous file | third_party/skia/src/ports/SkFontHost_FreeType.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/fonts/skia/SimpleFontDataSkia.cpp
===================================================================
--- third_party/WebKit/Source/platform/fonts/skia/SimpleFontDataSkia.cpp (revision 173391)
+++ third_party/WebKit/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)) {
+ 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');
« no previous file with comments | « no previous file | third_party/skia/src/ports/SkFontHost_FreeType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698