| 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 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 847 glyph->fAdvanceX = SkIntToFixed(glyph->fWidth); | 847 glyph->fAdvanceX = SkIntToFixed(glyph->fWidth); |
| 848 glyph->fAdvanceY = 0; | 848 glyph->fAdvanceY = 0; |
| 849 | 849 |
| 850 // Vector FON will transform nicely, but bitmap FON do not. | 850 // Vector FON will transform nicely, but bitmap FON do not. |
| 851 if (fType == SkScalerContext_GDI::kLine_Type) { | 851 if (fType == SkScalerContext_GDI::kLine_Type) { |
| 852 SkRect bounds = SkRect::MakeXYWH(glyph->fLeft, glyph->fTop, | 852 SkRect bounds = SkRect::MakeXYWH(glyph->fLeft, glyph->fTop, |
| 853 glyph->fWidth, glyph->fHeight); | 853 glyph->fWidth, glyph->fHeight); |
| 854 SkMatrix m; | 854 SkMatrix m; |
| 855 m.setAll(SkFIXEDToScalar(fMat22.eM11), -SkFIXEDToScalar(fMat22.eM21)
, 0, | 855 m.setAll(SkFIXEDToScalar(fMat22.eM11), -SkFIXEDToScalar(fMat22.eM21)
, 0, |
| 856 -SkFIXEDToScalar(fMat22.eM12), SkFIXEDToScalar(fMat22.eM22)
, 0, | 856 -SkFIXEDToScalar(fMat22.eM12), SkFIXEDToScalar(fMat22.eM22)
, 0, |
| 857 0, 0, SkScalarToPersp(SK_Scalar1)); | 857 0, 0, 1); |
| 858 m.mapRect(&bounds); | 858 m.mapRect(&bounds); |
| 859 bounds.roundOut(&bounds); | 859 bounds.roundOut(&bounds); |
| 860 glyph->fLeft = SkScalarTruncToInt(bounds.fLeft); | 860 glyph->fLeft = SkScalarTruncToInt(bounds.fLeft); |
| 861 glyph->fTop = SkScalarTruncToInt(bounds.fTop); | 861 glyph->fTop = SkScalarTruncToInt(bounds.fTop); |
| 862 glyph->fWidth = SkScalarTruncToInt(bounds.width()); | 862 glyph->fWidth = SkScalarTruncToInt(bounds.width()); |
| 863 glyph->fHeight = SkScalarTruncToInt(bounds.height()); | 863 glyph->fHeight = SkScalarTruncToInt(bounds.height()); |
| 864 } | 864 } |
| 865 | 865 |
| 866 // Apply matrix to advance. | 866 // Apply matrix to advance. |
| 867 glyph->fAdvanceY = SkFixedMul(-SkFIXEDToFixed(fMat22.eM12), glyph->fAdva
nceX); | 867 glyph->fAdvanceY = SkFixedMul(-SkFIXEDToFixed(fMat22.eM12), glyph->fAdva
nceX); |
| (...skipping 1645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2513 | 2513 |
| 2514 private: | 2514 private: |
| 2515 SkTDArray<ENUMLOGFONTEX> fLogFontArray; | 2515 SkTDArray<ENUMLOGFONTEX> fLogFontArray; |
| 2516 }; | 2516 }; |
| 2517 | 2517 |
| 2518 /////////////////////////////////////////////////////////////////////////////// | 2518 /////////////////////////////////////////////////////////////////////////////// |
| 2519 | 2519 |
| 2520 SkFontMgr* SkFontMgr_New_GDI() { | 2520 SkFontMgr* SkFontMgr_New_GDI() { |
| 2521 return SkNEW(SkFontMgrGDI); | 2521 return SkNEW(SkFontMgrGDI); |
| 2522 } | 2522 } |
| OLD | NEW |