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 "xfa/fxfa/include/xfa_fontmgr.h" | 7 #include "xfa/fxfa/include/xfa_fontmgr.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <utility> | 10 #include <utility> |
(...skipping 1851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1862 return NULL; | 1862 return NULL; |
1863 } | 1863 } |
1864 CPDF_Font* pPDFFont = pDoc->LoadFont(pFontDict); | 1864 CPDF_Font* pPDFFont = pDoc->LoadFont(pFontDict); |
1865 if (!pPDFFont) { | 1865 if (!pPDFFont) { |
1866 return NULL; | 1866 return NULL; |
1867 } | 1867 } |
1868 if (!pPDFFont->IsEmbedded()) { | 1868 if (!pPDFFont->IsEmbedded()) { |
1869 *pDstPDFFont = pPDFFont; | 1869 *pDstPDFFont = pPDFFont; |
1870 return NULL; | 1870 return NULL; |
1871 } | 1871 } |
1872 return CFGAS_GEFont::LoadFont(&pPDFFont->m_Font, pFDEFontMgr, FALSE); | 1872 return CFGAS_GEFont::LoadFont(&pPDFFont->m_Font, pFDEFontMgr); |
1873 } | 1873 } |
1874 return NULL; | 1874 return NULL; |
1875 } | 1875 } |
1876 | 1876 |
1877 CFGAS_GEFont* CXFA_PDFFontMgr::GetFont(const CFX_WideStringC& wsFontFamily, | 1877 CFGAS_GEFont* CXFA_PDFFontMgr::GetFont(const CFX_WideStringC& wsFontFamily, |
1878 uint32_t dwFontStyles, | 1878 uint32_t dwFontStyles, |
1879 CPDF_Font** pPDFFont, | 1879 CPDF_Font** pPDFFont, |
1880 FX_BOOL bStrictMatch) { | 1880 FX_BOOL bStrictMatch) { |
1881 uint32_t dwHashCode = FX_HashCode_GetW(wsFontFamily, false); | 1881 uint32_t dwHashCode = FX_HashCode_GetW(wsFontFamily, false); |
1882 CFX_ByteString strKey; | 1882 CFX_ByteString strKey; |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2055 m_PDFFontMgrMap[hDoc].reset(new CXFA_PDFFontMgr(hDoc)); | 2055 m_PDFFontMgrMap[hDoc].reset(new CXFA_PDFFontMgr(hDoc)); |
2056 } | 2056 } |
2057 | 2057 |
2058 void CXFA_FontMgr::ReleaseDocFonts(CXFA_FFDoc* hDoc) { | 2058 void CXFA_FontMgr::ReleaseDocFonts(CXFA_FFDoc* hDoc) { |
2059 m_PDFFontMgrMap.erase(hDoc); | 2059 m_PDFFontMgrMap.erase(hDoc); |
2060 } | 2060 } |
2061 | 2061 |
2062 void CXFA_FontMgr::SetDefFontMgr(std::unique_ptr<CXFA_DefFontMgr> pFontMgr) { | 2062 void CXFA_FontMgr::SetDefFontMgr(std::unique_ptr<CXFA_DefFontMgr> pFontMgr) { |
2063 m_pDefFontMgr = std::move(pFontMgr); | 2063 m_pDefFontMgr = std::move(pFontMgr); |
2064 } | 2064 } |
OLD | NEW |