Index: src/core/SkPaint.cpp |
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp |
index ff08a0a65f571695d0ccc11e53b79d5563a15408..a9989f46e1bd6d7018c4720ff80acafb1d1486f1 100644 |
--- a/src/core/SkPaint.cpp |
+++ b/src/core/SkPaint.cpp |
@@ -1238,8 +1238,12 @@ void SkPaint::getPosTextPath(const void* textData, size_t length, |
} |
SkRect SkPaint::getFontBounds() const { |
+ // This approach can be a little over 1% too narrow when using GDI, |
+ // so we compensate by scaling the x-axis another 2%. |
+ SkScalar xScale = fTextScaleX * 1.02f; |
+ |
SkMatrix m; |
- m.setScale(fTextSize * fTextScaleX, fTextSize); |
+ m.setScale(fTextSize * xScale, fTextSize); |
m.postSkew(fTextSkewX, 0); |
SkTypeface* typeface = this->getTypeface(); |