Chromium Code Reviews| 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 <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "../../../include/fxge/fx_ge.h" | 9 #include "../../../include/fxge/fx_ge.h" |
| 10 #include "../../../include/fxge/fx_freetype.h" | 10 #include "../../../include/fxge/fx_freetype.h" |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 406 CFX_FontMapper::CFX_FontMapper(CFX_FontMgr* mgr) | 406 CFX_FontMapper::CFX_FontMapper(CFX_FontMgr* mgr) |
| 407 : m_bListLoaded(FALSE), | 407 : m_bListLoaded(FALSE), |
| 408 m_pFontInfo(nullptr), | 408 m_pFontInfo(nullptr), |
| 409 m_pFontEnumerator(nullptr), | 409 m_pFontEnumerator(nullptr), |
| 410 m_pFontMgr(mgr) { | 410 m_pFontMgr(mgr) { |
| 411 m_MMFaces[0] = nullptr; | 411 m_MMFaces[0] = nullptr; |
| 412 m_MMFaces[1] = nullptr; | 412 m_MMFaces[1] = nullptr; |
| 413 FXSYS_memset(m_FoxitFaces, 0, sizeof(m_FoxitFaces)); | 413 FXSYS_memset(m_FoxitFaces, 0, sizeof(m_FoxitFaces)); |
| 414 } | 414 } |
| 415 CFX_FontMapper::~CFX_FontMapper() { | 415 CFX_FontMapper::~CFX_FontMapper() { |
| 416 for (int i = 0; i < 14; i++) | 416 for (size_t i = 0; i < FX_ArraySize(m_FoxitFaces); ++i) { |
| 417 if (m_FoxitFaces[i]) { | 417 if (m_FoxitFaces[i]) |
| 418 FXFT_Done_Face(m_FoxitFaces[i]); | 418 FXFT_Done_Face(m_FoxitFaces[i]); |
|
Lei Zhang
2015/10/26 22:35:07
(For later) FT_Done_Face() checks its input, so we
| |
| 419 } | 419 } |
| 420 if (m_MMFaces[0]) { | 420 if (m_MMFaces[0]) { |
| 421 FXFT_Done_Face(m_MMFaces[0]); | 421 FXFT_Done_Face(m_MMFaces[0]); |
| 422 } | 422 } |
| 423 if (m_MMFaces[1]) { | 423 if (m_MMFaces[1]) { |
| 424 FXFT_Done_Face(m_MMFaces[1]); | 424 FXFT_Done_Face(m_MMFaces[1]); |
| 425 } | 425 } |
| 426 if (m_pFontInfo) { | 426 if (m_pFontInfo) { |
| 427 m_pFontInfo->Release(); | 427 m_pFontInfo->Release(); |
| 428 } | 428 } |
| 429 } | 429 } |
| (...skipping 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1534 int PDF_GetStandardFontName(CFX_ByteString* name) { | 1534 int PDF_GetStandardFontName(CFX_ByteString* name) { |
| 1535 AltFontName* found = static_cast<AltFontName*>( | 1535 AltFontName* found = static_cast<AltFontName*>( |
| 1536 FXSYS_bsearch(name->c_str(), g_AltFontNames, FX_ArraySize(g_AltFontNames), | 1536 FXSYS_bsearch(name->c_str(), g_AltFontNames, FX_ArraySize(g_AltFontNames), |
| 1537 sizeof(AltFontName), compareString)); | 1537 sizeof(AltFontName), compareString)); |
| 1538 if (!found) | 1538 if (!found) |
| 1539 return -1; | 1539 return -1; |
| 1540 | 1540 |
| 1541 *name = g_Base14FontNames[found->m_Index]; | 1541 *name = g_Base14FontNames[found->m_Index]; |
| 1542 return found->m_Index; | 1542 return found->m_Index; |
| 1543 } | 1543 } |
| OLD | NEW |