Chromium Code Reviews| 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. | |
| 75 * | |
| 76 * Optionally, if lower/upper bound params are provided and the returned | |
| 77 * typeface is not NULL, then these params are populated with the range of | |
| 78 * glyphIDs that this typeface is capable of resovling. The lower bound is | |
| 79 * inclusive while the upper bound is exclusive. | |
| 80 */ | |
| 81 SkTypeface* SkGetTypefaceForGlyphID(uint16_t glyphID, const SkTypeface* origType face, | |
|
reed1
2013/09/24 20:10:19
Does this call affect the refcnt() of the returned
| |
| 82 const SkPaintOptionsAndroid& options, | |
| 83 int* lowerBounds, int* upperBounds); | |
| 84 | |
| 85 | |
| 71 #endif // #ifdef SK_BUILD_FOR_ANDROID | 86 #endif // #ifdef SK_BUILD_FOR_ANDROID |
| 72 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK | 87 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK |
| 73 | 88 |
| 74 #include "SkPaintOptionsAndroid.h" | 89 #include "SkPaintOptionsAndroid.h" |
| 75 #include "../harfbuzz/src/harfbuzz-shaper.h" | 90 #include "../harfbuzz/src/harfbuzz-shaper.h" |
| 76 #include "../harfbuzz_ng/src/hb.h" | 91 #include "../harfbuzz_ng/src/hb.h" |
| 77 | 92 |
| 78 /** | 93 /** |
| 79 * Return a new typeface for a fallback script. If the script is | 94 * Return a new typeface for a fallback script. If the script is |
| 80 * not valid, or can not map to a font, returns null. | 95 * not valid, or can not map to a font, returns null. |
| 81 * @param script The harfbuzz script id. | 96 * @param script The harfbuzz script id. |
| 82 * @param style The font style, for example bold | 97 * @param style The font style, for example bold |
| 83 * @param elegant true if we want the web friendly elegant version of the fon t | 98 * @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 | 99 * @return reference to the matching typeface. Caller must call |
| 85 * unref() when they are done. | 100 * unref() when they are done. |
| 86 */ | 101 */ |
| 87 SK_API SkTypeface* SkCreateTypefaceForScriptNG(hb_script_t script, SkTypeface::S tyle style, | 102 SK_API SkTypeface* SkCreateTypefaceForScriptNG(hb_script_t script, SkTypeface::S tyle style, |
| 88 SkPaintOptionsAndroid::FontVariant fontVariant = SkPaintOptionsAndroid:: kDefault_Variant); | 103 SkPaintOptionsAndroid::FontVariant fontVariant = SkPaintOptionsAndroid:: kDefault_Variant); |
| 89 | 104 |
| 90 SK_API SkTypeface* SkCreateTypefaceForScript(HB_Script script, SkTypeface::Style style, | 105 SK_API SkTypeface* SkCreateTypefaceForScript(HB_Script script, SkTypeface::Style style, |
| 91 SkPaintOptionsAndroid::FontVariant fontVariant = SkPaintOptionsAndroid:: kDefault_Variant); | 106 SkPaintOptionsAndroid::FontVariant fontVariant = SkPaintOptionsAndroid:: kDefault_Variant); |
| 92 | 107 |
| 93 #endif // #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK | 108 #endif // #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK |
| 94 #endif // #ifndef SkTypeface_android_DEFINED | 109 #endif // #ifndef SkTypeface_android_DEFINED |
| OLD | NEW |