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 CORE_FXGE_INCLUDE_FX_FONT_H_ | 7 #ifndef CORE_FXGE_INCLUDE_FX_FONT_H_ |
| 8 #define CORE_FXGE_INCLUDE_FX_FONT_H_ | 8 #define CORE_FXGE_INCLUDE_FX_FONT_H_ |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 280 bool GetBuiltinFont(size_t index, const uint8_t** pFontData, uint32_t* size); | 280 bool GetBuiltinFont(size_t index, const uint8_t** pFontData, uint32_t* size); |
| 281 CFX_FontMapper* GetBuiltinMapper() const { return m_pBuiltinMapper.get(); } | 281 CFX_FontMapper* GetBuiltinMapper() const { return m_pBuiltinMapper.get(); } |
| 282 FXFT_Library GetFTLibrary() const { return m_FTLibrary; } | 282 FXFT_Library GetFTLibrary() const { return m_FTLibrary; } |
| 283 | 283 |
| 284 private: | 284 private: |
| 285 std::unique_ptr<CFX_FontMapper> m_pBuiltinMapper; | 285 std::unique_ptr<CFX_FontMapper> m_pBuiltinMapper; |
| 286 std::map<CFX_ByteString, CTTFontDesc*> m_FaceMap; | 286 std::map<CFX_ByteString, CTTFontDesc*> m_FaceMap; |
| 287 FXFT_Library m_FTLibrary; | 287 FXFT_Library m_FTLibrary; |
| 288 }; | 288 }; |
| 289 | 289 |
| 290 class IFX_FontEnumerator { | |
| 291 public: | |
| 292 virtual void HitFont() = 0; | |
| 293 | |
| 294 virtual void Finish() = 0; | |
| 295 | |
| 296 protected: | |
| 297 virtual ~IFX_FontEnumerator() {} | |
| 298 }; | |
| 299 | |
| 300 class IFX_AdditionalFontEnum { | 290 class IFX_AdditionalFontEnum { |
| 301 public: | 291 public: |
| 302 virtual int CountFiles() = 0; | 292 virtual int CountFiles() = 0; |
| 303 virtual IFX_FileStream* GetFontFile(int index) = 0; | 293 virtual IFX_FileStream* GetFontFile(int index) = 0; |
| 304 | 294 |
| 305 protected: | 295 protected: |
| 306 virtual ~IFX_AdditionalFontEnum() {} | 296 virtual ~IFX_AdditionalFontEnum() {} |
| 307 }; | 297 }; |
| 308 | 298 |
| 309 class CFX_FontMapper { | 299 class CFX_FontMapper { |
| 310 public: | 300 public: |
| 311 explicit CFX_FontMapper(CFX_FontMgr* mgr); | 301 explicit CFX_FontMapper(CFX_FontMgr* mgr); |
| 312 ~CFX_FontMapper(); | 302 ~CFX_FontMapper(); |
| 313 | 303 |
| 314 void SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo); | 304 void SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo); |
| 315 IFX_SystemFontInfo* GetSystemFontInfo() { return m_pFontInfo; } | 305 IFX_SystemFontInfo* GetSystemFontInfo() { return m_pFontInfo; } |
| 316 void AddInstalledFont(const CFX_ByteString& name, int charset); | 306 void AddInstalledFont(const CFX_ByteString& name, int charset); |
| 317 void LoadInstalledFonts(); | 307 void LoadInstalledFonts(); |
| 318 std::vector<CFX_ByteString> m_InstalledTTFonts; | 308 std::vector<CFX_ByteString> m_InstalledTTFonts; |
|
Tom Sepez
2016/04/06 20:35:13
nit: move this public member below last public met
dsinclair
2016/04/06 20:39:19
Done.
| |
| 319 void SetFontEnumerator(IFX_FontEnumerator* pFontEnumerator) { | 309 |
| 320 m_pFontEnumerator = pFontEnumerator; | |
| 321 } | |
| 322 IFX_FontEnumerator* GetFontEnumerator() const { return m_pFontEnumerator; } | |
| 323 FXFT_Face FindSubstFont(const CFX_ByteString& face_name, | 310 FXFT_Face FindSubstFont(const CFX_ByteString& face_name, |
| 324 FX_BOOL bTrueType, | 311 FX_BOOL bTrueType, |
| 325 uint32_t flags, | 312 uint32_t flags, |
| 326 int weight, | 313 int weight, |
| 327 int italic_angle, | 314 int italic_angle, |
| 328 int CharsetCP, | 315 int CharsetCP, |
| 329 CFX_SubstFont* pSubstFont); | 316 CFX_SubstFont* pSubstFont); |
| 330 #ifdef PDF_ENABLE_XFA | 317 #ifdef PDF_ENABLE_XFA |
| 331 FXFT_Face FindSubstFontByUnicode(uint32_t dwUnicode, | 318 FXFT_Face FindSubstFontByUnicode(uint32_t dwUnicode, |
| 332 uint32_t flags, | 319 uint32_t flags, |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 349 int weight, | 336 int weight, |
| 350 int picthfamily); | 337 int picthfamily); |
| 351 | 338 |
| 352 FX_BOOL m_bListLoaded; | 339 FX_BOOL m_bListLoaded; |
| 353 FXFT_Face m_MMFaces[MM_FACE_COUNT]; | 340 FXFT_Face m_MMFaces[MM_FACE_COUNT]; |
| 354 CFX_ByteString m_LastFamily; | 341 CFX_ByteString m_LastFamily; |
| 355 CFX_ArrayTemplate<uint32_t> m_CharsetArray; | 342 CFX_ArrayTemplate<uint32_t> m_CharsetArray; |
| 356 std::vector<CFX_ByteString> m_FaceArray; | 343 std::vector<CFX_ByteString> m_FaceArray; |
| 357 IFX_SystemFontInfo* m_pFontInfo; | 344 IFX_SystemFontInfo* m_pFontInfo; |
| 358 FXFT_Face m_FoxitFaces[FOXIT_FACE_COUNT]; | 345 FXFT_Face m_FoxitFaces[FOXIT_FACE_COUNT]; |
| 359 IFX_FontEnumerator* m_pFontEnumerator; | |
| 360 CFX_FontMgr* const m_pFontMgr; | 346 CFX_FontMgr* const m_pFontMgr; |
| 361 }; | 347 }; |
| 362 | 348 |
| 363 class IFX_SystemFontInfo { | 349 class IFX_SystemFontInfo { |
| 364 public: | 350 public: |
| 365 static IFX_SystemFontInfo* CreateDefault(const char** pUserPaths); | 351 static IFX_SystemFontInfo* CreateDefault(const char** pUserPaths); |
| 366 virtual void Release() = 0; | 352 virtual void Release() = 0; |
| 367 | 353 |
| 368 virtual FX_BOOL EnumFontList(CFX_FontMapper* pMapper) = 0; | 354 virtual FX_BOOL EnumFontList(CFX_FontMapper* pMapper) = 0; |
| 369 virtual void* MapFont(int weight, | 355 virtual void* MapFont(int weight, |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 557 virtual ~IFX_GSUBTable() {} | 543 virtual ~IFX_GSUBTable() {} |
| 558 }; | 544 }; |
| 559 | 545 |
| 560 CFX_ByteString GetNameFromTT(const uint8_t* name_table, | 546 CFX_ByteString GetNameFromTT(const uint8_t* name_table, |
| 561 uint32_t name_table_size, | 547 uint32_t name_table_size, |
| 562 uint32_t name); | 548 uint32_t name); |
| 563 | 549 |
| 564 int PDF_GetStandardFontName(CFX_ByteString* name); | 550 int PDF_GetStandardFontName(CFX_ByteString* name); |
| 565 | 551 |
| 566 #endif // CORE_FXGE_INCLUDE_FX_FONT_H_ | 552 #endif // CORE_FXGE_INCLUDE_FX_FONT_H_ |
| OLD | NEW |