| 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_SIMPLEFONT_H_ | 7 #ifndef CORE_FPDFAPI_FPDF_FONT_CPDF_SIMPLEFONT_H_ |
| 8 #define CORE_FPDFAPI_FPDF_FONT_CPDF_SIMPLEFONT_H_ | 8 #define CORE_FPDFAPI_FPDF_FONT_CPDF_SIMPLEFONT_H_ |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "core/fpdfapi/fpdf_font/include/cpdf_font.h" | 12 #include "core/fpdfapi/fpdf_font/include/cpdf_font.h" |
| 13 #include "core/fpdfapi/fpdf_font/include/cpdf_fontencoding.h" | 13 #include "core/fpdfapi/fpdf_font/include/cpdf_fontencoding.h" |
| 14 #include "core/fxcrt/include/fx_string.h" | 14 #include "core/fxcrt/include/fx_string.h" |
| 15 #include "core/fxcrt/include/fx_system.h" | 15 #include "core/fxcrt/include/fx_system.h" |
| 16 | 16 |
| 17 class CPDF_SimpleFont : public CPDF_Font { | 17 class CPDF_SimpleFont : public CPDF_Font { |
| 18 public: | 18 public: |
| 19 CPDF_SimpleFont(); | 19 CPDF_SimpleFont(); |
| 20 ~CPDF_SimpleFont() override; | 20 ~CPDF_SimpleFont() override; |
| 21 | 21 |
| 22 // CPDF_Font | 22 // CPDF_Font |
| 23 int GetCharWidthF(uint32_t charcode, int level = 0) override; | 23 int GetCharWidthF(uint32_t charcode, int level = 0) override; |
| 24 FX_RECT GetCharBBox(uint32_t charcode, int level = 0) override; | 24 FX_RECT GetCharBBox(uint32_t charcode, int level = 0) override; |
| 25 int GlyphFromCharCode(uint32_t charcode, bool* pVertGlyph) override; | 25 int GlyphFromCharCode(uint32_t charcode, bool* pVertGlyph) override; |
| 26 FX_BOOL IsUnicodeCompatible() const override; | 26 bool IsUnicodeCompatible() const override; |
| 27 CFX_WideString UnicodeFromCharCode(uint32_t charcode) const override; | 27 CFX_WideString UnicodeFromCharCode(uint32_t charcode) const override; |
| 28 uint32_t CharCodeFromUnicode(FX_WCHAR Unicode) const override; | 28 uint32_t CharCodeFromUnicode(FX_WCHAR Unicode) const override; |
| 29 | 29 |
| 30 CPDF_FontEncoding* GetEncoding() { return &m_Encoding; } | 30 CPDF_FontEncoding* GetEncoding() { return &m_Encoding; } |
| 31 | 31 |
| 32 protected: | 32 protected: |
| 33 virtual void LoadGlyphMap() = 0; | 33 virtual void LoadGlyphMap() = 0; |
| 34 | 34 |
| 35 FX_BOOL LoadCommon(); | 35 bool LoadCommon(); |
| 36 void LoadSubstFont(); | 36 void LoadSubstFont(); |
| 37 void LoadCharMetrics(int charcode); | 37 void LoadCharMetrics(int charcode); |
| 38 | 38 |
| 39 CPDF_FontEncoding m_Encoding; | 39 CPDF_FontEncoding m_Encoding; |
| 40 uint16_t m_GlyphIndex[256]; | 40 uint16_t m_GlyphIndex[256]; |
| 41 uint16_t m_ExtGID[256]; | 41 uint16_t m_ExtGID[256]; |
| 42 std::vector<CFX_ByteString> m_CharNames; | 42 std::vector<CFX_ByteString> m_CharNames; |
| 43 int m_BaseEncoding; | 43 int m_BaseEncoding; |
| 44 uint16_t m_CharWidth[256]; | 44 uint16_t m_CharWidth[256]; |
| 45 FX_RECT m_CharBBox[256]; | 45 FX_RECT m_CharBBox[256]; |
| 46 bool m_bUseFontWidth; | 46 bool m_bUseFontWidth; |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 #endif // CORE_FPDFAPI_FPDF_FONT_CPDF_SIMPLEFONT_H_ | 49 #endif // CORE_FPDFAPI_FPDF_FONT_CPDF_SIMPLEFONT_H_ |
| OLD | NEW |