Index: src/ports/SkFontHost_win.cpp |
=================================================================== |
--- a/src/ports/SkFontHost_win.cpp (revision 11569) |
+++ b/src/ports/SkFontHost_win.cpp (working copy) |
@@ -665,15 +665,22 @@ |
// textSize is the actual device size we want (as opposed to the size the user requested). |
// If the scale is negative, this means the matrix will do the flip anyway. |
- SkScalar textSize = SkScalarAbs(SkScalarRoundToScalar(GA.get(SkMatrix::kMScaleY))); |
+ SkScalar realTextSize = SkScalarAbs(GA.get(SkMatrix::kMScaleY)); |
+ SkScalar textSize = SkScalarRoundToScalar(realTextSize); |
reed1
2013/10/03 14:21:07
can we rename this something more distinct from re
bungeman-skia
2013/10/03 15:48:31
I'd hate to have two separate calls to SkScalarInv
|
if (textSize == 0) { |
textSize = SK_Scalar1; |
} |
+ // When not hinting, remove only the textSize scale which will be applied by GDI. |
+ // When GDI hinting, remove the entire Y scale to prevent 'subpixel' metrics. |
+ SkScalar scale = (fRec.getHinting() == SkPaint::kNo_Hinting || |
+ fRec.getHinting() == SkPaint::kSlight_Hinting) |
+ ? SkScalarInvert(textSize) |
+ : SkScalarInvert(realTextSize); |
+ |
// sA is the total matrix A without the textSize (so GDI knows the text size separately). |
// When this matrix is used with GetGlyphOutline, no further processing is needed. |
SkMatrix sA(A); |
- SkScalar scale = SkScalarInvert(textSize); |
sA.preScale(scale, scale); //remove text size |
// GsA is the non-rotational part of A without the text height scale. |