| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkTypes.h" | 8 #include "SkTypes.h" |
| 9 #undef GetGlyphIndices | 9 #undef GetGlyphIndices |
| 10 | 10 |
| (...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 852 HRVM(fTypeface->fDWriteFontFace->GetDesignGlyphMetrics(&glyphId, 1, &gm)
, | 852 HRVM(fTypeface->fDWriteFontFace->GetDesignGlyphMetrics(&glyphId, 1, &gm)
, |
| 853 "Could not get design metrics."); | 853 "Could not get design metrics."); |
| 854 } | 854 } |
| 855 | 855 |
| 856 DWRITE_FONT_METRICS dwfm; | 856 DWRITE_FONT_METRICS dwfm; |
| 857 fTypeface->fDWriteFontFace->GetMetrics(&dwfm); | 857 fTypeface->fDWriteFontFace->GetMetrics(&dwfm); |
| 858 SkScalar advanceX = SkScalarMulDiv(fTextSizeMeasure, | 858 SkScalar advanceX = SkScalarMulDiv(fTextSizeMeasure, |
| 859 SkIntToScalar(gm.advanceWidth), | 859 SkIntToScalar(gm.advanceWidth), |
| 860 SkIntToScalar(dwfm.designUnitsPerEm)); | 860 SkIntToScalar(dwfm.designUnitsPerEm)); |
| 861 | 861 |
| 862 if (!this->isSubpixel()) { | |
| 863 advanceX = SkScalarRoundToScalar(advanceX); | |
| 864 } | |
| 865 | |
| 866 SkVector vecs[1] = { { advanceX, 0 } }; | 862 SkVector vecs[1] = { { advanceX, 0 } }; |
| 867 if (DWRITE_MEASURING_MODE_GDI_CLASSIC == fMeasuringMode || | 863 if (DWRITE_MEASURING_MODE_GDI_CLASSIC == fMeasuringMode || |
| 868 DWRITE_MEASURING_MODE_GDI_NATURAL == fMeasuringMode) | 864 DWRITE_MEASURING_MODE_GDI_NATURAL == fMeasuringMode) |
| 869 { | 865 { |
| 870 fG_inv.mapVectors(vecs, SK_ARRAY_COUNT(vecs)); | 866 fG_inv.mapVectors(vecs, SK_ARRAY_COUNT(vecs)); |
| 871 } else { | 867 } else { |
| 872 fSkXform.mapVectors(vecs, SK_ARRAY_COUNT(vecs)); | 868 fSkXform.mapVectors(vecs, SK_ARRAY_COUNT(vecs)); |
| 873 } | 869 } |
| 874 | 870 |
| 875 glyph->fAdvanceX = SkScalarToFixed(vecs[0].fX); | 871 glyph->fAdvanceX = SkScalarToFixed(vecs[0].fX); |
| (...skipping 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2002 } | 1998 } |
| 2003 | 1999 |
| 2004 #include "SkFontMgr_indirect.h" | 2000 #include "SkFontMgr_indirect.h" |
| 2005 SkFontMgr* SkFontMgr_New_DirectWriteRenderer(SkRemotableFontMgr* proxy) { | 2001 SkFontMgr* SkFontMgr_New_DirectWriteRenderer(SkRemotableFontMgr* proxy) { |
| 2006 SkAutoTUnref<SkFontMgr> impl(SkFontMgr_New_DirectWrite()); | 2002 SkAutoTUnref<SkFontMgr> impl(SkFontMgr_New_DirectWrite()); |
| 2007 if (impl.get() == NULL) { | 2003 if (impl.get() == NULL) { |
| 2008 return NULL; | 2004 return NULL; |
| 2009 } | 2005 } |
| 2010 return SkNEW_ARGS(SkFontMgr_Indirect, (impl.get(), proxy)); | 2006 return SkNEW_ARGS(SkFontMgr_Indirect, (impl.get(), proxy)); |
| 2011 } | 2007 } |
| OLD | NEW |