| 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 FPDFSDK_PDFWINDOW_PWL_FONTMAP_H_ | 7 #ifndef FPDFSDK_PDFWINDOW_PWL_FONTMAP_H_ |
| 8 #define FPDFSDK_PDFWINDOW_PWL_FONTMAP_H_ | 8 #define FPDFSDK_PDFWINDOW_PWL_FONTMAP_H_ |
| 9 | 9 |
| 10 #include "core/fpdfdoc/include/ipvt_fontmap.h" | 10 #include "core/fpdfdoc/include/ipvt_fontmap.h" |
| 11 #include "fpdfsdk/fxedit/include/fx_edit.h" | 11 #include "fpdfsdk/fxedit/include/fx_edit.h" |
| 12 #include "public/fpdf_sysfontinfo.h" | 12 #include "public/fpdf_sysfontinfo.h" |
| 13 | 13 |
| 14 class CPDF_Document; | 14 class CPDF_Document; |
| 15 class IFX_SystemHandler; | 15 class CFX_SystemHandler; |
| 16 | 16 |
| 17 struct CPWL_FontMap_Data { | 17 struct CPWL_FontMap_Data { |
| 18 CPDF_Font* pFont; | 18 CPDF_Font* pFont; |
| 19 int32_t nCharset; | 19 int32_t nCharset; |
| 20 CFX_ByteString sFontName; | 20 CFX_ByteString sFontName; |
| 21 }; | 21 }; |
| 22 | 22 |
| 23 struct CPWL_FontMap_Native { | 23 struct CPWL_FontMap_Native { |
| 24 int32_t nCharset; | 24 int32_t nCharset; |
| 25 CFX_ByteString sFontName; | 25 CFX_ByteString sFontName; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 44 #define VIETNAMESE_CHARSET 163 | 44 #define VIETNAMESE_CHARSET 163 |
| 45 #define THAI_CHARSET 222 | 45 #define THAI_CHARSET 222 |
| 46 #define EASTEUROPE_CHARSET 238 | 46 #define EASTEUROPE_CHARSET 238 |
| 47 #define RUSSIAN_CHARSET 204 | 47 #define RUSSIAN_CHARSET 204 |
| 48 #define BALTIC_CHARSET 186 | 48 #define BALTIC_CHARSET 186 |
| 49 | 49 |
| 50 #endif | 50 #endif |
| 51 | 51 |
| 52 class CPWL_FontMap : public IPVT_FontMap { | 52 class CPWL_FontMap : public IPVT_FontMap { |
| 53 public: | 53 public: |
| 54 CPWL_FontMap(IFX_SystemHandler* pSystemHandler); | 54 CPWL_FontMap(CFX_SystemHandler* pSystemHandler); |
| 55 ~CPWL_FontMap() override; | 55 ~CPWL_FontMap() override; |
| 56 | 56 |
| 57 // IPVT_FontMap | 57 // IPVT_FontMap |
| 58 CPDF_Font* GetPDFFont(int32_t nFontIndex) override; | 58 CPDF_Font* GetPDFFont(int32_t nFontIndex) override; |
| 59 CFX_ByteString GetPDFFontAlias(int32_t nFontIndex) override; | 59 CFX_ByteString GetPDFFontAlias(int32_t nFontIndex) override; |
| 60 int32_t GetWordFontIndex(uint16_t word, | 60 int32_t GetWordFontIndex(uint16_t word, |
| 61 int32_t nCharset, | 61 int32_t nCharset, |
| 62 int32_t nFontIndex) override; | 62 int32_t nFontIndex) override; |
| 63 int32_t CharCodeFromUnicode(int32_t nFontIndex, uint16_t word) override; | 63 int32_t CharCodeFromUnicode(int32_t nFontIndex, uint16_t word) override; |
| 64 int32_t CharSetFromUnicode(uint16_t word, int32_t nOldCharset) override; | 64 int32_t CharSetFromUnicode(uint16_t word, int32_t nOldCharset) override; |
| 65 | 65 |
| 66 void SetSystemHandler(IFX_SystemHandler* pSystemHandler); | 66 void SetSystemHandler(CFX_SystemHandler* pSystemHandler); |
| 67 int32_t GetFontMapCount() const; | 67 int32_t GetFontMapCount() const; |
| 68 const CPWL_FontMap_Data* GetFontMapData(int32_t nIndex) const; | 68 const CPWL_FontMap_Data* GetFontMapData(int32_t nIndex) const; |
| 69 static int32_t GetNativeCharset(); | 69 static int32_t GetNativeCharset(); |
| 70 CFX_ByteString GetNativeFontName(int32_t nCharset); | 70 CFX_ByteString GetNativeFontName(int32_t nCharset); |
| 71 | 71 |
| 72 static CFX_ByteString GetDefaultFontByCharset(int32_t nCharset); | 72 static CFX_ByteString GetDefaultFontByCharset(int32_t nCharset); |
| 73 | 73 |
| 74 CPDF_Font* AddFontToDocument(CPDF_Document* pDoc, | 74 CPDF_Font* AddFontToDocument(CPDF_Document* pDoc, |
| 75 CFX_ByteString& sFontName, | 75 CFX_ByteString& sFontName, |
| 76 uint8_t nCharset); | 76 uint8_t nCharset); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 public: | 112 public: |
| 113 using CharsetFontMap = FPDF_CharsetFontMap; | 113 using CharsetFontMap = FPDF_CharsetFontMap; |
| 114 static const CharsetFontMap defaultTTFMap[]; | 114 static const CharsetFontMap defaultTTFMap[]; |
| 115 | 115 |
| 116 protected: | 116 protected: |
| 117 CFX_ArrayTemplate<CPWL_FontMap_Data*> m_aData; | 117 CFX_ArrayTemplate<CPWL_FontMap_Data*> m_aData; |
| 118 CFX_ArrayTemplate<CPWL_FontMap_Native*> m_aNativeFont; | 118 CFX_ArrayTemplate<CPWL_FontMap_Native*> m_aNativeFont; |
| 119 | 119 |
| 120 private: | 120 private: |
| 121 CPDF_Document* m_pPDFDoc; | 121 CPDF_Document* m_pPDFDoc; |
| 122 IFX_SystemHandler* m_pSystemHandler; | 122 CFX_SystemHandler* m_pSystemHandler; |
| 123 }; | 123 }; |
| 124 | 124 |
| 125 class CPWL_DocFontMap : public CPWL_FontMap { | 125 class CPWL_DocFontMap : public CPWL_FontMap { |
| 126 public: | 126 public: |
| 127 CPWL_DocFontMap(IFX_SystemHandler* pSystemHandler, | 127 CPWL_DocFontMap(CFX_SystemHandler* pSystemHandler, |
| 128 CPDF_Document* pAttachedDoc); | 128 CPDF_Document* pAttachedDoc); |
| 129 ~CPWL_DocFontMap() override; | 129 ~CPWL_DocFontMap() override; |
| 130 | 130 |
| 131 private: | 131 private: |
| 132 // CPWL_FontMap: | 132 // CPWL_FontMap: |
| 133 CPDF_Document* GetDocument() override; | 133 CPDF_Document* GetDocument() override; |
| 134 | 134 |
| 135 CPDF_Document* m_pAttachedDoc; | 135 CPDF_Document* m_pAttachedDoc; |
| 136 }; | 136 }; |
| 137 | 137 |
| 138 #endif // FPDFSDK_PDFWINDOW_PWL_FONTMAP_H_ | 138 #endif // FPDFSDK_PDFWINDOW_PWL_FONTMAP_H_ |
| OLD | NEW |