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; | 16 class SkPaintOptionsAndroid; |
17 | 17 |
18 /** | 18 /** |
19 * Get the family name of the font in the fallback font list containing | 19 * Get the family name of the font in the fallback font list containing |
20 * the specified character. if no font is found, returns false. | 20 * the specified character using the system's default language. |
21 * | |
22 * @param uni The unicode character to use for the lookup. | |
23 * @param name The family name of the font file containing the unicode characte r | |
24 * in the default language | |
25 * @return true if a font is found and false otherwise | |
21 */ | 26 */ |
22 SK_API bool SkGetFallbackFamilyNameForChar(SkUnichar uni, SkString* name); | 27 SK_API bool SkGetFallbackFamilyNameForChar(SkUnichar uni, SkString* name); |
23 | 28 |
24 /** | 29 /** |
30 * Get the family name of the font in the fallback font list containing | |
31 * the specified character taking into account the provided language. | |
32 * | |
33 * @param uni The unicode character to use for the lookup. | |
34 * @param lang The BCP 47 language identifier for the preferred language | |
35 * @param name The family name of the font file containing the unicode characte r | |
36 * in the preferred language | |
37 * @return true if a font is found and false otherwise | |
38 */ | |
39 SK_API bool SkGetFallbackFamilyNameForChar(SkUnichar uni, const SkString& lang, SkString* name); | |
reed1
2013/09/17 15:33:48
usually we just use const char lang[] for input st
| |
40 | |
41 /** | |
25 * For test only. | 42 * For test only. |
26 * Load font config from given xml files, instead of those from Android system. | 43 * Load font config from given xml files, instead of those from Android system. |
27 */ | 44 */ |
28 SK_API void SkUseTestFontConfigFile(const char* mainconf, const char* fallbackco nf, | 45 SK_API void SkUseTestFontConfigFile(const char* mainconf, const char* fallbackco nf, |
29 const char* fontsdir); | 46 const char* fontsdir); |
30 | 47 |
31 /** | 48 /** |
32 * Given a "current" fontID, return a ref to the next logical typeface | 49 * Given a "current" fontID, return a ref to the next logical typeface |
33 * when searching fonts for a given unicode value. Typically the caller | 50 * when searching fonts for a given unicode value. Typically the caller |
34 * will query a given font, and if a unicode value is not supported, they | 51 * will query a given font, and if a unicode value is not supported, they |
(...skipping 28 matching lines...) Expand all Loading... | |
63 * unref() when they are done. | 80 * unref() when they are done. |
64 */ | 81 */ |
65 SK_API SkTypeface* SkCreateTypefaceForScriptNG(hb_script_t script, SkTypeface::S tyle style, | 82 SK_API SkTypeface* SkCreateTypefaceForScriptNG(hb_script_t script, SkTypeface::S tyle style, |
66 SkPaintOptionsAndroid::FontVariant fontVariant = SkPaintOptionsAndroid:: kDefault_Variant); | 83 SkPaintOptionsAndroid::FontVariant fontVariant = SkPaintOptionsAndroid:: kDefault_Variant); |
67 | 84 |
68 SK_API SkTypeface* SkCreateTypefaceForScript(HB_Script script, SkTypeface::Style style, | 85 SK_API SkTypeface* SkCreateTypefaceForScript(HB_Script script, SkTypeface::Style style, |
69 SkPaintOptionsAndroid::FontVariant fontVariant = SkPaintOptionsAndroid:: kDefault_Variant); | 86 SkPaintOptionsAndroid::FontVariant fontVariant = SkPaintOptionsAndroid:: kDefault_Variant); |
70 | 87 |
71 #endif // #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK | 88 #endif // #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK |
72 #endif // #ifndef SkTypeface_android_DEFINED | 89 #endif // #ifndef SkTypeface_android_DEFINED |
OLD | NEW |