Index: src/core/SkFontHost.cpp |
diff --git a/src/core/SkFontHost.cpp b/src/core/SkFontHost.cpp |
index ce73491c7271e4fdc40a510ecf1f0671a7156eee..77b80e88219e8a26efff200a03101ed18dc126ce 100644 |
--- a/src/core/SkFontHost.cpp |
+++ b/src/core/SkFontHost.cpp |
@@ -67,6 +67,15 @@ SkFontStyle::SkFontStyle(int weight, int width, Slant slant) { |
fUnion.fR.fSlant = SkPin32(slant, kUpright_Slant, kItalic_Slant); |
} |
+SkFontStyle::SkFontStyle(unsigned oldStyle) { |
+ fUnion.fU32 = 0; |
+ fUnion.fR.fWeight = (oldStyle & SkTypeface::kBold) ? SkFontStyle::kBold_Weight |
+ : SkFontStyle::kNormal_Weight; |
+ fUnion.fR.fWidth = SkFontStyle::kNormal_Width; |
+ fUnion.fR.fSlant = (oldStyle & SkTypeface::kItalic) ? SkFontStyle::kItalic_Slant |
+ : SkFontStyle::kUpright_Slant; |
+} |
+ |
#include "SkFontMgr.h" |
class SkEmptyFontStyleSet : public SkFontStyleSet { |