| 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 "core/fpdfapi/fpdf_parser/include/cpdf_document.h" | 7 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 832 return; | 832 return; |
| 833 | 833 |
| 834 m_PageList.RemoveAt(iPage); | 834 m_PageList.RemoveAt(iPage); |
| 835 } | 835 } |
| 836 | 836 |
| 837 CPDF_Font* CPDF_Document::AddStandardFont(const FX_CHAR* font, | 837 CPDF_Font* CPDF_Document::AddStandardFont(const FX_CHAR* font, |
| 838 CPDF_FontEncoding* pEncoding) { | 838 CPDF_FontEncoding* pEncoding) { |
| 839 CFX_ByteString name(font); | 839 CFX_ByteString name(font); |
| 840 if (PDF_GetStandardFontName(&name) < 0) | 840 if (PDF_GetStandardFontName(&name) < 0) |
| 841 return nullptr; | 841 return nullptr; |
| 842 return GetPageData()->GetStandardFont(name.AsStringC(), pEncoding); | 842 return GetPageData()->GetStandardFont(name, pEncoding); |
| 843 } | 843 } |
| 844 | 844 |
| 845 CPDF_Font* CPDF_Document::AddFont(CFX_Font* pFont, int charset, FX_BOOL bVert) { | 845 CPDF_Font* CPDF_Document::AddFont(CFX_Font* pFont, int charset, FX_BOOL bVert) { |
| 846 if (!pFont) | 846 if (!pFont) |
| 847 return nullptr; | 847 return nullptr; |
| 848 | 848 |
| 849 bool bCJK = charset == FXFONT_CHINESEBIG5_CHARSET || | 849 bool bCJK = charset == FXFONT_CHINESEBIG5_CHARSET || |
| 850 charset == FXFONT_GB2312_CHARSET || | 850 charset == FXFONT_GB2312_CHARSET || |
| 851 charset == FXFONT_HANGEUL_CHARSET || | 851 charset == FXFONT_HANGEUL_CHARSET || |
| 852 charset == FXFONT_SHIFTJIS_CHARSET; | 852 charset == FXFONT_SHIFTJIS_CHARSET; |
| (...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1439 } | 1439 } |
| 1440 } | 1440 } |
| 1441 pFontDesc->SetAtInteger("StemV", fStemV); | 1441 pFontDesc->SetAtInteger("StemV", fStemV); |
| 1442 AddIndirectObject(pFontDesc); | 1442 AddIndirectObject(pFontDesc); |
| 1443 pFontDict->SetAtReference("FontDescriptor", this, pFontDesc); | 1443 pFontDict->SetAtReference("FontDescriptor", this, pFontDesc); |
| 1444 CFRelease(traits); | 1444 CFRelease(traits); |
| 1445 CFRelease(languages); | 1445 CFRelease(languages); |
| 1446 return LoadFont(pBaseDict); | 1446 return LoadFont(pBaseDict); |
| 1447 } | 1447 } |
| 1448 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ | 1448 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ |
| OLD | NEW |