OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 The Android Open Source Project | 2 * Copyright 2011 The Android Open Source Project |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SKFONTCONFIGPARSER_ANDROID_H_ | 8 #ifndef SKFONTCONFIGPARSER_ANDROID_H_ |
9 #define SKFONTCONFIGPARSER_ANDROID_H_ | 9 #define SKFONTCONFIGPARSER_ANDROID_H_ |
10 | 10 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 enum FontVariants { | 55 enum FontVariants { |
56 kDefault_FontVariant = 0x01, | 56 kDefault_FontVariant = 0x01, |
57 kCompact_FontVariant = 0x02, | 57 kCompact_FontVariant = 0x02, |
58 kElegant_FontVariant = 0x04, | 58 kElegant_FontVariant = 0x04, |
59 kLast_FontVariant = kElegant_FontVariant, | 59 kLast_FontVariant = kElegant_FontVariant, |
60 }; | 60 }; |
61 typedef uint32_t FontVariant; | 61 typedef uint32_t FontVariant; |
62 | 62 |
63 // Must remain trivially movable (can be memmoved). | 63 // Must remain trivially movable (can be memmoved). |
64 struct FontFileInfo { | 64 struct FontFileInfo { |
65 FontFileInfo() : fIndex(0), fWeight(0), fStyle(Style::kAuto) { } | 65 FontFileInfo() : fIndex(0), fWeight(0) { } |
66 | 66 |
67 SkString fFileName; | 67 SkString fFileName; |
68 int fIndex; | 68 int fIndex; |
69 int fWeight; | 69 int fWeight; |
70 enum class Style { kAuto, kNormal, kItalic } fStyle; | |
71 }; | 70 }; |
72 | 71 |
73 /** | 72 /** |
74 * A font family provides one or more names for a collection of fonts, each of | 73 * A font family provides one or more names for a collection of fonts, each of |
75 * which has a different style (normal, italic) or weight (thin, light, bold, | 74 * which has a different style (normal, italic) or weight (thin, light, bold, |
76 * etc). | 75 * etc). |
77 * Some fonts may occur in compact variants for use in the user interface. | 76 * Some fonts may occur in compact variants for use in the user interface. |
78 * Android distinguishes "fallback" fonts to support non-ASCII character sets. | 77 * Android distinguishes "fallback" fonts to support non-ASCII character sets. |
79 */ | 78 */ |
80 struct FontFamily { | 79 struct FontFamily { |
(...skipping 21 matching lines...) Expand all Loading... |
102 /** Parses font configuration files and appends result to fontFamilies. */ | 101 /** Parses font configuration files and appends result to fontFamilies. */ |
103 void GetCustomFontFamilies(SkTDArray<FontFamily*>& fontFamilies, | 102 void GetCustomFontFamilies(SkTDArray<FontFamily*>& fontFamilies, |
104 const SkString& basePath, | 103 const SkString& basePath, |
105 const char* fontsXml, | 104 const char* fontsXml, |
106 const char* fallbackFontsXml, | 105 const char* fallbackFontsXml, |
107 const char* langFallbackFontsDir = NULL); | 106 const char* langFallbackFontsDir = NULL); |
108 | 107 |
109 } // SkFontConfigParser namespace | 108 } // SkFontConfigParser namespace |
110 | 109 |
111 #endif /* SKFONTCONFIGPARSER_ANDROID_H_ */ | 110 #endif /* SKFONTCONFIGPARSER_ANDROID_H_ */ |
OLD | NEW |