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 <memory> | 10 #include <memory> |
| 11 #include <vector> |
11 | 12 |
12 #include "core/fpdfdoc/ipvt_fontmap.h" | 13 #include "core/fpdfdoc/ipvt_fontmap.h" |
13 #include "core/fxge/fx_font.h" | 14 #include "core/fxge/fx_font.h" |
14 #include "fpdfsdk/fxedit/fx_edit.h" | 15 #include "fpdfsdk/fxedit/fx_edit.h" |
15 #include "public/fpdf_sysfontinfo.h" | 16 #include "public/fpdf_sysfontinfo.h" |
16 | 17 |
17 class CPDF_Document; | 18 class CPDF_Document; |
18 class CFX_SystemHandler; | 19 class CFX_SystemHandler; |
19 | 20 |
20 struct CPWL_FontMap_Data { | 21 struct CPWL_FontMap_Data { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 int32_t nCharset, | 64 int32_t nCharset, |
64 bool bFind); | 65 bool bFind); |
65 int32_t AddFontData(CPDF_Font* pFont, | 66 int32_t AddFontData(CPDF_Font* pFont, |
66 const CFX_ByteString& sFontAlias, | 67 const CFX_ByteString& sFontAlias, |
67 int32_t nCharset = FXFONT_DEFAULT_CHARSET); | 68 int32_t nCharset = FXFONT_DEFAULT_CHARSET); |
68 | 69 |
69 CFX_ByteString EncodeFontAlias(const CFX_ByteString& sFontName, | 70 CFX_ByteString EncodeFontAlias(const CFX_ByteString& sFontName, |
70 int32_t nCharset); | 71 int32_t nCharset); |
71 CFX_ByteString EncodeFontAlias(const CFX_ByteString& sFontName); | 72 CFX_ByteString EncodeFontAlias(const CFX_ByteString& sFontName); |
72 | 73 |
73 CFX_ArrayTemplate<CPWL_FontMap_Data*> m_aData; | 74 std::vector<std::unique_ptr<CPWL_FontMap_Data>> m_Data; |
74 CFX_ArrayTemplate<CPWL_FontMap_Native*> m_aNativeFont; | 75 std::vector<std::unique_ptr<CPWL_FontMap_Native>> m_NativeFont; |
75 | 76 |
76 private: | 77 private: |
77 int32_t FindFont(const CFX_ByteString& sFontName, | 78 int32_t FindFont(const CFX_ByteString& sFontName, |
78 int32_t nCharset = FXFONT_DEFAULT_CHARSET); | 79 int32_t nCharset = FXFONT_DEFAULT_CHARSET); |
79 | 80 |
80 CFX_ByteString GetNativeFont(int32_t nCharset); | 81 CFX_ByteString GetNativeFont(int32_t nCharset); |
81 CPDF_Font* AddFontToDocument(CPDF_Document* pDoc, | 82 CPDF_Font* AddFontToDocument(CPDF_Document* pDoc, |
82 CFX_ByteString& sFontName, | 83 CFX_ByteString& sFontName, |
83 uint8_t nCharset); | 84 uint8_t nCharset); |
84 bool IsStandardFont(const CFX_ByteString& sFontName); | 85 bool IsStandardFont(const CFX_ByteString& sFontName); |
85 CPDF_Font* AddStandardFont(CPDF_Document* pDoc, CFX_ByteString& sFontName); | 86 CPDF_Font* AddStandardFont(CPDF_Document* pDoc, CFX_ByteString& sFontName); |
86 CPDF_Font* AddSystemFont(CPDF_Document* pDoc, | 87 CPDF_Font* AddSystemFont(CPDF_Document* pDoc, |
87 CFX_ByteString& sFontName, | 88 CFX_ByteString& sFontName, |
88 uint8_t nCharset); | 89 uint8_t nCharset); |
89 | 90 |
90 std::unique_ptr<CPDF_Document> m_pPDFDoc; | 91 std::unique_ptr<CPDF_Document> m_pPDFDoc; |
91 CFX_SystemHandler* const m_pSystemHandler; | 92 CFX_SystemHandler* const m_pSystemHandler; |
92 }; | 93 }; |
93 | 94 |
94 #endif // FPDFSDK_PDFWINDOW_PWL_FONTMAP_H_ | 95 #endif // FPDFSDK_PDFWINDOW_PWL_FONTMAP_H_ |
OLD | NEW |