Chromium Code Reviews| 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" |
| 11 #include "core/fxge/include/fx_freetype.h" | 11 #include "core/fxge/include/fx_freetype.h" |
| 12 #include "core/fxge/include/fx_ge.h" | |
| 13 #include "third_party/freetype/include/freetype/fttypes.h" | 12 #include "third_party/freetype/include/freetype/fttypes.h" |
| 14 #include "xfa/fgas/font/fgas_font.h" | 13 #include "xfa/fgas/font/fgas_font.h" |
| 15 | 14 |
| 16 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 15 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
| 17 int32_t FX_GetSimilarValue(FX_FONTDESCRIPTOR const* pFont, | 16 int32_t FX_GetSimilarValue(FX_FONTDESCRIPTOR const* pFont, |
| 18 uint32_t dwFontStyles); | 17 uint32_t dwFontStyles); |
| 19 FX_FONTDESCRIPTOR const* FX_DefFontMatcher(FX_LPFONTMATCHPARAMS pParams, | 18 FX_FONTDESCRIPTOR const* FX_DefFontMatcher(FX_LPFONTMATCHPARAMS pParams, |
| 20 const CFX_FontDescriptors& fonts); | 19 const CFX_FontDescriptors& fonts); |
| 21 | 20 |
| 22 class CFX_StdFontMgrImp : public IFX_FontMgr { | 21 class CFX_StdFontMgrImp : public IFX_FontMgr { |
| 23 public: | 22 public: |
| 24 CFX_StdFontMgrImp(FX_LPEnumAllFonts pEnumerator); | 23 explicit CFX_StdFontMgrImp(FX_LPEnumAllFonts pEnumerator); |
| 25 ~CFX_StdFontMgrImp(); | 24 ~CFX_StdFontMgrImp(); |
| 26 virtual void Release() { delete this; } | 25 virtual void Release() { delete this; } |
| 27 virtual IFX_Font* GetDefFontByCodePage(uint16_t wCodePage, | 26 virtual IFX_Font* GetDefFontByCodePage(uint16_t wCodePage, |
|
dsinclair
2016/05/26 02:55:17
any overrides?
Lei Zhang
2016/05/26 04:23:16
Done.
| |
| 28 uint32_t dwFontStyles, | 27 uint32_t dwFontStyles, |
| 29 const FX_WCHAR* pszFontFamily = NULL); | 28 const FX_WCHAR* pszFontFamily = NULL); |
| 30 virtual IFX_Font* GetDefFontByCharset(uint8_t nCharset, | 29 virtual IFX_Font* GetDefFontByCharset(uint8_t nCharset, |
| 31 uint32_t dwFontStyles, | 30 uint32_t dwFontStyles, |
| 32 const FX_WCHAR* pszFontFamily = NULL); | 31 const FX_WCHAR* pszFontFamily = NULL); |
| 33 virtual IFX_Font* GetDefFontByUnicode(FX_WCHAR wUnicode, | 32 virtual IFX_Font* GetDefFontByUnicode(FX_WCHAR wUnicode, |
| 34 uint32_t dwFontStyles, | 33 uint32_t dwFontStyles, |
| 35 const FX_WCHAR* pszFontFamily = NULL); | 34 const FX_WCHAR* pszFontFamily = NULL); |
| 36 virtual IFX_Font* GetDefFontByLanguage(uint16_t wLanguage, | 35 virtual IFX_Font* GetDefFontByLanguage(uint16_t wLanguage, |
| 37 uint32_t dwFontStyles, | 36 uint32_t dwFontStyles, |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 137 private: | 136 private: |
| 138 CFX_ByteString GetNextFile(); | 137 CFX_ByteString GetNextFile(); |
| 139 | 138 |
| 140 CFX_WideString m_wsNext; | 139 CFX_WideString m_wsNext; |
| 141 CFX_ObjectArray<FX_HandleParentPath> m_FolderQueue; | 140 CFX_ObjectArray<FX_HandleParentPath> m_FolderQueue; |
| 142 CFX_ByteStringArray m_FolderPaths; | 141 CFX_ByteStringArray m_FolderPaths; |
| 143 }; | 142 }; |
| 144 | 143 |
| 145 class CFX_FontMgrImp : public IFX_FontMgr { | 144 class CFX_FontMgrImp : public IFX_FontMgr { |
| 146 public: | 145 public: |
| 147 CFX_FontMgrImp(CFX_FontSourceEnum_File* pFontEnum); | 146 explicit CFX_FontMgrImp(CFX_FontSourceEnum_File* pFontEnum); |
| 148 | 147 |
| 149 virtual void Release(); | 148 virtual void Release(); |
| 150 virtual IFX_Font* GetDefFontByCodePage(uint16_t wCodePage, | 149 virtual IFX_Font* GetDefFontByCodePage(uint16_t wCodePage, |
|
dsinclair
2016/05/26 02:55:17
overrides?
Lei Zhang
2016/05/26 04:23:16
Done.
| |
| 151 uint32_t dwFontStyles, | 150 uint32_t dwFontStyles, |
| 152 const FX_WCHAR* pszFontFamily = NULL); | 151 const FX_WCHAR* pszFontFamily = NULL); |
| 153 virtual IFX_Font* GetDefFontByCharset(uint8_t nCharset, | 152 virtual IFX_Font* GetDefFontByCharset(uint8_t nCharset, |
| 154 uint32_t dwFontStyles, | 153 uint32_t dwFontStyles, |
| 155 const FX_WCHAR* pszFontFamily = NULL); | 154 const FX_WCHAR* pszFontFamily = NULL); |
| 156 virtual IFX_Font* GetDefFontByUnicode(FX_WCHAR wUnicode, | 155 virtual IFX_Font* GetDefFontByUnicode(FX_WCHAR wUnicode, |
| 157 uint32_t dwFontStyles, | 156 uint32_t dwFontStyles, |
| 158 const FX_WCHAR* pszFontFamily = NULL); | 157 const FX_WCHAR* pszFontFamily = NULL); |
| 159 virtual IFX_Font* GetDefFontByLanguage(uint16_t wLanguage, | 158 virtual IFX_Font* GetDefFontByLanguage(uint16_t wLanguage, |
| 160 uint32_t dwFontStyles, | 159 uint32_t dwFontStyles, |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 230 CFX_MapPtrTemplate<uint32_t, CFX_ArrayTemplate<IFX_Font*>*> m_Hash2Fonts; | 229 CFX_MapPtrTemplate<uint32_t, CFX_ArrayTemplate<IFX_Font*>*> m_Hash2Fonts; |
| 231 CFX_MapPtrTemplate<uint32_t, IFX_FileAccess*> m_Hash2FileAccess; | 230 CFX_MapPtrTemplate<uint32_t, IFX_FileAccess*> m_Hash2FileAccess; |
| 232 CFX_MapPtrTemplate<uint32_t, IFX_Font*> m_FileAccess2IFXFont; | 231 CFX_MapPtrTemplate<uint32_t, IFX_Font*> m_FileAccess2IFXFont; |
| 233 CFX_MapPtrTemplate<IFX_Font*, IFX_FileRead*> m_IFXFont2FileRead; | 232 CFX_MapPtrTemplate<IFX_Font*, IFX_FileRead*> m_IFXFont2FileRead; |
| 234 CFX_MapPtrTemplate<FX_WCHAR, IFX_Font*> m_FailedUnicodes2NULL; | 233 CFX_MapPtrTemplate<FX_WCHAR, IFX_Font*> m_FailedUnicodes2NULL; |
| 235 CFX_FontSourceEnum_File* m_pFontSource; | 234 CFX_FontSourceEnum_File* m_pFontSource; |
| 236 }; | 235 }; |
| 237 #endif | 236 #endif |
| 238 | 237 |
| 239 #endif // XFA_FGAS_FONT_FGAS_STDFONTMGR_H_ | 238 #endif // XFA_FGAS_FONT_FGAS_STDFONTMGR_H_ |
| OLD | NEW |