OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006-2012 The Android Open Source Project | 2 * Copyright 2006-2012 The Android Open Source Project |
3 * Copyright 2012 Mozilla Foundation | 3 * Copyright 2012 Mozilla Foundation |
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 #ifndef SKFONTHOST_FREETYPE_COMMON_H_ | 9 #ifndef SKFONTHOST_FREETYPE_COMMON_H_ |
10 #define SKFONTHOST_FREETYPE_COMMON_H_ | 10 #define SKFONTHOST_FREETYPE_COMMON_H_ |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 class SkTypeface_FreeType : public SkTypeface { | 37 class SkTypeface_FreeType : public SkTypeface { |
38 public: | 38 public: |
39 /** For SkFontMgrs to make use of our ability to extract | 39 /** For SkFontMgrs to make use of our ability to extract |
40 * name and style from a stream, using FreeType's API. | 40 * name and style from a stream, using FreeType's API. |
41 */ | 41 */ |
42 class Scanner : ::SkNoncopyable { | 42 class Scanner : ::SkNoncopyable { |
43 public: | 43 public: |
44 Scanner(); | 44 Scanner(); |
45 ~Scanner(); | 45 ~Scanner(); |
| 46 struct AxisDefinition { |
| 47 SkFourByteTag fTag; |
| 48 SkFixed fMinimum; |
| 49 SkFixed fDefault; |
| 50 SkFixed fMaximum; |
| 51 }; |
| 52 using AxisDefinitions = SkSTArray<4, AxisDefinition, true>; |
46 bool recognizedFont(SkStream* stream, int* numFonts) const; | 53 bool recognizedFont(SkStream* stream, int* numFonts) const; |
47 bool scanFont(SkStream* stream, int ttcIndex, | 54 bool scanFont(SkStream* stream, int ttcIndex, |
48 SkString* name, SkFontStyle* style, bool* isFixedPitch) co
nst; | 55 SkString* name, SkFontStyle* style, bool* isFixedPitch, |
| 56 AxisDefinitions* axes) const; |
49 private: | 57 private: |
50 FT_Face openFace(SkStream* stream, int ttcIndex, FT_Stream ftStream) con
st; | 58 FT_Face openFace(SkStream* stream, int ttcIndex, FT_Stream ftStream) con
st; |
51 FT_Library fLibrary; | 59 FT_Library fLibrary; |
52 mutable SkMutex fLibraryMutex; | 60 mutable SkMutex fLibraryMutex; |
53 }; | 61 }; |
54 | 62 |
55 protected: | 63 protected: |
56 SkTypeface_FreeType(const SkFontStyle& style, SkFontID uniqueID, bool isFixe
dPitch) | 64 SkTypeface_FreeType(const SkFontStyle& style, SkFontID uniqueID, bool isFixe
dPitch) |
57 : INHERITED(style, uniqueID, isFixedPitch) | 65 : INHERITED(style, uniqueID, isFixedPitch) |
58 , fGlyphCount(-1) | 66 , fGlyphCount(-1) |
(...skipping 17 matching lines...) Expand all Loading... |
76 virtual size_t onGetTableData(SkFontTableTag, size_t offset, | 84 virtual size_t onGetTableData(SkFontTableTag, size_t offset, |
77 size_t length, void* data) const override; | 85 size_t length, void* data) const override; |
78 | 86 |
79 private: | 87 private: |
80 mutable int fGlyphCount; | 88 mutable int fGlyphCount; |
81 | 89 |
82 typedef SkTypeface INHERITED; | 90 typedef SkTypeface INHERITED; |
83 }; | 91 }; |
84 | 92 |
85 #endif // SKFONTHOST_FREETYPE_COMMON_H_ | 93 #endif // SKFONTHOST_FREETYPE_COMMON_H_ |
OLD | NEW |