| 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 1843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1854 info->fLastGlyphID = SkToU16(glyphCount - 1); | 1854 info->fLastGlyphID = SkToU16(glyphCount - 1); |
| 1855 info->fStyle = 0; | 1855 info->fStyle = 0; |
| 1856 tchar_to_skstring(lf.lfFaceName, &info->fFontName); | 1856 tchar_to_skstring(lf.lfFaceName, &info->fFontName); |
| 1857 info->fFlags = SkAdvancedTypefaceMetrics::kEmpty_FontFlag; | 1857 info->fFlags = SkAdvancedTypefaceMetrics::kEmpty_FontFlag; |
| 1858 // If bit 1 is set, the font may not be embedded in a document. | 1858 // If bit 1 is set, the font may not be embedded in a document. |
| 1859 // If bit 1 is clear, the font can be embedded. | 1859 // If bit 1 is clear, the font can be embedded. |
| 1860 // If bit 2 is set, the embedding is read-only. | 1860 // If bit 2 is set, the embedding is read-only. |
| 1861 if (otm.otmfsType & 0x1) { | 1861 if (otm.otmfsType & 0x1) { |
| 1862 info->fFlags = SkTBitOr<SkAdvancedTypefaceMetrics::FontFlags>( | 1862 info->fFlags = SkTBitOr<SkAdvancedTypefaceMetrics::FontFlags>( |
| 1863 info->fFlags, | 1863 info->fFlags, |
| 1864 SkAdvancedTypefaceMetrics::kNotEmbeddable_FontFlag) | 1864 SkAdvancedTypefaceMetrics::kNotEmbeddable_FontFlag); |
| 1865 } | 1865 } |
| 1866 | 1866 |
| 1867 if (perGlyphInfo & SkAdvancedTypefaceMetrics::kToUnicode_PerGlyphInfo) { | 1867 if (perGlyphInfo & SkAdvancedTypefaceMetrics::kToUnicode_PerGlyphInfo) { |
| 1868 populate_glyph_to_unicode(hdc, glyphCount, &(info->fGlyphToUnicode)); | 1868 populate_glyph_to_unicode(hdc, glyphCount, &(info->fGlyphToUnicode)); |
| 1869 } | 1869 } |
| 1870 | 1870 |
| 1871 if (glyphCount > 0 && | 1871 if (glyphCount > 0 && |
| 1872 (otm.otmTextMetrics.tmPitchAndFamily & TMPF_TRUETYPE)) { | 1872 (otm.otmTextMetrics.tmPitchAndFamily & TMPF_TRUETYPE)) { |
| 1873 info->fType = SkAdvancedTypefaceMetrics::kTrueType_Font; | 1873 info->fType = SkAdvancedTypefaceMetrics::kTrueType_Font; |
| 1874 } else { | 1874 } else { |
| (...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2602 | 2602 |
| 2603 private: | 2603 private: |
| 2604 SkTDArray<ENUMLOGFONTEX> fLogFontArray; | 2604 SkTDArray<ENUMLOGFONTEX> fLogFontArray; |
| 2605 }; | 2605 }; |
| 2606 | 2606 |
| 2607 /////////////////////////////////////////////////////////////////////////////// | 2607 /////////////////////////////////////////////////////////////////////////////// |
| 2608 | 2608 |
| 2609 SkFontMgr* SkFontMgr_New_GDI() { | 2609 SkFontMgr* SkFontMgr_New_GDI() { |
| 2610 return SkNEW(SkFontMgrGDI); | 2610 return SkNEW(SkFontMgrGDI); |
| 2611 } | 2611 } |
| OLD | NEW |