Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: include/core/SkTypeface.h

Issue 29363009: prototype for kerning api (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
« no previous file with comments | « gm/typeface.cpp ('k') | src/core/SkTypeface.cpp » ('j') | src/ports/SkFontHost_FreeType.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698