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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 * The original fontID is also provided. This is the initial font that was | 61 * The original fontID is also provided. This is the initial font that was |
62 * stored in the typeface of the caller. It is provided as an aid to choose | 62 * stored in the typeface of the caller. It is provided as an aid to choose |
63 * the best next logical font. e.g. If the original font was bold or serif, | 63 * the best next logical font. e.g. If the original font was bold or serif, |
64 * but the 2nd in the logical chain was plain, then a subsequent call to | 64 * but the 2nd in the logical chain was plain, then a subsequent call to |
65 * get the 3rd can still inspect the original, and try to match its | 65 * get the 3rd can still inspect the original, and try to match its |
66 * stylistic attributes. | 66 * stylistic attributes. |
67 */ | 67 */ |
68 SkTypeface* SkAndroidNextLogicalTypeface(SkFontID currFontID, SkFontID origFontI
D, | 68 SkTypeface* SkAndroidNextLogicalTypeface(SkFontID currFontID, SkFontID origFontI
D, |
69 const SkPaintOptionsAndroid& options); | 69 const SkPaintOptionsAndroid& options); |
70 | 70 |
| 71 /** |
| 72 * Given a glyphID (built using fallback font chaining) and its origin typeface |
| 73 * return the actual typeface within the fallback chain that this glyphID |
| 74 * resolves to. If no suitable typeface is found then NULL is returned. However, |
| 75 * if returned typeface is not NULL it is assumed to be globally cached so the |
| 76 * caller need not ref it. |
| 77 * |
| 78 * Optionally, if lower/upper bound params are provided and the returned |
| 79 * typeface is not NULL, then these params are populated with the range of |
| 80 * glyphIDs that this typeface is capable of resolving. The lower bound is |
| 81 * inclusive while the upper bound is exclusive. |
| 82 */ |
| 83 SkTypeface* SkGetTypefaceForGlyphID(uint16_t glyphID, const SkTypeface* origType
face, |
| 84 const SkPaintOptionsAndroid& options, |
| 85 int* lowerBounds = NULL, int* upperBounds =
NULL); |
| 86 |
71 #endif // #ifdef SK_BUILD_FOR_ANDROID | 87 #endif // #ifdef SK_BUILD_FOR_ANDROID |
72 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK | 88 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK |
73 | 89 |
74 #include "SkPaintOptionsAndroid.h" | 90 #include "SkPaintOptionsAndroid.h" |
75 #include "../harfbuzz/src/harfbuzz-shaper.h" | 91 #include "../harfbuzz/src/harfbuzz-shaper.h" |
76 #include "../harfbuzz_ng/src/hb.h" | 92 #include "../harfbuzz_ng/src/hb.h" |
77 | 93 |
78 /** | 94 /** |
79 * Return a new typeface for a fallback script. If the script is | 95 * Return a new typeface for a fallback script. If the script is |
80 * not valid, or can not map to a font, returns null. | 96 * not valid, or can not map to a font, returns null. |
81 * @param script The harfbuzz script id. | 97 * @param script The harfbuzz script id. |
82 * @param style The font style, for example bold | 98 * @param style The font style, for example bold |
83 * @param elegant true if we want the web friendly elegant version of the fon
t | 99 * @param elegant true if we want the web friendly elegant version of the fon
t |
84 * @return reference to the matching typeface. Caller must call | 100 * @return reference to the matching typeface. Caller must call |
85 * unref() when they are done. | 101 * unref() when they are done. |
86 */ | 102 */ |
87 SK_API SkTypeface* SkCreateTypefaceForScriptNG(hb_script_t script, SkTypeface::S
tyle style, | 103 SK_API SkTypeface* SkCreateTypefaceForScriptNG(hb_script_t script, SkTypeface::S
tyle style, |
88 SkPaintOptionsAndroid::FontVariant fontVariant = SkPaintOptionsAndroid::
kDefault_Variant); | 104 SkPaintOptionsAndroid::FontVariant fontVariant = SkPaintOptionsAndroid::
kDefault_Variant); |
89 | 105 |
90 SK_API SkTypeface* SkCreateTypefaceForScript(HB_Script script, SkTypeface::Style
style, | 106 SK_API SkTypeface* SkCreateTypefaceForScript(HB_Script script, SkTypeface::Style
style, |
91 SkPaintOptionsAndroid::FontVariant fontVariant = SkPaintOptionsAndroid::
kDefault_Variant); | 107 SkPaintOptionsAndroid::FontVariant fontVariant = SkPaintOptionsAndroid::
kDefault_Variant); |
92 | 108 |
93 #endif // #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK | 109 #endif // #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK |
94 #endif // #ifndef SkTypeface_android_DEFINED | 110 #endif // #ifndef SkTypeface_android_DEFINED |
OLD | NEW |