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()
// 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)
......
......@@ -11,6 +11,7 @@
# AFTER the flag has been removed from skia.gyp in Chromium.
'blink_skia_defines': [
'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