| OLD | NEW |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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_FPDFAPI_FPDF_FONT_CPDF_TYPE3FONT_H_ | 7 #ifndef CORE_FPDFAPI_FPDF_FONT_CPDF_TYPE3FONT_H_ |
| 8 #define CORE_FPDFAPI_FPDF_FONT_CPDF_TYPE3FONT_H_ | 8 #define CORE_FPDFAPI_FPDF_FONT_CPDF_TYPE3FONT_H_ |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 | 11 |
| 12 #include "core/fpdfapi/fpdf_font/cpdf_simplefont.h" | 12 #include "core/fpdfapi/fpdf_font/cpdf_simplefont.h" |
| 13 #include "core/fxcrt/include/fx_coordinates.h" | 13 #include "core/fxcrt/include/fx_coordinates.h" |
| 14 #include "core/fxcrt/include/fx_system.h" | 14 #include "core/fxcrt/include/fx_system.h" |
| 15 | 15 |
| 16 class CPDF_Dictionary; | 16 class CPDF_Dictionary; |
| 17 class CPDF_Type3Char; | 17 class CPDF_Type3Char; |
| 18 | 18 |
| 19 class CPDF_Type3Font : public CPDF_SimpleFont { | 19 class CPDF_Type3Font : public CPDF_SimpleFont { |
| 20 public: | 20 public: |
| 21 CPDF_Type3Font(); | 21 CPDF_Type3Font(); |
| 22 ~CPDF_Type3Font() override; | 22 ~CPDF_Type3Font() override; |
| 23 | 23 |
| 24 // CPDF_Font: | 24 // CPDF_Font: |
| 25 bool IsType3Font() const override; | 25 bool IsType3Font() const override; |
| 26 const CPDF_Type3Font* AsType3Font() const override; | 26 const CPDF_Type3Font* AsType3Font() const override; |
| 27 CPDF_Type3Font* AsType3Font() override; | 27 CPDF_Type3Font* AsType3Font() override; |
| 28 int GetCharWidthF(FX_DWORD charcode, int level = 0) override; | 28 int GetCharWidthF(uint32_t charcode, int level = 0) override; |
| 29 FX_RECT GetCharBBox(FX_DWORD charcode, int level = 0) override; | 29 FX_RECT GetCharBBox(uint32_t charcode, int level = 0) override; |
| 30 | 30 |
| 31 void SetPageResources(CPDF_Dictionary* pResources) { | 31 void SetPageResources(CPDF_Dictionary* pResources) { |
| 32 m_pPageResources = pResources; | 32 m_pPageResources = pResources; |
| 33 } | 33 } |
| 34 CPDF_Type3Char* LoadChar(FX_DWORD charcode, int level = 0); | 34 CPDF_Type3Char* LoadChar(uint32_t charcode, int level = 0); |
| 35 void CheckType3FontMetrics(); | 35 void CheckType3FontMetrics(); |
| 36 | 36 |
| 37 CFX_Matrix& GetFontMatrix() { return m_FontMatrix; } | 37 CFX_Matrix& GetFontMatrix() { return m_FontMatrix; } |
| 38 | 38 |
| 39 protected: | 39 protected: |
| 40 CFX_Matrix m_FontMatrix; | 40 CFX_Matrix m_FontMatrix; |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 // CPDF_Font: | 43 // CPDF_Font: |
| 44 FX_BOOL Load() override; | 44 FX_BOOL Load() override; |
| 45 | 45 |
| 46 // CPDF_SimpleFont: | 46 // CPDF_SimpleFont: |
| 47 void LoadGlyphMap() override {} | 47 void LoadGlyphMap() override {} |
| 48 | 48 |
| 49 int m_CharWidthL[256]; | 49 int m_CharWidthL[256]; |
| 50 CPDF_Dictionary* m_pCharProcs; | 50 CPDF_Dictionary* m_pCharProcs; |
| 51 CPDF_Dictionary* m_pPageResources; | 51 CPDF_Dictionary* m_pPageResources; |
| 52 CPDF_Dictionary* m_pFontResources; | 52 CPDF_Dictionary* m_pFontResources; |
| 53 std::map<FX_DWORD, CPDF_Type3Char*> m_CacheMap; | 53 std::map<uint32_t, CPDF_Type3Char*> m_CacheMap; |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 #endif // CORE_FPDFAPI_FPDF_FONT_CPDF_TYPE3FONT_H_ | 56 #endif // CORE_FPDFAPI_FPDF_FONT_CPDF_TYPE3FONT_H_ |
| OLD | NEW |