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 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
626 SkMatrix sA; | 626 SkMatrix sA; |
627 SkMatrix GsA; | 627 SkMatrix GsA; |
628 SkMatrix A; | 628 SkMatrix A; |
629 fRec.computeMatrices(scaleConstraints, &scale, &sA, &GsA, &fG_inv, &A); | 629 fRec.computeMatrices(scaleConstraints, &scale, &sA, &GsA, &fG_inv, &A); |
630 | 630 |
631 fGsA.eM11 = SkScalarToFIXED(GsA.get(SkMatrix::kMScaleX)); | 631 fGsA.eM11 = SkScalarToFIXED(GsA.get(SkMatrix::kMScaleX)); |
632 fGsA.eM12 = SkScalarToFIXED(-GsA.get(SkMatrix::kMSkewY)); // This should be ~0. | 632 fGsA.eM12 = SkScalarToFIXED(-GsA.get(SkMatrix::kMSkewY)); // This should be ~0. |
633 fGsA.eM21 = SkScalarToFIXED(-GsA.get(SkMatrix::kMSkewX)); | 633 fGsA.eM21 = SkScalarToFIXED(-GsA.get(SkMatrix::kMSkewX)); |
634 fGsA.eM22 = SkScalarToFIXED(GsA.get(SkMatrix::kMScaleY)); | 634 fGsA.eM22 = SkScalarToFIXED(GsA.get(SkMatrix::kMScaleY)); |
635 | 635 |
636 SkScalar gdiTextSize = scale.fY; | 636 SkScalar gdiTextSize = SkScalarRoundToScalar(scale.fY); |
reed1
2015/03/18 13:57:08
// Comment here, to document WHY we need the round
bungeman-skia
2015/03/18 14:22:13
Done.
| |
637 if (gdiTextSize == 0) { | 637 if (gdiTextSize == 0) { |
638 gdiTextSize = SK_Scalar1; | 638 gdiTextSize = SK_Scalar1; |
639 } | 639 } |
640 | 640 |
641 LOGFONT lf = typeface->fLogFont; | 641 LOGFONT lf = typeface->fLogFont; |
642 lf.lfHeight = -SkScalarTruncToInt(gdiTextSize); | 642 lf.lfHeight = -SkScalarTruncToInt(gdiTextSize); |
643 lf.lfQuality = compute_quality(fRec); | 643 lf.lfQuality = compute_quality(fRec); |
644 fFont = CreateFontIndirect(&lf); | 644 fFont = CreateFontIndirect(&lf); |
645 if (!fFont) { | 645 if (!fFont) { |
646 return; | 646 return; |
(...skipping 1865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2512 | 2512 |
2513 private: | 2513 private: |
2514 SkTDArray<ENUMLOGFONTEX> fLogFontArray; | 2514 SkTDArray<ENUMLOGFONTEX> fLogFontArray; |
2515 }; | 2515 }; |
2516 | 2516 |
2517 /////////////////////////////////////////////////////////////////////////////// | 2517 /////////////////////////////////////////////////////////////////////////////// |
2518 | 2518 |
2519 SkFontMgr* SkFontMgr_New_GDI() { | 2519 SkFontMgr* SkFontMgr_New_GDI() { |
2520 return SkNEW(SkFontMgrGDI); | 2520 return SkNEW(SkFontMgrGDI); |
2521 } | 2521 } |
OLD | NEW |