OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
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 #ifndef SkPaint_DEFINED | 8 #ifndef SkPaint_DEFINED |
9 #define SkPaint_DEFINED | 9 #define SkPaint_DEFINED |
10 | 10 |
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
814 /** Return the recommend line spacing. This will be | 814 /** Return the recommend line spacing. This will be |
815 fDescent - fAscent + fLeading | 815 fDescent - fAscent + fLeading |
816 */ | 816 */ |
817 SkScalar getFontSpacing() const { return this->getFontMetrics(NULL, 0); } | 817 SkScalar getFontSpacing() const { return this->getFontMetrics(NULL, 0); } |
818 | 818 |
819 /** Convert the specified text into glyph IDs, returning the number of | 819 /** Convert the specified text into glyph IDs, returning the number of |
820 glyphs ID written. If glyphs is NULL, it is ignore and only the count | 820 glyphs ID written. If glyphs is NULL, it is ignore and only the count |
821 is returned. | 821 is returned. |
822 */ | 822 */ |
823 int textToGlyphs(const void* text, size_t byteLength, | 823 int textToGlyphs(const void* text, size_t byteLength, |
824 uint16_t glyphs[]) const; | 824 SkGlyphID glyphs[]) const; |
825 | 825 |
826 /** Return true if all of the specified text has a corresponding non-zero | 826 /** Return true if all of the specified text has a corresponding non-zero |
827 glyph ID. If any of the code-points in the text are not supported in | 827 glyph ID. If any of the code-points in the text are not supported in |
828 the typeface (i.e. the glyph ID would be zero), then return false. | 828 the typeface (i.e. the glyph ID would be zero), then return false. |
829 | 829 |
830 If the text encoding for the paint is kGlyph_TextEncoding, then this | 830 If the text encoding for the paint is kGlyph_TextEncoding, then this |
831 returns true if all of the specified glyph IDs are non-zero. | 831 returns true if all of the specified glyph IDs are non-zero. |
832 */ | 832 */ |
833 bool containsText(const void* text, size_t byteLength) const; | 833 bool containsText(const void* text, size_t byteLength) const; |
834 | 834 |
835 /** Convert the glyph array into Unichars. Unconvertable glyphs are mapped | 835 /** Convert the glyph array into Unichars. Unconvertable glyphs are mapped |
836 to zero. Note: this does not look at the text-encoding setting in the | 836 to zero. Note: this does not look at the text-encoding setting in the |
837 paint, only at the typeface. | 837 paint, only at the typeface. |
838 */ | 838 */ |
839 void glyphsToUnichars(const uint16_t glyphs[], int count, SkUnichar text[])
const; | 839 void glyphsToUnichars(const SkGlyphID glyphs[], int count, SkUnichar text[])
const; |
840 | 840 |
841 /** Return the number of drawable units in the specified text buffer. | 841 /** Return the number of drawable units in the specified text buffer. |
842 This looks at the current TextEncoding field of the paint. If you also | 842 This looks at the current TextEncoding field of the paint. If you also |
843 want to have the text converted into glyph IDs, call textToGlyphs | 843 want to have the text converted into glyph IDs, call textToGlyphs |
844 instead. | 844 instead. |
845 */ | 845 */ |
846 int countText(const void* text, size_t byteLength) const { | 846 int countText(const void* text, size_t byteLength) const { |
847 return this->textToGlyphs(text, byteLength, NULL); | 847 return this->textToGlyphs(text, byteLength, NULL); |
848 } | 848 } |
849 | 849 |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1174 friend class GrStencilAndCoverTextContext; | 1174 friend class GrStencilAndCoverTextContext; |
1175 friend class GrPathRendering; | 1175 friend class GrPathRendering; |
1176 friend class GrTextUtils; | 1176 friend class GrTextUtils; |
1177 friend class GrGLPathRendering; | 1177 friend class GrGLPathRendering; |
1178 friend class SkScalerContext; | 1178 friend class SkScalerContext; |
1179 friend class SkTextBaseIter; | 1179 friend class SkTextBaseIter; |
1180 friend class SkCanonicalizePaint; | 1180 friend class SkCanonicalizePaint; |
1181 }; | 1181 }; |
1182 | 1182 |
1183 #endif | 1183 #endif |
OLD | NEW |