| 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 |
| 11 #include "SkFontMgr_android.h" | 11 #include "SkFontMgr_android.h" |
| 12 #include "SkString.h" | 12 #include "SkString.h" |
| 13 #include "SkTDArray.h" | 13 #include "SkTDArray.h" |
| 14 #include "SkFontStyle.h" |
| 14 | 15 |
| 15 /** \class SkLanguage | 16 /** \class SkLanguage |
| 16 | 17 |
| 17 The SkLanguage class represents a human written language, and is used by | 18 The SkLanguage class represents a human written language, and is used by |
| 18 text draw operations to determine which glyph to draw when drawing | 19 text draw operations to determine which glyph to draw when drawing |
| 19 characters with variants (ie Han-derived characters). | 20 characters with variants (ie Han-derived characters). |
| 20 */ | 21 */ |
| 21 class SkLanguage { | 22 class SkLanguage { |
| 22 public: | 23 public: |
| 23 SkLanguage() { } | 24 SkLanguage() { } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 typedef uint32_t FontVariant; | 62 typedef uint32_t FontVariant; |
| 62 | 63 |
| 63 // Must remain trivially movable (can be memmoved). | 64 // Must remain trivially movable (can be memmoved). |
| 64 struct FontFileInfo { | 65 struct FontFileInfo { |
| 65 FontFileInfo() : fIndex(0), fWeight(0), fStyle(Style::kAuto) { } | 66 FontFileInfo() : fIndex(0), fWeight(0), fStyle(Style::kAuto) { } |
| 66 | 67 |
| 67 SkString fFileName; | 68 SkString fFileName; |
| 68 int fIndex; | 69 int fIndex; |
| 69 int fWeight; | 70 int fWeight; |
| 70 enum class Style { kAuto, kNormal, kItalic } fStyle; | 71 enum class Style { kAuto, kNormal, kItalic } fStyle; |
| 72 SkTArray<SkFontStyle::Axis, true> fAxes; |
| 71 }; | 73 }; |
| 72 | 74 |
| 73 /** | 75 /** |
| 74 * A font family provides one or more names for a collection of fonts, each of | 76 * 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, | 77 * which has a different style (normal, italic) or weight (thin, light, bold, |
| 76 * etc). | 78 * etc). |
| 77 * Some fonts may occur in compact variants for use in the user interface. | 79 * Some fonts may occur in compact variants for use in the user interface. |
| 78 * Android distinguishes "fallback" fonts to support non-ASCII character sets. | 80 * Android distinguishes "fallback" fonts to support non-ASCII character sets. |
| 79 */ | 81 */ |
| 80 struct FontFamily { | 82 struct FontFamily { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 102 /** Parses font configuration files and appends result to fontFamilies. */ | 104 /** Parses font configuration files and appends result to fontFamilies. */ |
| 103 void GetCustomFontFamilies(SkTDArray<FontFamily*>& fontFamilies, | 105 void GetCustomFontFamilies(SkTDArray<FontFamily*>& fontFamilies, |
| 104 const SkString& basePath, | 106 const SkString& basePath, |
| 105 const char* fontsXml, | 107 const char* fontsXml, |
| 106 const char* fallbackFontsXml, | 108 const char* fallbackFontsXml, |
| 107 const char* langFallbackFontsDir = NULL); | 109 const char* langFallbackFontsDir = NULL); |
| 108 | 110 |
| 109 } // SkFontConfigParser namespace | 111 } // SkFontConfigParser namespace |
| 110 | 112 |
| 111 #endif /* SKFONTCONFIGPARSER_ANDROID_H_ */ | 113 #endif /* SKFONTCONFIGPARSER_ANDROID_H_ */ |
| OLD | NEW |