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 #include "fpdfsdk/include/pdfwindow/PDFWindow.h" | 7 #include "fpdfsdk/include/pdfwindow/PDFWindow.h" |
8 #include "fpdfsdk/include/pdfwindow/PWL_FontMap.h" | 8 #include "fpdfsdk/include/pdfwindow/PWL_FontMap.h" |
9 #include "fpdfsdk/include/pdfwindow/PWL_Wnd.h" | 9 #include "fpdfsdk/include/pdfwindow/PWL_Wnd.h" |
10 | 10 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 m_aData.RemoveAll(); | 144 m_aData.RemoveAll(); |
145 } | 145 } |
146 { | 146 { |
147 for (int32_t i = 0, sz = m_aNativeFont.GetSize(); i < sz; i++) | 147 for (int32_t i = 0, sz = m_aNativeFont.GetSize(); i < sz; i++) |
148 delete m_aNativeFont.GetAt(i); | 148 delete m_aNativeFont.GetAt(i); |
149 | 149 |
150 m_aNativeFont.RemoveAll(); | 150 m_aNativeFont.RemoveAll(); |
151 } | 151 } |
152 } | 152 } |
153 | 153 |
154 void CPWL_FontMap::Initial(const FX_CHAR* fontname) { | 154 void CPWL_FontMap::Initialize() { |
155 CFX_ByteString sFontName = fontname; | 155 GetFontIndex(DEFAULT_FONT_NAME, ANSI_CHARSET, FALSE); |
156 | |
157 if (sFontName.IsEmpty()) | |
158 sFontName = DEFAULT_FONT_NAME; | |
159 | |
160 GetFontIndex(sFontName, ANSI_CHARSET, FALSE); | |
161 } | 156 } |
162 | 157 |
163 /* | 158 /* |
164 List of currently supported standard fonts: | 159 List of currently supported standard fonts: |
165 Courier, Courier-Bold, Courier-BoldOblique, Courier-Oblique | 160 Courier, Courier-Bold, Courier-BoldOblique, Courier-Oblique |
166 Helvetica, Helvetica-Bold, Helvetica-BoldOblique, Helvetica-Oblique | 161 Helvetica, Helvetica-Bold, Helvetica-BoldOblique, Helvetica-Oblique |
167 Times-Roman, Times-Bold, Times-Italic, Times-BoldItalic | 162 Times-Roman, Times-Bold, Times-Italic, Times-BoldItalic |
168 Symbol, ZapfDingbats | 163 Symbol, ZapfDingbats |
169 */ | 164 */ |
170 | 165 |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 | 503 |
509 CPWL_DocFontMap::CPWL_DocFontMap(IFX_SystemHandler* pSystemHandler, | 504 CPWL_DocFontMap::CPWL_DocFontMap(IFX_SystemHandler* pSystemHandler, |
510 CPDF_Document* pAttachedDoc) | 505 CPDF_Document* pAttachedDoc) |
511 : CPWL_FontMap(pSystemHandler), m_pAttachedDoc(pAttachedDoc) {} | 506 : CPWL_FontMap(pSystemHandler), m_pAttachedDoc(pAttachedDoc) {} |
512 | 507 |
513 CPWL_DocFontMap::~CPWL_DocFontMap() {} | 508 CPWL_DocFontMap::~CPWL_DocFontMap() {} |
514 | 509 |
515 CPDF_Document* CPWL_DocFontMap::GetDocument() { | 510 CPDF_Document* CPWL_DocFontMap::GetDocument() { |
516 return m_pAttachedDoc; | 511 return m_pAttachedDoc; |
517 } | 512 } |
OLD | NEW |