| 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 1743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1754 glyphCount = calculateGlyphCount(hdc, fLogFont); | 1754 glyphCount = calculateGlyphCount(hdc, fLogFont); |
| 1755 | 1755 |
| 1756 info = new SkAdvancedTypefaceMetrics; | 1756 info = new SkAdvancedTypefaceMetrics; |
| 1757 info->fEmSize = otm.otmEMSquare; | 1757 info->fEmSize = otm.otmEMSquare; |
| 1758 info->fLastGlyphID = SkToU16(glyphCount - 1); | 1758 info->fLastGlyphID = SkToU16(glyphCount - 1); |
| 1759 tchar_to_skstring(lf.lfFaceName, &info->fFontName); | 1759 tchar_to_skstring(lf.lfFaceName, &info->fFontName); |
| 1760 // If bit 1 is set, the font may not be embedded in a document. | 1760 // If bit 1 is set, the font may not be embedded in a document. |
| 1761 // If bit 1 is clear, the font can be embedded. | 1761 // If bit 1 is clear, the font can be embedded. |
| 1762 // If bit 2 is set, the embedding is read-only. | 1762 // If bit 2 is set, the embedding is read-only. |
| 1763 if (otm.otmfsType & 0x1) { | 1763 if (otm.otmfsType & 0x1) { |
| 1764 info->fFlags = SkTBitOr<SkAdvancedTypefaceMetrics::FontFlags>( | 1764 info->fFlags |= SkAdvancedTypefaceMetrics::kNotEmbeddable_FontFlag; |
| 1765 info->fFlags, | |
| 1766 SkAdvancedTypefaceMetrics::kNotEmbeddable_FontFlag); | |
| 1767 } | 1765 } |
| 1768 | 1766 |
| 1769 if (perGlyphInfo & kToUnicode_PerGlyphInfo) { | 1767 if (perGlyphInfo & kToUnicode_PerGlyphInfo) { |
| 1770 populate_glyph_to_unicode(hdc, glyphCount, &(info->fGlyphToUnicode)); | 1768 populate_glyph_to_unicode(hdc, glyphCount, &(info->fGlyphToUnicode)); |
| 1771 } | 1769 } |
| 1772 | 1770 |
| 1773 if (glyphCount > 0 && | 1771 if (glyphCount > 0 && |
| 1774 (otm.otmTextMetrics.tmPitchAndFamily & TMPF_TRUETYPE)) { | 1772 (otm.otmTextMetrics.tmPitchAndFamily & TMPF_TRUETYPE)) { |
| 1775 info->fType = SkAdvancedTypefaceMetrics::kTrueType_Font; | 1773 info->fType = SkAdvancedTypefaceMetrics::kTrueType_Font; |
| 1776 } else { | 1774 } else { |
| (...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2483 | 2481 |
| 2484 private: | 2482 private: |
| 2485 SkTDArray<ENUMLOGFONTEX> fLogFontArray; | 2483 SkTDArray<ENUMLOGFONTEX> fLogFontArray; |
| 2486 }; | 2484 }; |
| 2487 | 2485 |
| 2488 /////////////////////////////////////////////////////////////////////////////// | 2486 /////////////////////////////////////////////////////////////////////////////// |
| 2489 | 2487 |
| 2490 SkFontMgr* SkFontMgr_New_GDI() { return new SkFontMgrGDI; } | 2488 SkFontMgr* SkFontMgr_New_GDI() { return new SkFontMgrGDI; } |
| 2491 | 2489 |
| 2492 #endif//defined(SK_BUILD_FOR_WIN32) | 2490 #endif//defined(SK_BUILD_FOR_WIN32) |
| OLD | NEW |