Index: src/ports/SkFontHost_FreeType.cpp |
diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp |
index eb2f28a59dd8567f0fc71e970cc80620ed6830ba..fc14bd36443053772196d8fa5e3c70e22b5f20c6 100644 |
--- a/src/ports/SkFontHost_FreeType.cpp |
+++ b/src/ports/SkFontHost_FreeType.cpp |
@@ -729,6 +729,25 @@ int SkTypeface_FreeType::onGetUPEM() const { |
return face ? face->units_per_EM : 0; |
} |
+bool SkTypeface_FreeType::onGetKerningPairAdjustments(const uint16_t glyphs[], |
+ int count, int32_t adjustments[]) const { |
+ AutoFTAccess fta(this); |
+ FT_Face face = fta.face(); |
bungeman-skia
2013/10/29 21:38:41
I think you want a test around FT_HAS_KERNING(face
reed1
2013/10/30 13:59:37
Done.
|
+ |
+ for (int i = 0; i < count - 1; ++i) { |
+ FT_Vector delta; |
+ FT_Error err = FT_Get_Kerning(face, glyphs[i], glyphs[i+1], |
+ FT_KERNING_UNSCALED, &delta); |
+ if (err) { |
+ return false; |
bungeman-skia
2013/10/29 21:38:41
Hey, the documentation implies that adjustments wo
reed1
2013/10/30 13:59:37
Done.
|
+ } |
+ if (adjustments) { |
+ adjustments[i] = delta.x; |
+ } |
+ } |
+ return true; |
+} |
+ |
SkScalerContext_FreeType::SkScalerContext_FreeType(SkTypeface* typeface, |
const SkDescriptor* desc) |
: SkScalerContext_FreeType_Base(typeface, desc) { |