OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 |
| 7 #ifndef CORE_FPDFAPI_FPDF_FONT_CPDF_SIMPLEFONT_H_ |
| 8 #define CORE_FPDFAPI_FPDF_FONT_CPDF_SIMPLEFONT_H_ |
| 9 |
| 10 #include "core/fpdfapi/fpdf_font/include/cpdf_font.h" |
| 11 #include "core/fpdfapi/fpdf_font/include/cpdf_fontencoding.h" |
| 12 #include "core/fxcrt/include/fx_string.h" |
| 13 #include "core/fxcrt/include/fx_system.h" |
| 14 |
| 15 class CPDF_SimpleFont : public CPDF_Font { |
| 16 public: |
| 17 CPDF_SimpleFont(); |
| 18 virtual ~CPDF_SimpleFont(); |
| 19 |
| 20 // CPDF_Font: |
| 21 int GetCharWidthF(FX_DWORD charcode, int level = 0) override; |
| 22 FX_RECT GetCharBBox(FX_DWORD charcode, int level = 0) override; |
| 23 int GlyphFromCharCode(FX_DWORD charcode, FX_BOOL* pVertGlyph = NULL) override; |
| 24 FX_BOOL IsUnicodeCompatible() const override; |
| 25 CFX_WideString UnicodeFromCharCode(FX_DWORD charcode) const override; |
| 26 FX_DWORD CharCodeFromUnicode(FX_WCHAR Unicode) const override; |
| 27 |
| 28 CPDF_FontEncoding* GetEncoding() { return &m_Encoding; } |
| 29 |
| 30 protected: |
| 31 virtual void LoadGlyphMap() = 0; |
| 32 |
| 33 FX_BOOL LoadCommon(); |
| 34 void LoadSubstFont(); |
| 35 void LoadFaceMetrics(); |
| 36 void LoadCharMetrics(int charcode); |
| 37 |
| 38 CPDF_FontEncoding m_Encoding; |
| 39 uint16_t m_GlyphIndex[256]; |
| 40 uint16_t m_ExtGID[256]; |
| 41 CFX_ByteString* m_pCharNames; |
| 42 int m_BaseEncoding; |
| 43 uint16_t m_CharWidth[256]; |
| 44 FX_SMALL_RECT m_CharBBox[256]; |
| 45 FX_BOOL m_bUseFontWidth; |
| 46 }; |
| 47 |
| 48 #endif // CORE_FPDFAPI_FPDF_FONT_CPDF_SIMPLEFONT_H_ |
OLD | NEW |