| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
| 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 | 8 |
| 9 #ifndef SkTypeface_android_DEFINED | 9 #ifndef SkTypeface_android_DEFINED |
| 10 #define SkTypeface_android_DEFINED | 10 #define SkTypeface_android_DEFINED |
| 11 | 11 |
| 12 #include "SkTypeface.h" | 12 #include "SkTypeface.h" |
| 13 | 13 |
| 14 #ifdef SK_BUILD_FOR_ANDROID | 14 #ifdef SK_BUILD_FOR_ANDROID |
| 15 | 15 |
| 16 class SkPaintOptionsAndroid; | |
| 17 | |
| 18 /** | |
| 19 * Get the family name of the font in the fallback font list containing | |
| 20 * the specified character taking into account the provided language. This | |
| 21 * function also assumes the only families with the elegant or default variants | |
| 22 * will be returned. | |
| 23 * | |
| 24 * @param uni The unicode character to use for the lookup. | |
| 25 * @param lang The null terminated string representing the BCP 47 language | |
| 26 * identifier for the preferred language. If there is no unique | |
| 27 * fallback chain for that language the system's default language | |
| 28 * will be used. | |
| 29 * @param name The family name of the font file containing the unicode characte
r | |
| 30 * in the preferred language | |
| 31 * @return true if a font is found and false otherwise | |
| 32 */ | |
| 33 SK_API bool SkGetFallbackFamilyNameForChar(SkUnichar uni, const char* lang, SkSt
ring* name); | |
| 34 | |
| 35 /** | 16 /** |
| 36 * For test only. | 17 * For test only. |
| 37 * Load font config from given xml files, instead of those from Android system. | 18 * Load font config from given xml files, instead of those from Android system. |
| 38 */ | 19 */ |
| 39 SK_API void SkUseTestFontConfigFile(const char* mainconf, const char* fallbackco
nf, | 20 SK_API void SkUseTestFontConfigFile(const char* mainconf, const char* fallbackco
nf, |
| 40 const char* fontsdir); | 21 const char* fontsdir); |
| 41 | 22 |
| 42 /** | 23 /** |
| 43 * For test only. | 24 * For test only. |
| 44 * Returns the information set by SkUseTestFontConfigFile. | 25 * Returns the information set by SkUseTestFontConfigFile. |
| 45 * TODO: this should be removed once SkFontConfigInterface_android is removed, | 26 * TODO: this should be removed once SkFontConfigInterface_android is removed, |
| 46 * and then Chromium should be given a better way to set up it's test environme
nt | 27 * and then Chromium should be given a better way to set up it's test environme
nt |
| 47 * than SkUseTestFontConfigFile. | 28 * than SkUseTestFontConfigFile. |
| 48 */ | 29 */ |
| 49 void SkGetTestFontConfiguration(const char** mainconf, const char** fallbackconf
, | 30 void SkGetTestFontConfiguration(const char** mainconf, const char** fallbackconf
, |
| 50 const char** fontsdir); | 31 const char** fontsdir); |
| 51 | 32 |
| 52 #endif // #ifdef SK_BUILD_FOR_ANDROID | 33 #endif // #ifdef SK_BUILD_FOR_ANDROID |
| 53 #endif // #ifndef SkTypeface_android_DEFINED | 34 #endif // #ifndef SkTypeface_android_DEFINED |
| OLD | NEW |