OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef XFA_FGAS_FONT_FGAS_STDFONTMGR_H_ | 7 #ifndef XFA_FGAS_FONT_FGAS_STDFONTMGR_H_ |
8 #define XFA_FGAS_FONT_FGAS_STDFONTMGR_H_ | 8 #define XFA_FGAS_FONT_FGAS_STDFONTMGR_H_ |
9 | 9 |
10 #include "core/fxcrt/include/fx_ext.h" | 10 #include "core/fxcrt/include/fx_ext.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 CFX_MapPtrToPtr m_BufferFonts; | 75 CFX_MapPtrToPtr m_BufferFonts; |
76 CFX_MapPtrToPtr m_StreamFonts; | 76 CFX_MapPtrToPtr m_StreamFonts; |
77 CFX_MapPtrToPtr m_DeriveFonts; | 77 CFX_MapPtrToPtr m_DeriveFonts; |
78 }; | 78 }; |
79 uint32_t FX_GetGdiFontStyles(const LOGFONTW& lf); | 79 uint32_t FX_GetGdiFontStyles(const LOGFONTW& lf); |
80 | 80 |
81 #else | 81 #else |
82 | 82 |
83 class CFX_FontDescriptor { | 83 class CFX_FontDescriptor { |
84 public: | 84 public: |
85 CFX_FontDescriptor() : m_nFaceIndex(0), m_dwFontStyles(0) { | 85 CFX_FontDescriptor(); |
86 m_dwUsb[0] = m_dwUsb[1] = m_dwUsb[2] = m_dwUsb[3] = 0; | 86 ~CFX_FontDescriptor(); |
87 m_dwCsb[0] = m_dwCsb[1] = 0; | |
88 } | |
89 ~CFX_FontDescriptor() {} | |
90 | 87 |
91 int32_t m_nFaceIndex; | 88 int32_t m_nFaceIndex; |
92 CFX_WideString m_wsFaceName; | 89 CFX_WideString m_wsFaceName; |
93 CFX_WideStringArray m_wsFamilyNames; | 90 CFX_WideStringArray m_wsFamilyNames; |
94 uint32_t m_dwFontStyles; | 91 uint32_t m_dwFontStyles; |
95 uint32_t m_dwUsb[4]; | 92 uint32_t m_dwUsb[4]; |
96 uint32_t m_dwCsb[2]; | 93 uint32_t m_dwCsb[2]; |
97 }; | 94 }; |
| 95 |
98 typedef CFX_ArrayTemplate<CFX_FontDescriptor*> CFX_FontDescriptors; | 96 typedef CFX_ArrayTemplate<CFX_FontDescriptor*> CFX_FontDescriptors; |
99 | 97 |
100 struct FX_FontDescriptorInfo { | 98 struct FX_FontDescriptorInfo { |
101 public: | 99 public: |
102 CFX_FontDescriptor* pFont; | 100 CFX_FontDescriptor* pFont; |
103 int32_t nPenalty; | 101 int32_t nPenalty; |
104 | 102 |
105 bool operator>(const FX_FontDescriptorInfo& other) const { | 103 bool operator>(const FX_FontDescriptorInfo& other) const { |
106 return nPenalty > other.nPenalty; | 104 return nPenalty > other.nPenalty; |
107 } | 105 } |
108 bool operator<(const FX_FontDescriptorInfo& other) const { | 106 bool operator<(const FX_FontDescriptorInfo& other) const { |
109 return nPenalty < other.nPenalty; | 107 return nPenalty < other.nPenalty; |
110 } | 108 } |
111 bool operator==(const FX_FontDescriptorInfo& other) const { | 109 bool operator==(const FX_FontDescriptorInfo& other) const { |
112 return nPenalty == other.nPenalty; | 110 return nPenalty == other.nPenalty; |
113 } | 111 } |
114 }; | 112 }; |
| 113 |
115 typedef CFX_ArrayTemplate<FX_FontDescriptorInfo> CFX_FontDescriptorInfos; | 114 typedef CFX_ArrayTemplate<FX_FontDescriptorInfo> CFX_FontDescriptorInfos; |
116 | 115 |
117 struct FX_HandleParentPath { | 116 struct FX_HandleParentPath { |
118 FX_HandleParentPath() {} | 117 FX_HandleParentPath() {} |
119 FX_HandleParentPath(const FX_HandleParentPath& x) { | 118 FX_HandleParentPath(const FX_HandleParentPath& x) { |
120 pFileHandle = x.pFileHandle; | 119 pFileHandle = x.pFileHandle; |
121 bsParentPath = x.bsParentPath; | 120 bsParentPath = x.bsParentPath; |
122 } | 121 } |
123 void* pFileHandle; | 122 void* pFileHandle; |
124 CFX_ByteString bsParentPath; | 123 CFX_ByteString bsParentPath; |
125 }; | 124 }; |
126 | 125 |
127 class CFX_FontSourceEnum_File { | 126 class CFX_FontSourceEnum_File { |
128 public: | 127 public: |
129 CFX_FontSourceEnum_File(); | 128 CFX_FontSourceEnum_File(); |
| 129 ~CFX_FontSourceEnum_File(); |
130 | 130 |
131 void Release() { delete this; } | 131 void Release() { delete this; } |
132 FX_POSITION GetStartPosition(); | 132 FX_POSITION GetStartPosition(); |
133 IFX_FileAccess* GetNext(FX_POSITION& pos); | 133 IFX_FileAccess* GetNext(FX_POSITION& pos); |
134 | 134 |
135 private: | 135 private: |
136 CFX_ByteString GetNextFile(); | 136 CFX_ByteString GetNextFile(); |
137 | 137 |
138 CFX_WideString m_wsNext; | 138 CFX_WideString m_wsNext; |
139 CFX_ObjectArray<FX_HandleParentPath> m_FolderQueue; | 139 CFX_ObjectArray<FX_HandleParentPath> m_FolderQueue; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 | 219 |
220 CFX_MapPtrTemplate<uint32_t, CFX_FontDescriptorInfos*> m_Hash2CandidateList; | 220 CFX_MapPtrTemplate<uint32_t, CFX_FontDescriptorInfos*> m_Hash2CandidateList; |
221 CFX_MapPtrTemplate<uint32_t, CFX_ArrayTemplate<CFGAS_GEFont*>*> m_Hash2Fonts; | 221 CFX_MapPtrTemplate<uint32_t, CFX_ArrayTemplate<CFGAS_GEFont*>*> m_Hash2Fonts; |
222 CFX_MapPtrTemplate<CFGAS_GEFont*, IFX_FileRead*> m_IFXFont2FileRead; | 222 CFX_MapPtrTemplate<CFGAS_GEFont*, IFX_FileRead*> m_IFXFont2FileRead; |
223 CFX_MapPtrTemplate<FX_WCHAR, CFGAS_GEFont*> m_FailedUnicodes2NULL; | 223 CFX_MapPtrTemplate<FX_WCHAR, CFGAS_GEFont*> m_FailedUnicodes2NULL; |
224 CFX_FontSourceEnum_File* const m_pFontSource; | 224 CFX_FontSourceEnum_File* const m_pFontSource; |
225 }; | 225 }; |
226 #endif | 226 #endif |
227 | 227 |
228 #endif // XFA_FGAS_FONT_FGAS_STDFONTMGR_H_ | 228 #endif // XFA_FGAS_FONT_FGAS_STDFONTMGR_H_ |
OLD | NEW |