Commit e186eafc authored by bungeman@chromium.org's avatar bungeman@chromium.org

Use better heuristic for maxcharwidth.

Related skia change:
https://codereview.chromium.org/692083002/

BUG=420901

Review URL: https://codereview.chromium.org/718673004

git-svn-id: svn://svn.chromium.org/blink/trunk@185157 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 0ba56873
...@@ -201,10 +201,10 @@ void SimpleFontData::platformInit() ...@@ -201,10 +201,10 @@ void SimpleFontData::platformInit()
// https://crbug.com/420901 // https://crbug.com/420901
m_maxCharWidth = std::max(m_avgCharWidth, m_fontMetrics.floatAscent()); m_maxCharWidth = std::max(m_avgCharWidth, m_fontMetrics.floatAscent());
#else #else
// FIXME: This seems incorrect and should probably use fMaxCharWidth as // Better would be to rely on either fMaxCharWidth or fAveCharWidth.
// the code path above. // skbug.com/3087
SkScalar xRange = metrics.fXMax - metrics.fXMin; m_maxCharWidth = SkScalarRoundToInt(metrics.fXMax - metrics.fXMin);
m_maxCharWidth = SkScalarRoundToInt(xRange * SkScalarRoundToInt(m_platformData.size()));
#endif #endif
#if !OS(MACOSX) #if !OS(MACOSX)
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
# AFTER the flag has been removed from skia.gyp in Chromium. # AFTER the flag has been removed from skia.gyp in Chromium.
'blink_skia_defines': [ 'blink_skia_defines': [
'SK_FM_NEW_MATCH_FAMILY_STYLE_CHARACTER=1', 'SK_FM_NEW_MATCH_FAMILY_STYLE_CHARACTER=1',
'SK_USE_SCALED_FONTMETRICS',
], ],
}, },
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment