Index: src/ports/SkFontMgr_android.cpp |
diff --git a/src/ports/SkFontMgr_android.cpp b/src/ports/SkFontMgr_android.cpp |
index 15f1d3ed58ba0da153aad7a64504c6908aeedd71..5e93bf8a6208522c600bedca95d02529a3f7f570 100644 |
--- a/src/ports/SkFontMgr_android.cpp |
+++ b/src/ports/SkFontMgr_android.cpp |
@@ -42,7 +42,7 @@ |
class SkTypeface_Android : public SkTypeface_FreeType { |
public: |
SkTypeface_Android(int index, |
- const SkFontStyle& style, |
+ Style style, |
bool isFixedPitch, |
const SkString familyName) |
: INHERITED(style, SkTypefaceCache::NewFontID(), isFixedPitch) |
@@ -65,7 +65,7 @@ |
public: |
SkTypeface_AndroidSystem(const SkString pathName, |
int index, |
- const SkFontStyle& style, |
+ Style style, |
bool isFixedPitch, |
const SkString familyName, |
const SkLanguage& lang, |
@@ -100,7 +100,7 @@ |
public: |
SkTypeface_AndroidStream(SkStream* stream, |
int index, |
- const SkFontStyle& style, |
+ Style style, |
bool isFixedPitch, |
const SkString familyName) |
: INHERITED(index, style, isFixedPitch, familyName) |
@@ -158,7 +158,7 @@ |
const int ttcIndex = fontFile.fIndex; |
SkString familyName; |
- SkFontStyle style; |
+ SkTypeface::Style style; |
bool isFixedWidth; |
if (!SkTypeface_FreeType::ScanFont(stream.get(), ttcIndex, |
&familyName, &style, &isFixedWidth)) { |
@@ -404,7 +404,7 @@ |
virtual SkTypeface* onCreateFromStream(SkStream* stream, int ttcIndex) const SK_OVERRIDE { |
bool isFixedPitch; |
- SkFontStyle style; |
+ SkTypeface::Style style; |
SkString name; |
if (!SkTypeface_FreeType::ScanFont(stream, ttcIndex, &name, &style, &isFixedPitch)) { |
return NULL; |
@@ -416,7 +416,14 @@ |
virtual SkTypeface* onLegacyCreateTypeface(const char familyName[], |
unsigned styleBits) const SK_OVERRIDE { |
- SkFontStyle style = SkFontStyle(styleBits); |
+ SkTypeface::Style oldStyle = (SkTypeface::Style)styleBits; |
+ SkFontStyle style = SkFontStyle(oldStyle & SkTypeface::kBold |
+ ? SkFontStyle::kBold_Weight |
+ : SkFontStyle::kNormal_Weight, |
+ SkFontStyle::kNormal_Width, |
+ oldStyle & SkTypeface::kItalic |
+ ? SkFontStyle::kItalic_Slant |
+ : SkFontStyle::kUpright_Slant); |
if (familyName) { |
// On Android, we must return NULL when we can't find the requested |