OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "SkAdvancedTypefaceMetrics.h" | 9 #include "SkAdvancedTypefaceMetrics.h" |
10 #include "SkBase64.h" | 10 #include "SkBase64.h" |
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 | 877 |
878 // Vector FON will transform nicely, but bitmap FON do not. | 878 // Vector FON will transform nicely, but bitmap FON do not. |
879 if (fType == SkScalerContext_GDI::kLine_Type) { | 879 if (fType == SkScalerContext_GDI::kLine_Type) { |
880 SkRect bounds = SkRect::MakeXYWH(glyph->fLeft, glyph->fTop, | 880 SkRect bounds = SkRect::MakeXYWH(glyph->fLeft, glyph->fTop, |
881 glyph->fWidth, glyph->fHeight); | 881 glyph->fWidth, glyph->fHeight); |
882 SkMatrix m; | 882 SkMatrix m; |
883 m.setAll(SkFIXEDToScalar(fMat22.eM11), -SkFIXEDToScalar(fMat22.eM21)
, 0, | 883 m.setAll(SkFIXEDToScalar(fMat22.eM11), -SkFIXEDToScalar(fMat22.eM21)
, 0, |
884 -SkFIXEDToScalar(fMat22.eM12), SkFIXEDToScalar(fMat22.eM22)
, 0, | 884 -SkFIXEDToScalar(fMat22.eM12), SkFIXEDToScalar(fMat22.eM22)
, 0, |
885 0, 0, SkScalarToPersp(SK_Scalar1)); | 885 0, 0, SkScalarToPersp(SK_Scalar1)); |
886 m.mapRect(&bounds); | 886 m.mapRect(&bounds); |
887 bounds.roundOut(); | 887 bounds.roundOut(&bounds); |
888 glyph->fLeft = SkScalarTruncToInt(bounds.fLeft); | 888 glyph->fLeft = SkScalarTruncToInt(bounds.fLeft); |
889 glyph->fTop = SkScalarTruncToInt(bounds.fTop); | 889 glyph->fTop = SkScalarTruncToInt(bounds.fTop); |
890 glyph->fWidth = SkScalarTruncToInt(bounds.width()); | 890 glyph->fWidth = SkScalarTruncToInt(bounds.width()); |
891 glyph->fHeight = SkScalarTruncToInt(bounds.height()); | 891 glyph->fHeight = SkScalarTruncToInt(bounds.height()); |
892 } | 892 } |
893 | 893 |
894 // Apply matrix to advance. | 894 // Apply matrix to advance. |
895 glyph->fAdvanceY = SkFixedMul(-SkFIXEDToFixed(fMat22.eM12), glyph->fAdva
nceX); | 895 glyph->fAdvanceY = SkFixedMul(-SkFIXEDToFixed(fMat22.eM12), glyph->fAdva
nceX); |
896 glyph->fAdvanceX = SkFixedMul(SkFIXEDToFixed(fMat22.eM11), glyph->fAdvan
ceX); | 896 glyph->fAdvanceX = SkFixedMul(SkFIXEDToFixed(fMat22.eM11), glyph->fAdvan
ceX); |
897 | 897 |
(...skipping 1643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2541 | 2541 |
2542 private: | 2542 private: |
2543 SkTDArray<ENUMLOGFONTEX> fLogFontArray; | 2543 SkTDArray<ENUMLOGFONTEX> fLogFontArray; |
2544 }; | 2544 }; |
2545 | 2545 |
2546 /////////////////////////////////////////////////////////////////////////////// | 2546 /////////////////////////////////////////////////////////////////////////////// |
2547 | 2547 |
2548 SkFontMgr* SkFontMgr_New_GDI() { | 2548 SkFontMgr* SkFontMgr_New_GDI() { |
2549 return SkNEW(SkFontMgrGDI); | 2549 return SkNEW(SkFontMgrGDI); |
2550 } | 2550 } |
OLD | NEW |