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 |
(...skipping 21 matching lines...) Expand all Loading... |
32 */ | 32 */ |
33 SK_API bool SkGetFallbackFamilyNameForChar(SkUnichar uni, const char* lang, SkSt
ring* name); | 33 SK_API bool SkGetFallbackFamilyNameForChar(SkUnichar uni, const char* lang, SkSt
ring* name); |
34 | 34 |
35 /** | 35 /** |
36 * For test only. | 36 * For test only. |
37 * Load font config from given xml files, instead of those from Android system. | 37 * Load font config from given xml files, instead of those from Android system. |
38 */ | 38 */ |
39 SK_API void SkUseTestFontConfigFile(const char* mainconf, const char* fallbackco
nf, | 39 SK_API void SkUseTestFontConfigFile(const char* mainconf, const char* fallbackco
nf, |
40 const char* fontsdir); | 40 const char* fontsdir); |
41 | 41 |
42 /** | |
43 * Given a "current" fontID, return a ref to the next logical typeface | |
44 * when searching fonts for a given unicode value. Typically the caller | |
45 * will query a given font, and if a unicode value is not supported, they | |
46 * will call this, and if 0 is not returned, will search that font, and so | |
47 * on. This process must be finite, and when the fonthost sees a | |
48 * font with no logical successor, it must return NULL. | |
49 * | |
50 * The original fontID is also provided. This is the initial font that was | |
51 * stored in the typeface of the caller. It is provided as an aid to choose | |
52 * the best next logical font. e.g. If the original font was bold or serif, | |
53 * but the 2nd in the logical chain was plain, then a subsequent call to | |
54 * get the 3rd can still inspect the original, and try to match its | |
55 * stylistic attributes. | |
56 */ | |
57 SkTypeface* SkAndroidNextLogicalTypeface(SkFontID currFontID, SkFontID origFontI
D, | |
58 const SkPaintOptionsAndroid& options); | |
59 | |
60 /** | |
61 * Given a glyphID (built using fallback font chaining) and its origin typeface | |
62 * return the actual typeface within the fallback chain that this glyphID | |
63 * resolves to. If no suitable typeface is found then NULL is returned. However, | |
64 * if returned typeface is not NULL it is assumed to be globally cached so the | |
65 * caller need not ref it. | |
66 * | |
67 * Optionally, if lower/upper bound params are provided and the returned | |
68 * typeface is not NULL, then these params are populated with the range of | |
69 * glyphIDs that this typeface is capable of resolving. The lower bound is | |
70 * inclusive while the upper bound is exclusive. | |
71 */ | |
72 SkTypeface* SkGetTypefaceForGlyphID(uint16_t glyphID, const SkTypeface* origType
face, | |
73 const SkPaintOptionsAndroid& options, | |
74 int* lowerBounds = NULL, int* upperBounds =
NULL); | |
75 | |
76 #endif // #ifdef SK_BUILD_FOR_ANDROID | 42 #endif // #ifdef SK_BUILD_FOR_ANDROID |
77 #endif // #ifndef SkTypeface_android_DEFINED | 43 #endif // #ifndef SkTypeface_android_DEFINED |
OLD | NEW |