| 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 "SkString.h" | 11 #include "SkString.h" |
| 12 #include "SkTDArray.h" | 12 #include "SkTDArray.h" |
| 13 | 13 |
| 14 /** \class SkLanguage | 14 /** \class SkLanguage |
| 15 | 15 |
| 16 The SkLanguage class represents a human written language, and is used by | 16 The SkLanguage class represents a human written language, and is used by |
| 17 text draw operations to determine which glyph to draw when drawing | 17 text draw operations to determine which glyph to draw when drawing |
| 18 characters with variants (ie Han-derived characters). | 18 characters with variants (ie Han-derived characters). |
| 19 */ | 19 */ |
| 20 class SkLanguage { | 20 class SkLanguage { |
| 21 public: | 21 public: |
| 22 SkLanguage() { } | 22 SkLanguage() { } |
| 23 SkLanguage(const SkString& tag) : fTag(tag) { } | 23 SkLanguage(const SkString& tag) : fTag(tag) { } |
| 24 SkLanguage(const char* tag) : fTag(tag) { } | 24 SkLanguage(const char* tag) : fTag(tag) { } |
| 25 SkLanguage(const char* tag, size_t len) : fTag(tag, len) { } | 25 SkLanguage(const char* tag, size_t len) : fTag(tag, len) { } |
| 26 SkLanguage(const SkLanguage& b) : fTag(b.fTag) { } | 26 SkLanguage(const SkLanguage& b) : fTag(b.fTag) { } |
| 27 | 27 |
| 28 void set(const SkString& tag) { fTag.set(tag); } |
| 29 void set(const char text[]) { fTag.set(text); } |
| 30 void set(const char text[], size_t len) { fTag.set(text, len); } |
| 31 |
| 28 /** Gets a BCP 47 language identifier for this SkLanguage. | 32 /** Gets a BCP 47 language identifier for this SkLanguage. |
| 29 @return a BCP 47 language identifier representing this language | 33 @return a BCP 47 language identifier representing this language |
| 30 */ | 34 */ |
| 31 const SkString& getTag() const { return fTag; } | 35 const SkString& getTag() const { return fTag; } |
| 32 | 36 |
| 33 /** Performs BCP 47 fallback to return an SkLanguage one step more general. | 37 /** Performs BCP 47 fallback to return an SkLanguage one step more general. |
| 34 @return an SkLanguage one step more general | 38 @return an SkLanguage one step more general |
| 35 */ | 39 */ |
| 36 SkLanguage getParent() const; | 40 SkLanguage getParent() const; |
| 37 | 41 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 * Parses all test font configuration files and returns the results in an | 104 * Parses all test font configuration files and returns the results in an |
| 101 * array of FontFamily structures. | 105 * array of FontFamily structures. |
| 102 */ | 106 */ |
| 103 void GetTestFontFamilies(SkTDArray<FontFamily*> &fontFamilies, | 107 void GetTestFontFamilies(SkTDArray<FontFamily*> &fontFamilies, |
| 104 const char* testMainConfigFile, | 108 const char* testMainConfigFile, |
| 105 const char* testFallbackConfigFile); | 109 const char* testFallbackConfigFile); |
| 106 | 110 |
| 107 } // SkFontConfigParser namespace | 111 } // SkFontConfigParser namespace |
| 108 | 112 |
| 109 #endif /* SKFONTCONFIGPARSER_ANDROID_H_ */ | 113 #endif /* SKFONTCONFIGPARSER_ANDROID_H_ */ |
| OLD | NEW |