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_INCLUDE_PDFWINDOW_PWL_FONTMAP_H_ | 7 #ifndef FPDFSDK_INCLUDE_PDFWINDOW_PWL_FONTMAP_H_ |
8 #define FPDFSDK_INCLUDE_PDFWINDOW_PWL_FONTMAP_H_ | 8 #define FPDFSDK_INCLUDE_PDFWINDOW_PWL_FONTMAP_H_ |
9 | 9 |
10 #include "../../../public/fpdf_sysfontinfo.h" | 10 #include "../../../public/fpdf_sysfontinfo.h" |
11 #include "../fxedit/fx_edit.h" | 11 #include "../fxedit/fx_edit.h" |
12 | 12 |
13 class CPDF_Document; | 13 class CPDF_Document; |
14 class IFX_SystemHandler; | 14 class IFX_SystemHandler; |
15 | 15 |
16 struct CPWL_FontMap_Data | 16 struct CPWL_FontMap_Data |
17 { | 17 { |
18 CPDF_Font* pFont; | 18 CPDF_Font* pFont; |
19 » FX_INT32» » » 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 { | 24 { |
25 » FX_INT32» » » nCharset; | 25 » int32_t»» » nCharset; |
26 CFX_ByteString sFontName; | 26 CFX_ByteString sFontName; |
27 }; | 27 }; |
28 | 28 |
29 #ifndef ANSI_CHARSET | 29 #ifndef ANSI_CHARSET |
30 | 30 |
31 #define ANSI_CHARSET 0 | 31 #define ANSI_CHARSET 0 |
32 #define DEFAULT_CHARSET 1 | 32 #define DEFAULT_CHARSET 1 |
33 #define SYMBOL_CHARSET 2 | 33 #define SYMBOL_CHARSET 2 |
34 #define SHIFTJIS_CHARSET 128 | 34 #define SHIFTJIS_CHARSET 128 |
35 #define HANGEUL_CHARSET 129 | 35 #define HANGEUL_CHARSET 129 |
(...skipping 22 matching lines...) Expand all Loading... |
58 #define PWL_CLASS | 58 #define PWL_CLASS |
59 #endif | 59 #endif |
60 #endif | 60 #endif |
61 | 61 |
62 class PWL_CLASS CPWL_FontMap : public IFX_Edit_FontMap | 62 class PWL_CLASS CPWL_FontMap : public IFX_Edit_FontMap |
63 { | 63 { |
64 public: | 64 public: |
65 CPWL_FontMap(IFX_SystemHandler* pSystemHandler); | 65 CPWL_FontMap(IFX_SystemHandler* pSystemHandler); |
66 virtual ~CPWL_FontMap(); | 66 virtual ~CPWL_FontMap(); |
67 | 67 |
68 » virtual CPDF_Font*» » » » » » »
GetPDFFont(FX_INT32 nFontIndex); | 68 » virtual CPDF_Font*» » » » » » »
GetPDFFont(int32_t nFontIndex); |
69 » virtual CFX_ByteString» » » » » » GetPDFFo
ntAlias(FX_INT32 nFontIndex); | 69 » virtual CFX_ByteString» » » » » » GetPDFFo
ntAlias(int32_t nFontIndex); |
70 » virtual FX_INT32» » » » » » »
GetWordFontIndex(FX_WORD word, FX_INT32 nCharset, FX_INT32 nFontIndex); | 70 » virtual int32_t»» » » » » » GetWordF
ontIndex(FX_WORD word, int32_t nCharset, int32_t nFontIndex); |
71 » virtual FX_INT32» » » » » » »
CharCodeFromUnicode(FX_INT32 nFontIndex, FX_WORD word); | 71 » virtual int32_t»» » » » » » CharCode
FromUnicode(int32_t nFontIndex, FX_WORD word); |
72 » virtual FX_INT32» » » » » » »
CharSetFromUnicode(FX_WORD word, FX_INT32 nOldCharset); | 72 » virtual int32_t»» » » » » » CharSetF
romUnicode(FX_WORD word, int32_t nOldCharset); |
73 | 73 |
74 public: | 74 public: |
75 virtual void
Initial(FX_LPCSTR fontname = NULL); | 75 virtual void
Initial(FX_LPCSTR fontname = NULL); |
76 void
SetSystemHandler(IFX_SystemHandler* pSystemHandler); | 76 void
SetSystemHandler(IFX_SystemHandler* pSystemHandler); |
77 | 77 |
78 » FX_INT32» » » » » » » »
» GetFontMapCount() const; | 78 » int32_t»» » » » » » » »
GetFontMapCount() const; |
79 » const CPWL_FontMap_Data*» » » » » GetFontM
apData(FX_INT32 nIndex) const; | 79 » const CPWL_FontMap_Data*» » » » » GetFontM
apData(int32_t nIndex) const; |
80 | 80 |
81 public: | 81 public: |
82 » static FX_INT32»» » » » » » »
GetNativeCharset(); | 82 » static int32_t» » » » » » » »
GetNativeCharset(); |
83 » CFX_ByteString» » » » » » » »
GetNativeFontName(FX_INT32 nCharset); | 83 » CFX_ByteString» » » » » » » »
GetNativeFontName(int32_t nCharset); |
84 | 84 |
85 » static CFX_ByteString» » » » » » GetDefau
ltFontByCharset(FX_INT32 nCharset); | 85 » static CFX_ByteString» » » » » » GetDefau
ltFontByCharset(int32_t nCharset); |
86 | 86 |
87 » CPDF_Font*» » » » » » » »
» AddFontToDocument(CPDF_Document* pDoc, CFX_ByteString& sFontName, FX_BYT
E nCharset); | 87 » CPDF_Font*» » » » » » » »
» AddFontToDocument(CPDF_Document* pDoc, CFX_ByteString& sFontName, uint8_
t nCharset); |
88 static FX_BOOL
IsStandardFont(const CFX_ByteString& sFontName);
| 88 static FX_BOOL
IsStandardFont(const CFX_ByteString& sFontName);
|
89 CPDF_Font*
AddStandardFont(CPDF_Document* pDoc, CFX_ByteString& sFontName); | 89 CPDF_Font*
AddStandardFont(CPDF_Document* pDoc, CFX_ByteString& sFontName); |
90 CPDF_Font*
AddSystemFont(CPDF_Document* pDoc, CFX_ByteString& sFontName, | 90 CPDF_Font*
AddSystemFont(CPDF_Document* pDoc, CFX_ByteString& sFontName, |
91 » » » » » » » » » »
» » » FX_BYTE nCharset); | 91 » » » » » » » » » »
» » » uint8_t nCharset); |
92 | 92 |
93 protected: | 93 protected: |
94 » virtual CPDF_Font*» » » » » » »
FindFontSameCharset(CFX_ByteString& sFontAlias, FX_INT32 nCharset); | 94 » virtual CPDF_Font*» » » » » » »
FindFontSameCharset(CFX_ByteString& sFontAlias, int32_t nCharset); |
95 virtual void
AddedFont(CPDF_Font* pFont, const CFX_ByteString& sFontAlias); | 95 virtual void
AddedFont(CPDF_Font* pFont, const CFX_ByteString& sFontAlias); |
96 » FX_BOOL»» » » » » » » »
» KnowWord(FX_INT32 nFontIndex, FX_WORD word); | 96 » FX_BOOL»» » » » » » » »
» KnowWord(int32_t nFontIndex, FX_WORD word); |
97 | 97 |
98 virtual CPDF_Document* GetDocum
ent(); | 98 virtual CPDF_Document* GetDocum
ent(); |
99 | 99 |
100 void
Empty(); | 100 void
Empty(); |
101 » FX_INT32» » » » » » » »
» GetFontIndex(const CFX_ByteString& sFontName, FX_INT32 nCharset, FX_BOOL
bFind); | 101 » int32_t»» » » » » » » »
GetFontIndex(const CFX_ByteString& sFontName, int32_t nCharset, FX_BOOL bFind); |
102 » FX_INT32» » » » » » » »
» GetPWLFontIndex(FX_WORD word, FX_INT32 nCharset); | 102 » int32_t»» » » » » » » »
GetPWLFontIndex(FX_WORD word, int32_t nCharset); |
103 » FX_INT32» » » » » » » »
» AddFontData(CPDF_Font* pFont, const CFX_ByteString& sFontAlias, FX_INT32
nCharset = DEFAULT_CHARSET); | 103 » int32_t»» » » » » » » »
AddFontData(CPDF_Font* pFont, const CFX_ByteString& sFontAlias, int32_t nCharset
= DEFAULT_CHARSET); |
104 | 104 |
105 » CFX_ByteString» » » » » » » »
EncodeFontAlias(const CFX_ByteString& sFontName, FX_INT32 nCharset); | 105 » CFX_ByteString» » » » » » » »
EncodeFontAlias(const CFX_ByteString& sFontName, int32_t nCharset); |
106 CFX_ByteString
EncodeFontAlias(const CFX_ByteString& sFontName); | 106 CFX_ByteString
EncodeFontAlias(const CFX_ByteString& sFontName); |
107 | 107 |
108 private: | 108 private: |
109 » CFX_ByteString» » » » » » » »
GetFontName(FX_INT32 nFontIndex); | 109 » CFX_ByteString» » » » » » » »
GetFontName(int32_t nFontIndex); |
110 » FX_INT32» » » » » » » »
» FindFont(const CFX_ByteString& sFontName, FX_INT32 nCharset = DEFAULT_CH
ARSET); | 110 » int32_t»» » » » » » » »
FindFont(const CFX_ByteString& sFontName, int32_t nCharset = DEFAULT_CHARSET); |
111 | 111 |
112 » CFX_ByteString» » » » » » » »
GetNativeFont(FX_INT32 nCharset); | 112 » CFX_ByteString» » » » » » » »
GetNativeFont(int32_t nCharset); |
113 | 113 |
114 public: | 114 public: |
115 using CharsetFontMap = FPDF_CharsetFontMap; | 115 using CharsetFontMap = FPDF_CharsetFontMap; |
116 static const CharsetFontMap defaultT
TFMap[]; | 116 static const CharsetFontMap defaultT
TFMap[]; |
117 | 117 |
118 protected: | 118 protected: |
119 CFX_ArrayTemplate<CPWL_FontMap_Data*> m_aData; | 119 CFX_ArrayTemplate<CPWL_FontMap_Data*> m_aData; |
120 CFX_ArrayTemplate<CPWL_FontMap_Native*> m_aNativeFont; | 120 CFX_ArrayTemplate<CPWL_FontMap_Native*> m_aNativeFont; |
121 | 121 |
122 private: | 122 private: |
123 CPDF_Document*
m_pPDFDoc; | 123 CPDF_Document*
m_pPDFDoc; |
124 IFX_SystemHandler*
m_pSystemHandler; | 124 IFX_SystemHandler*
m_pSystemHandler; |
125 }; | 125 }; |
126 | 126 |
127 class PWL_CLASS CPWL_DocFontMap : public CPWL_FontMap | 127 class PWL_CLASS CPWL_DocFontMap : public CPWL_FontMap |
128 { | 128 { |
129 public: | 129 public: |
130 CPWL_DocFontMap(IFX_SystemHandler* pSystemHandler, CPDF_Document* pAttac
hedDoc); | 130 CPWL_DocFontMap(IFX_SystemHandler* pSystemHandler, CPDF_Document* pAttac
hedDoc); |
131 virtual ~CPWL_DocFontMap(); | 131 virtual ~CPWL_DocFontMap(); |
132 | 132 |
133 virtual CPDF_Document* GetDocum
ent(); | 133 virtual CPDF_Document* GetDocum
ent(); |
134 | 134 |
135 private: | 135 private: |
136 CPDF_Document*
m_pAttachedDoc; | 136 CPDF_Document*
m_pAttachedDoc; |
137 }; | 137 }; |
138 | 138 |
139 #endif // FPDFSDK_INCLUDE_PDFWINDOW_PWL_FONTMAP_H_ | 139 #endif // FPDFSDK_INCLUDE_PDFWINDOW_PWL_FONTMAP_H_ |
OLD | NEW |