Provide last resort for fCapHeight in SkFontHost_FreeType::onGetAdvancedTypefaceMetrics.
This was a pre-existing issue, but r12689 uncovered it in more cases. Since there was no last resort, fonts without a cap height used uninitialized data as their cap height here. R=robertphillips@google.com Review URL: https://codereview.chromium.org/114773004 git-svn-id: http://skia.googlecode.com/svn/trunk@12779 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
a6ecbb8414
commit
12bd4a0147
@ -602,6 +602,9 @@ SkAdvancedTypefaceMetrics* SkTypeface_FreeType::onGetAdvancedTypefaceMetrics(
|
||||
info->fCapHeight = m_bbox.yMax - m_bbox.yMin;
|
||||
} else if (!got_m && got_x) {
|
||||
info->fCapHeight = x_bbox.yMax - x_bbox.yMin;
|
||||
} else {
|
||||
// Last resort, use the ascent.
|
||||
info->fCapHeight = info->fAscent;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user