2 * Copyright 2013 Google Inc.
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
8 #ifndef SkFontStyle_DEFINED
9 #define SkFontStyle_DEFINED
13 class SK_API SkFontStyle {
17 kExtraLight_Weight = 200,
21 kSemiBold_Weight = 600,
23 kExtraBold_Weight = 800,
28 kUltraCondensed_Width = 1,
29 kExtraCondensed_Width = 2,
31 kSemiCondensed_Width = 4,
33 kSemiExpanded_Width = 6,
35 kExtraExpanded_Width = 8,
36 kUltaExpanded_Width = 9
45 SkFontStyle(int weight, int width, Slant);
47 bool operator==(const SkFontStyle& rhs) const {
48 return fUnion.fU32 == rhs.fUnion.fU32;
51 int weight() const { return fUnion.fR.fWeight; }
52 int width() const { return fUnion.fR.fWidth; }
53 Slant slant() const { return (Slant)fUnion.fR.fSlant; }
55 bool isItalic() const {
56 return kItalic_Slant == fUnion.fR.fSlant;
62 uint16_t fWeight; // 100 .. 900
63 uint8_t fWidth; // 1 .. 9
64 uint8_t fSlant; // 0 .. 2