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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 int CharsetCP, | 314 int CharsetCP, |
315 CFX_SubstFont* pSubstFont); | 315 CFX_SubstFont* pSubstFont); |
316 #ifdef PDF_ENABLE_XFA | 316 #ifdef PDF_ENABLE_XFA |
317 FXFT_Face FindSubstFontByUnicode(uint32_t dwUnicode, | 317 FXFT_Face FindSubstFontByUnicode(uint32_t dwUnicode, |
318 uint32_t flags, | 318 uint32_t flags, |
319 int weight, | 319 int weight, |
320 int italic_angle); | 320 int italic_angle); |
321 #endif // PDF_ENABLE_XFA | 321 #endif // PDF_ENABLE_XFA |
322 FX_BOOL IsBuiltinFace(const FXFT_Face face) const; | 322 FX_BOOL IsBuiltinFace(const FXFT_Face face) const; |
323 int GetFaceSize() const; | 323 int GetFaceSize() const; |
324 CFX_ByteString GetFaceName(int index) const { return m_FaceArray[index]; } | 324 CFX_ByteString GetFaceName(int index) const { |
| 325 return m_FaceArray[index].name; |
| 326 } |
325 | 327 |
326 std::vector<CFX_ByteString> m_InstalledTTFonts; | 328 std::vector<CFX_ByteString> m_InstalledTTFonts; |
327 | 329 |
328 private: | 330 private: |
329 static const size_t MM_FACE_COUNT = 2; | 331 static const size_t MM_FACE_COUNT = 2; |
330 static const size_t FOXIT_FACE_COUNT = 14; | 332 static const size_t FOXIT_FACE_COUNT = 14; |
331 | 333 |
332 CFX_ByteString GetPSNameFromTT(void* hFont); | 334 CFX_ByteString GetPSNameFromTT(void* hFont); |
333 CFX_ByteString MatchInstalledFonts(const CFX_ByteString& norm_name); | 335 CFX_ByteString MatchInstalledFonts(const CFX_ByteString& norm_name); |
334 FXFT_Face UseInternalSubst(CFX_SubstFont* pSubstFont, | 336 FXFT_Face UseInternalSubst(CFX_SubstFont* pSubstFont, |
335 int iBaseFont, | 337 int iBaseFont, |
336 int italic_angle, | 338 int italic_angle, |
337 int weight, | 339 int weight, |
338 int picthfamily); | 340 int picthfamily); |
339 | 341 |
| 342 struct FaceData { |
| 343 CFX_ByteString name; |
| 344 uint32_t charset; |
| 345 }; |
| 346 |
340 FX_BOOL m_bListLoaded; | 347 FX_BOOL m_bListLoaded; |
341 FXFT_Face m_MMFaces[MM_FACE_COUNT]; | 348 FXFT_Face m_MMFaces[MM_FACE_COUNT]; |
342 CFX_ByteString m_LastFamily; | 349 CFX_ByteString m_LastFamily; |
343 CFX_ArrayTemplate<uint32_t> m_CharsetArray; | 350 std::vector<FaceData> m_FaceArray; |
344 std::vector<CFX_ByteString> m_FaceArray; | |
345 IFX_SystemFontInfo* m_pFontInfo; | 351 IFX_SystemFontInfo* m_pFontInfo; |
346 FXFT_Face m_FoxitFaces[FOXIT_FACE_COUNT]; | 352 FXFT_Face m_FoxitFaces[FOXIT_FACE_COUNT]; |
347 CFX_FontMgr* const m_pFontMgr; | 353 CFX_FontMgr* const m_pFontMgr; |
348 }; | 354 }; |
349 | 355 |
350 class IFX_SystemFontInfo { | 356 class IFX_SystemFontInfo { |
351 public: | 357 public: |
352 static IFX_SystemFontInfo* CreateDefault(const char** pUserPaths); | 358 static IFX_SystemFontInfo* CreateDefault(const char** pUserPaths); |
353 virtual void Release() = 0; | 359 virtual void Release() = 0; |
354 | 360 |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 virtual ~IFX_GSUBTable() {} | 550 virtual ~IFX_GSUBTable() {} |
545 }; | 551 }; |
546 | 552 |
547 CFX_ByteString GetNameFromTT(const uint8_t* name_table, | 553 CFX_ByteString GetNameFromTT(const uint8_t* name_table, |
548 uint32_t name_table_size, | 554 uint32_t name_table_size, |
549 uint32_t name); | 555 uint32_t name); |
550 | 556 |
551 int PDF_GetStandardFontName(CFX_ByteString* name); | 557 int PDF_GetStandardFontName(CFX_ByteString* name); |
552 | 558 |
553 #endif // CORE_FXGE_INCLUDE_FX_FONT_H_ | 559 #endif // CORE_FXGE_INCLUDE_FX_FONT_H_ |
OLD | NEW |