| 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 _PWL_FONTMAP_H_ | 7 #ifndef _PWL_FONTMAP_H_ |
| 8 #define _PWL_FONTMAP_H_ | 8 #define _PWL_FONTMAP_H_ |
| 9 | 9 |
| 10 #include "../../../public/fpdf_sysfontinfo.h" |
| 10 #include "../fxedit/fx_edit.h" | 11 #include "../fxedit/fx_edit.h" |
| 11 | 12 |
| 12 class CPDF_Document; | 13 class CPDF_Document; |
| 13 class IFX_SystemHandler; | 14 class IFX_SystemHandler; |
| 14 | 15 |
| 15 struct CPWL_FontMap_Data | 16 struct CPWL_FontMap_Data |
| 16 { | 17 { |
| 17 CPDF_Font* pFont; | 18 CPDF_Font* pFont; |
| 18 FX_INT32 nCharset; | 19 FX_INT32 nCharset; |
| 19 CFX_ByteString sFontName; | 20 CFX_ByteString sFontName; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 CFX_ByteString
EncodeFontAlias(const CFX_ByteString& sFontName, FX_INT32 nCharset); | 105 CFX_ByteString
EncodeFontAlias(const CFX_ByteString& sFontName, FX_INT32 nCharset); |
| 105 CFX_ByteString
EncodeFontAlias(const CFX_ByteString& sFontName); | 106 CFX_ByteString
EncodeFontAlias(const CFX_ByteString& sFontName); |
| 106 | 107 |
| 107 private: | 108 private: |
| 108 CFX_ByteString
GetFontName(FX_INT32 nFontIndex); | 109 CFX_ByteString
GetFontName(FX_INT32 nFontIndex); |
| 109 FX_INT32
FindFont(const CFX_ByteString& sFontName, FX_INT32 nCharset = DEFAULT_CH
ARSET); | 110 FX_INT32
FindFont(const CFX_ByteString& sFontName, FX_INT32 nCharset = DEFAULT_CH
ARSET); |
| 110 | 111 |
| 111 CFX_ByteString
GetNativeFont(FX_INT32 nCharset); | 112 CFX_ByteString
GetNativeFont(FX_INT32 nCharset); |
| 112 | 113 |
| 113 public: | 114 public: |
| 114 » struct CharsetFontMap { | 115 using CharsetFontMap = FPDF_CharsetFontMap; |
| 115 » » FX_INT32» » » » » » »
» charset; | |
| 116 » » const char*» » » » » » »
» fontname; | |
| 117 » }; | |
| 118 static const CharsetFontMap defaultT
TFMap[]; | 116 static const CharsetFontMap defaultT
TFMap[]; |
| 119 | 117 |
| 120 protected: | 118 protected: |
| 121 CFX_ArrayTemplate<CPWL_FontMap_Data*> m_aData; | 119 CFX_ArrayTemplate<CPWL_FontMap_Data*> m_aData; |
| 122 CFX_ArrayTemplate<CPWL_FontMap_Native*> m_aNativeFont; | 120 CFX_ArrayTemplate<CPWL_FontMap_Native*> m_aNativeFont; |
| 123 | 121 |
| 124 private: | 122 private: |
| 125 CPDF_Document*
m_pPDFDoc; | 123 CPDF_Document*
m_pPDFDoc; |
| 126 IFX_SystemHandler*
m_pSystemHandler; | 124 IFX_SystemHandler*
m_pSystemHandler; |
| 127 }; | 125 }; |
| 128 | 126 |
| 129 class PWL_CLASS CPWL_DocFontMap : public CPWL_FontMap | 127 class PWL_CLASS CPWL_DocFontMap : public CPWL_FontMap |
| 130 { | 128 { |
| 131 public: | 129 public: |
| 132 CPWL_DocFontMap(IFX_SystemHandler* pSystemHandler, CPDF_Document* pAttac
hedDoc); | 130 CPWL_DocFontMap(IFX_SystemHandler* pSystemHandler, CPDF_Document* pAttac
hedDoc); |
| 133 virtual ~CPWL_DocFontMap(); | 131 virtual ~CPWL_DocFontMap(); |
| 134 | 132 |
| 135 virtual CPDF_Document* GetDocum
ent(); | 133 virtual CPDF_Document* GetDocum
ent(); |
| 136 | 134 |
| 137 private: | 135 private: |
| 138 CPDF_Document*
m_pAttachedDoc; | 136 CPDF_Document*
m_pAttachedDoc; |
| 139 }; | 137 }; |
| 140 | 138 |
| 141 #endif | 139 #endif |
| OLD | NEW |