| Index: skia/ext/SkFontHost_fontconfig_direct.cpp
|
| diff --git a/skia/ext/SkFontHost_fontconfig_direct.cpp b/skia/ext/SkFontHost_fontconfig_direct.cpp
|
| index dc20afffc51c6b4b98215e3073ad8c2e7bd9f9ff..8c89d551e9bf4e9b7de9980e06d322ac942eb4ec 100644
|
| --- a/skia/ext/SkFontHost_fontconfig_direct.cpp
|
| +++ b/skia/ext/SkFontHost_fontconfig_direct.cpp
|
| @@ -179,10 +179,17 @@ bool FontConfigDirect::Match(std::string* result_family,
|
| if (FcPatternGetInteger(match, FC_SLANT, 0, &resulting_italic))
|
| resulting_italic = FC_SLANT_ROMAN;
|
|
|
| + // If we ask for an italic font, fontconfig might take a roman font and set
|
| + // the undocumented property FC_MATRIX to a skew matrix. It'll then say
|
| + // that the font is italic or oblique. So, if we see a matrix, we don't
|
| + // believe that it's italic.
|
| + FcValue matrix;
|
| + const bool have_matrix = FcPatternGet(match, FC_MATRIX, 0, &matrix) == 0;
|
| +
|
| if (is_bold)
|
| *is_bold = resulting_bold >= FC_WEIGHT_BOLD;
|
| if (is_italic)
|
| - *is_italic = resulting_italic == FC_SLANT_ITALIC;
|
| + *is_italic = resulting_italic > FC_SLANT_ROMAN && !have_matrix;
|
|
|
| if (result_family)
|
| *result_family = (char *) c_family;
|
|
|