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

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

Issue 691133002: use better heuristic for maxcharwidth (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: set flag in gypi Created 6 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
« no previous file with comments | « no previous file | public/blink_skia_config.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/SimpleFontData.cpp
diff --git a/Source/platform/fonts/SimpleFontData.cpp b/Source/platform/fonts/SimpleFontData.cpp
index 44950c305ad5e2adf082ef45ed3989e9f891a0eb..dca35eba0d1a4d202f30af79356c2d0fc9f74ad4 100644
--- a/Source/platform/fonts/SimpleFontData.cpp
+++ b/Source/platform/fonts/SimpleFontData.cpp
@@ -201,10 +201,10 @@ void SimpleFontData::platformInit()
// https://crbug.com/420901
m_maxCharWidth = std::max(m_avgCharWidth, m_fontMetrics.floatAscent());
#else
- // FIXME: This seems incorrect and should probably use fMaxCharWidth as
- // the code path above.
- SkScalar xRange = metrics.fXMax - metrics.fXMin;
- m_maxCharWidth = SkScalarRoundToInt(xRange * SkScalarRoundToInt(m_platformData.size()));
+ // Better would be to rely on either fMaxCharWidth or fAveCharWidth.
+ // skbug.com/3087
+ m_maxCharWidth = SkScalarRoundToInt(metrics.fXMax - metrics.fXMin);
+
#endif
#if !OS(MACOSX)
« no previous file with comments | « no previous file | public/blink_skia_config.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698