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

Unified Diff: third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp

Issue 2392033002: Correcting text baseline for tiny fonts (Closed)
Patch Set: Rebaseline. Created 4 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: third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp b/third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp
index ec4db7a45e1e83a10db17dfc2517cdcb22b0c53e..8b0ec7eb33a3cf77994579565964f3b9afd9f515 100644
--- a/third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp
+++ b/third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp
@@ -131,14 +131,15 @@ void SimpleFontData::platformInit() {
float descent;
// Beware those who step here: This code is designed to match Win32 font
- // metrics *exactly* (except the adjustment of ascent/descent on
- // Linux/Android).
+ // metrics *exactly* except:
+ // - the adjustment of ascent/descent on Linux/Android
+ // - metrics.fAscent and metrics.fDesscent are not rounded to int
if (isVDMXValid) {
ascent = vdmxAscent;
descent = -vdmxDescent;
} else {
- ascent = SkScalarRoundToInt(-metrics.fAscent);
- descent = SkScalarRoundToInt(metrics.fDescent);
+ ascent = -metrics.fAscent;
+ descent = metrics.fDescent;
#if OS(LINUX) || OS(ANDROID)
// When subpixel positioning is enabled, if the descent is rounded down, the
// descent part of the glyph may be truncated when displayed in a 'overflow:

Powered by Google App Engine
This is Rietveld 408576698