| 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/pdfwindow/PWL_FontMap.h" | 7 #include "fpdfsdk/pdfwindow/PWL_FontMap.h" |
| 8 | 8 |
| 9 #include "core/fpdfapi/fpdf_font/include/cpdf_font.h" | 9 #include "core/fpdfapi/fpdf_font/include/cpdf_font.h" |
| 10 #include "core/fpdfapi/fpdf_font/include/cpdf_fontencoding.h" | 10 #include "core/fpdfapi/fpdf_font/include/cpdf_fontencoding.h" |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 } | 299 } |
| 300 | 300 |
| 301 CPDF_Font* CPWL_FontMap::AddStandardFont(CPDF_Document* pDoc, | 301 CPDF_Font* CPWL_FontMap::AddStandardFont(CPDF_Document* pDoc, |
| 302 CFX_ByteString& sFontName) { | 302 CFX_ByteString& sFontName) { |
| 303 if (!pDoc) | 303 if (!pDoc) |
| 304 return NULL; | 304 return NULL; |
| 305 | 305 |
| 306 CPDF_Font* pFont = NULL; | 306 CPDF_Font* pFont = NULL; |
| 307 | 307 |
| 308 if (sFontName == "ZapfDingbats") { | 308 if (sFontName == "ZapfDingbats") { |
| 309 pFont = pDoc->AddStandardFont(sFontName, NULL); | 309 pFont = pDoc->AddStandardFont(sFontName.c_str(), NULL); |
| 310 } else { | 310 } else { |
| 311 CPDF_FontEncoding fe(PDFFONT_ENCODING_WINANSI); | 311 CPDF_FontEncoding fe(PDFFONT_ENCODING_WINANSI); |
| 312 pFont = pDoc->AddStandardFont(sFontName, &fe); | 312 pFont = pDoc->AddStandardFont(sFontName.c_str(), &fe); |
| 313 } | 313 } |
| 314 | 314 |
| 315 return pFont; | 315 return pFont; |
| 316 } | 316 } |
| 317 | 317 |
| 318 CPDF_Font* CPWL_FontMap::AddSystemFont(CPDF_Document* pDoc, | 318 CPDF_Font* CPWL_FontMap::AddSystemFont(CPDF_Document* pDoc, |
| 319 CFX_ByteString& sFontName, | 319 CFX_ByteString& sFontName, |
| 320 uint8_t nCharset) { | 320 uint8_t nCharset) { |
| 321 if (!pDoc) | 321 if (!pDoc) |
| 322 return NULL; | 322 return NULL; |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 | 493 |
| 494 CPWL_DocFontMap::CPWL_DocFontMap(IFX_SystemHandler* pSystemHandler, | 494 CPWL_DocFontMap::CPWL_DocFontMap(IFX_SystemHandler* pSystemHandler, |
| 495 CPDF_Document* pAttachedDoc) | 495 CPDF_Document* pAttachedDoc) |
| 496 : CPWL_FontMap(pSystemHandler), m_pAttachedDoc(pAttachedDoc) {} | 496 : CPWL_FontMap(pSystemHandler), m_pAttachedDoc(pAttachedDoc) {} |
| 497 | 497 |
| 498 CPWL_DocFontMap::~CPWL_DocFontMap() {} | 498 CPWL_DocFontMap::~CPWL_DocFontMap() {} |
| 499 | 499 |
| 500 CPDF_Document* CPWL_DocFontMap::GetDocument() { | 500 CPDF_Document* CPWL_DocFontMap::GetDocument() { |
| 501 return m_pAttachedDoc; | 501 return m_pAttachedDoc; |
| 502 } | 502 } |
| OLD | NEW |