Chromium Code Reviews| Index: include/core/SkTypeface.h |
| diff --git a/include/core/SkTypeface.h b/include/core/SkTypeface.h |
| index eebb1276f7cd535606aa562f55a2606ef6529bde..d79f5a03802bccfbd4d349634b591f7aeb4d11a3 100644 |
| --- a/include/core/SkTypeface.h |
| +++ b/include/core/SkTypeface.h |
| @@ -225,6 +225,23 @@ public: |
| */ |
| int getUnitsPerEm() const; |
| + /** |
| + * If the typeface does not support kerning, returns false and all |
| + * parameters are ignored. |
| + * |
| + * If the typeface does support kerning, returns true. If the adjustments |
| + * parameter is not NULL, then it must have room for at least count-1 |
|
bungeman-skia
2013/10/29 21:38:41
This seems a bit odd. I would thing that if we wan
reed1
2013/10/30 13:59:37
Done.
|
| + * entries. These will be filled in with the kerning values that correspond |
| + * to the associated pairs of glyphs. |
| + * |
| + * e.g. adjustment[i] is relative to glyphs[i] and glyphs[i+1] |
| + * |
| + * These values are in design units, which are relative to the typeface's |
| + * units-per-em (see getUnitsPerEm). |
| + */ |
| + bool getKerningPairAdjustments(const uint16_t glyphs[], int count, |
| + int32_t adjustments[]) const; |
| + |
| struct LocalizedString { |
| SkString fString; |
| SkString fLanguage; |
| @@ -303,6 +320,7 @@ protected: |
| SkAdvancedTypefaceMetrics::PerGlyphInfo perGlyphInfo, |
| const uint32_t* glyphIDs, |
| uint32_t glyphIDsCount) const = 0; |
| + |
| virtual SkStream* onOpenStream(int* ttcIndex) const = 0; |
| virtual void onGetFontDescriptor(SkFontDescriptor*, bool* isLocal) const = 0; |
| @@ -311,6 +329,8 @@ protected: |
| virtual int onCountGlyphs() const = 0; |
| virtual int onGetUPEM() const = 0; |
| + virtual bool onGetKerningPairAdjustments(const uint16_t glyphs[], int count, |
| + int32_t adjustments[]) const; |
| virtual LocalizedStrings* onCreateFamilyNameIterator() const = 0; |