| 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 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1049 my->fTop = SkIntToScalar(-otm.otmrcFontBox.top); | 1049 my->fTop = SkIntToScalar(-otm.otmrcFontBox.top); |
| 1050 my->fAscent = SkIntToScalar(-otm.otmAscent); | 1050 my->fAscent = SkIntToScalar(-otm.otmAscent); |
| 1051 my->fDescent = SkIntToScalar(-otm.otmDescent); | 1051 my->fDescent = SkIntToScalar(-otm.otmDescent); |
| 1052 my->fBottom = SkIntToScalar(-otm.otmrcFontBox.bottom); | 1052 my->fBottom = SkIntToScalar(-otm.otmrcFontBox.bottom); |
| 1053 my->fLeading = SkIntToScalar(otm.otmLineGap); | 1053 my->fLeading = SkIntToScalar(otm.otmLineGap); |
| 1054 my->fAvgCharWidth = SkIntToScalar(otm.otmTextMetrics.tmAveCharWidth); | 1054 my->fAvgCharWidth = SkIntToScalar(otm.otmTextMetrics.tmAveCharWidth); |
| 1055 my->fMaxCharWidth = SkIntToScalar(otm.otmTextMetrics.tmMaxCharWidth); | 1055 my->fMaxCharWidth = SkIntToScalar(otm.otmTextMetrics.tmMaxCharWidth); |
| 1056 my->fXMin = SkIntToScalar(otm.otmrcFontBox.left); | 1056 my->fXMin = SkIntToScalar(otm.otmrcFontBox.left); |
| 1057 my->fXMax = SkIntToScalar(otm.otmrcFontBox.right); | 1057 my->fXMax = SkIntToScalar(otm.otmrcFontBox.right); |
| 1058 #endif | 1058 #endif |
| 1059 #ifndef SK_IGNORE_UNDERLINE_POSITION_FIX | |
| 1060 my->fUnderlineThickness = SkIntToScalar(otm.otmsUnderscoreSize); | 1059 my->fUnderlineThickness = SkIntToScalar(otm.otmsUnderscoreSize); |
| 1061 my->fUnderlinePosition = -SkIntToScalar(otm.otmsUnderscorePosition); | 1060 my->fUnderlinePosition = -SkIntToScalar(otm.otmsUnderscorePosition); |
| 1062 | 1061 |
| 1063 my->fFlags |= SkPaint::FontMetrics::kUnderlineThinknessIsValid_Flag; | 1062 my->fFlags |= SkPaint::FontMetrics::kUnderlineThinknessIsValid_Flag; |
| 1064 my->fFlags |= SkPaint::FontMetrics::kUnderlinePositionIsValid_Flag; | 1063 my->fFlags |= SkPaint::FontMetrics::kUnderlinePositionIsValid_Flag; |
| 1065 #endif | 1064 |
| 1066 my->fXHeight = SkIntToScalar(otm.otmsXHeight); | 1065 my->fXHeight = SkIntToScalar(otm.otmsXHeight); |
| 1067 | 1066 |
| 1068 GLYPHMETRICS gm; | 1067 GLYPHMETRICS gm; |
| 1069 sk_bzero(&gm, sizeof(gm)); | 1068 sk_bzero(&gm, sizeof(gm)); |
| 1070 DWORD len = GetGlyphOutlineW(fDDC, 'x', GGO_METRICS, &gm, 0, 0, &gMat2Id
entity); | 1069 DWORD len = GetGlyphOutlineW(fDDC, 'x', GGO_METRICS, &gm, 0, 0, &gMat2Id
entity); |
| 1071 if (len != GDI_ERROR && gm.gmBlackBoxY > 0) { | 1070 if (len != GDI_ERROR && gm.gmBlackBoxY > 0) { |
| 1072 my->fXHeight = SkIntToScalar(gm.gmBlackBoxY); | 1071 my->fXHeight = SkIntToScalar(gm.gmBlackBoxY); |
| 1073 } | 1072 } |
| 1074 } | 1073 } |
| 1075 } | 1074 } |
| (...skipping 1541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2617 | 2616 |
| 2618 private: | 2617 private: |
| 2619 SkTDArray<ENUMLOGFONTEX> fLogFontArray; | 2618 SkTDArray<ENUMLOGFONTEX> fLogFontArray; |
| 2620 }; | 2619 }; |
| 2621 | 2620 |
| 2622 /////////////////////////////////////////////////////////////////////////////// | 2621 /////////////////////////////////////////////////////////////////////////////// |
| 2623 | 2622 |
| 2624 SkFontMgr* SkFontMgr_New_GDI() { | 2623 SkFontMgr* SkFontMgr_New_GDI() { |
| 2625 return SkNEW(SkFontMgrGDI); | 2624 return SkNEW(SkFontMgrGDI); |
| 2626 } | 2625 } |
| OLD | NEW |