Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Side by Side Diff: core/fxge/ge/cfx_fontmapper.cpp

Issue 2252833002: Delete m_ExtHandle and RetainFont (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/fxge/android/fx_android_font.cpp ('k') | core/fxge/ge/fx_ge_font.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 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/fxge/include/cfx_fontmapper.h" 7 #include "core/fxge/include/cfx_fontmapper.h"
8 8
9 #include "core/fxge/include/ifx_systemfontinfo.h" 9 #include "core/fxge/include/ifx_systemfontinfo.h"
10 #include "core/fxge/include/fx_font.h" 10 #include "core/fxge/include/fx_font.h"
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 [Charset](const FaceData& face) { 682 [Charset](const FaceData& face) {
683 return face.charset == static_cast<uint32_t>(Charset); 683 return face.charset == static_cast<uint32_t>(Charset);
684 }); 684 });
685 if (it == m_FaceArray.end()) { 685 if (it == m_FaceArray.end()) {
686 return UseInternalSubst(pSubstFont, iBaseFont, italic_angle, old_weight, 686 return UseInternalSubst(pSubstFont, iBaseFont, italic_angle, old_weight,
687 PitchFamily); 687 PitchFamily);
688 } 688 }
689 hFont = m_pFontInfo->GetFont(it->name.c_str()); 689 hFont = m_pFontInfo->GetFont(it->name.c_str());
690 } 690 }
691 } 691 }
692 pSubstFont->m_ExtHandle = m_pFontInfo->RetainFont(hFont);
693 if (!hFont) 692 if (!hFont)
694 return nullptr; 693 return nullptr;
695 694
696 m_pFontInfo->GetFaceName(hFont, SubstName); 695 m_pFontInfo->GetFaceName(hFont, SubstName);
697 if (Charset == FXFONT_DEFAULT_CHARSET) 696 if (Charset == FXFONT_DEFAULT_CHARSET)
698 m_pFontInfo->GetFontCharset(hFont, Charset); 697 m_pFontInfo->GetFontCharset(hFont, Charset);
699 uint32_t ttc_size = m_pFontInfo->GetFontData(hFont, kTableTTCF, nullptr, 0); 698 uint32_t ttc_size = m_pFontInfo->GetFontData(hFont, kTableTTCF, nullptr, 0);
700 uint32_t font_size = m_pFontInfo->GetFontData(hFont, 0, nullptr, 0); 699 uint32_t font_size = m_pFontInfo->GetFontData(hFont, 0, nullptr, 0);
701 if (font_size == 0 && ttc_size == 0) { 700 if (font_size == 0 && ttc_size == 0) {
702 m_pFontInfo->DeleteFont(hFont); 701 m_pFontInfo->DeleteFont(hFont);
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
832 int PDF_GetStandardFontName(CFX_ByteString* name) { 831 int PDF_GetStandardFontName(CFX_ByteString* name) {
833 AltFontName* found = static_cast<AltFontName*>( 832 AltFontName* found = static_cast<AltFontName*>(
834 FXSYS_bsearch(name->c_str(), g_AltFontNames, FX_ArraySize(g_AltFontNames), 833 FXSYS_bsearch(name->c_str(), g_AltFontNames, FX_ArraySize(g_AltFontNames),
835 sizeof(AltFontName), CompareString)); 834 sizeof(AltFontName), CompareString));
836 if (!found) 835 if (!found)
837 return -1; 836 return -1;
838 837
839 *name = g_Base14FontNames[found->m_Index]; 838 *name = g_Base14FontNames[found->m_Index];
840 return found->m_Index; 839 return found->m_Index;
841 } 840 }
OLDNEW
« no previous file with comments | « core/fxge/android/fx_android_font.cpp ('k') | core/fxge/ge/fx_ge_font.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698