| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 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 #if defined(SK_BUILD_FOR_WIN32) | 9 #if defined(SK_BUILD_FOR_WIN32) |
| 10 | 10 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 // an approximation. We shouldn't need to do this for larger sizes, but at t
hose | 79 // an approximation. We shouldn't need to do this for larger sizes, but at t
hose |
| 80 // sizes, the quality difference gets less and less between our general | 80 // sizes, the quality difference gets less and less between our general |
| 81 // scanconverter and GDI's. | 81 // scanconverter and GDI's. |
| 82 if (SkMask::kA8_Format == rec.fMaskFormat && !isAxisAligned(rec)) { | 82 if (SkMask::kA8_Format == rec.fMaskFormat && !isAxisAligned(rec)) { |
| 83 return true; | 83 return true; |
| 84 } | 84 } |
| 85 #endif | 85 #endif |
| 86 return rec.getHinting() == SkPaint::kNo_Hinting || rec.getHinting() == SkPai
nt::kSlight_Hinting; | 86 return rec.getHinting() == SkPaint::kNo_Hinting || rec.getHinting() == SkPai
nt::kSlight_Hinting; |
| 87 } | 87 } |
| 88 | 88 |
| 89 using namespace skia_advanced_typeface_metrics_utils; | |
| 90 | |
| 91 static void tchar_to_skstring(const TCHAR t[], SkString* s) { | 89 static void tchar_to_skstring(const TCHAR t[], SkString* s) { |
| 92 #ifdef UNICODE | 90 #ifdef UNICODE |
| 93 size_t sSize = WideCharToMultiByte(CP_UTF8, 0, t, -1, nullptr, 0, nullptr, n
ullptr); | 91 size_t sSize = WideCharToMultiByte(CP_UTF8, 0, t, -1, nullptr, 0, nullptr, n
ullptr); |
| 94 s->resize(sSize); | 92 s->resize(sSize); |
| 95 WideCharToMultiByte(CP_UTF8, 0, t, -1, s->writable_str(), sSize, nullptr, nu
llptr); | 93 WideCharToMultiByte(CP_UTF8, 0, t, -1, s->writable_str(), sSize, nullptr, nu
llptr); |
| 96 #else | 94 #else |
| 97 s->set(t); | 95 s->set(t); |
| 98 #endif | 96 #endif |
| 99 } | 97 } |
| 100 | 98 |
| (...skipping 1727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1828 int16_t width = abcWidths.abcB; | 1826 int16_t width = abcWidths.abcB; |
| 1829 if (width > 0 && width < min_width) { | 1827 if (width > 0 && width < min_width) { |
| 1830 min_width = width; | 1828 min_width = width; |
| 1831 info->fStemV = min_width; | 1829 info->fStemV = min_width; |
| 1832 } | 1830 } |
| 1833 } | 1831 } |
| 1834 } | 1832 } |
| 1835 | 1833 |
| 1836 if (perGlyphInfo & kHAdvance_PerGlyphInfo) { | 1834 if (perGlyphInfo & kHAdvance_PerGlyphInfo) { |
| 1837 if (info->fStyle & SkAdvancedTypefaceMetrics::kFixedPitch_Style) { | 1835 if (info->fStyle & SkAdvancedTypefaceMetrics::kFixedPitch_Style) { |
| 1838 appendRange(&info->fGlyphWidths, 0); | 1836 SkAdvancedTypefaceMetrics::WidthRange range(0); |
| 1839 info->fGlyphWidths->fAdvance.append(1, &min_width); | 1837 range.fAdvance.append(1, &min_width); |
| 1840 finishRange(info->fGlyphWidths.get(), 0, | 1838 SkAdvancedTypefaceMetrics::FinishRange( |
| 1841 SkAdvancedTypefaceMetrics::WidthRange::kDefault); | 1839 &range, 0, SkAdvancedTypefaceMetrics::WidthRange::kDefault); |
| 1840 info->fGlyphWidths.emplace_back(std::move(range)); |
| 1842 } else { | 1841 } else { |
| 1843 info->fGlyphWidths.reset( | 1842 info->setGlyphWidths(hdc, glyphCount, glyphIDs, |
| 1844 getAdvanceData(hdc, | 1843 glyphIDsCount, &getWidthAdvance); |
| 1845 glyphCount, | |
| 1846 glyphIDs, | |
| 1847 glyphIDsCount, | |
| 1848 &getWidthAdvance)); | |
| 1849 } | 1844 } |
| 1850 } | 1845 } |
| 1851 | 1846 |
| 1852 Error: | 1847 Error: |
| 1853 ReturnInfo: | 1848 ReturnInfo: |
| 1854 SelectObject(hdc, savefont); | 1849 SelectObject(hdc, savefont); |
| 1855 DeleteObject(designFont); | 1850 DeleteObject(designFont); |
| 1856 DeleteObject(font); | 1851 DeleteObject(font); |
| 1857 DeleteDC(hdc); | 1852 DeleteDC(hdc); |
| 1858 | 1853 |
| (...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2514 | 2509 |
| 2515 private: | 2510 private: |
| 2516 SkTDArray<ENUMLOGFONTEX> fLogFontArray; | 2511 SkTDArray<ENUMLOGFONTEX> fLogFontArray; |
| 2517 }; | 2512 }; |
| 2518 | 2513 |
| 2519 /////////////////////////////////////////////////////////////////////////////// | 2514 /////////////////////////////////////////////////////////////////////////////// |
| 2520 | 2515 |
| 2521 SkFontMgr* SkFontMgr_New_GDI() { return new SkFontMgrGDI; } | 2516 SkFontMgr* SkFontMgr_New_GDI() { return new SkFontMgrGDI; } |
| 2522 | 2517 |
| 2523 #endif//defined(SK_BUILD_FOR_WIN32) | 2518 #endif//defined(SK_BUILD_FOR_WIN32) |
| OLD | NEW |