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

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

Issue 2347313002: Remove duplicated charset definitions (Closed)
Patch Set: Nits Created 4 years, 3 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/ge/cfx_folderfontinfo.cpp ('k') | core/fxge/ge/fx_ge_linux.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 <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 if (nStyle & FX_FONT_STYLE_Italic) 571 if (nStyle & FX_FONT_STYLE_Italic)
572 bItalic = true; 572 bItalic = true;
573 int iExact = 0; 573 int iExact = 0;
574 int Charset = FXFONT_ANSI_CHARSET; 574 int Charset = FXFONT_ANSI_CHARSET;
575 if (WindowCP) 575 if (WindowCP)
576 Charset = GetCharsetFromCodePage(WindowCP); 576 Charset = GetCharsetFromCodePage(WindowCP);
577 else if (iBaseFont == kExternalFontIndex && (flags & FXFONT_SYMBOLIC)) 577 else if (iBaseFont == kExternalFontIndex && (flags & FXFONT_SYMBOLIC))
578 Charset = FXFONT_SYMBOL_CHARSET; 578 Charset = FXFONT_SYMBOL_CHARSET;
579 bool bCJK = 579 bool bCJK =
580 (Charset == FXFONT_SHIFTJIS_CHARSET || Charset == FXFONT_GB2312_CHARSET || 580 (Charset == FXFONT_SHIFTJIS_CHARSET || Charset == FXFONT_GB2312_CHARSET ||
581 Charset == FXFONT_HANGEUL_CHARSET || 581 Charset == FXFONT_HANGUL_CHARSET ||
582 Charset == FXFONT_CHINESEBIG5_CHARSET); 582 Charset == FXFONT_CHINESEBIG5_CHARSET);
583 if (!m_pFontInfo) { 583 if (!m_pFontInfo) {
584 pSubstFont->m_SubstFlags |= FXFONT_SUBST_STANDARD; 584 pSubstFont->m_SubstFlags |= FXFONT_SUBST_STANDARD;
585 return UseInternalSubst(pSubstFont, iBaseFont, italic_angle, old_weight, 585 return UseInternalSubst(pSubstFont, iBaseFont, italic_angle, old_weight,
586 PitchFamily); 586 PitchFamily);
587 } 587 }
588 family = GetFontFamily(family, nStyle); 588 family = GetFontFamily(family, nStyle);
589 CFX_ByteString match = MatchInstalledFonts(TT_NormalizeName(family.c_str())); 589 CFX_ByteString match = MatchInstalledFonts(TT_NormalizeName(family.c_str()));
590 if (match.IsEmpty() && family != SubstName && 590 if (match.IsEmpty() && family != SubstName &&
591 (!bHasComma && (!bHasHyphen || (bHasHyphen && !bStyleAvail)))) { 591 (!bHasComma && (!bHasHyphen || (bHasHyphen && !bStyleAvail)))) {
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 int PDF_GetStandardFontName(CFX_ByteString* name) { 825 int PDF_GetStandardFontName(CFX_ByteString* name) {
826 AltFontName* found = static_cast<AltFontName*>( 826 AltFontName* found = static_cast<AltFontName*>(
827 FXSYS_bsearch(name->c_str(), g_AltFontNames, FX_ArraySize(g_AltFontNames), 827 FXSYS_bsearch(name->c_str(), g_AltFontNames, FX_ArraySize(g_AltFontNames),
828 sizeof(AltFontName), CompareString)); 828 sizeof(AltFontName), CompareString));
829 if (!found) 829 if (!found)
830 return -1; 830 return -1;
831 831
832 *name = g_Base14FontNames[found->m_Index]; 832 *name = g_Base14FontNames[found->m_Index];
833 return found->m_Index; 833 return found->m_Index;
834 } 834 }
OLDNEW
« no previous file with comments | « core/fxge/ge/cfx_folderfontinfo.cpp ('k') | core/fxge/ge/fx_ge_linux.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698