diff options
author | Lei Zhang <thestig@chromium.org> | 2018-05-22 13:23:10 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-05-22 13:23:10 +0000 |
commit | b9d556e4282329c7bf6a0710ce6d742467e44e84 (patch) | |
tree | b716e4068fe9c3371480da53e49b684a417ab0b8 /core | |
parent | 588a35b1db1e03721af62a02ec910c7583b7118a (diff) | |
download | pdfium-b9d556e4282329c7bf6a0710ce6d742467e44e84.tar.xz |
Declare some variables closer to when used in CFX_FontMapper.
Change-Id: I06ca9eb7e8bb19f75ee75937a44e4ae548a7a92c
Reviewed-on: https://pdfium-review.googlesource.com/32791
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core')
-rw-r--r-- | core/fxge/cfx_fontmapper.cpp | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/core/fxge/cfx_fontmapper.cpp b/core/fxge/cfx_fontmapper.cpp index c0b111a51e..87442b54e6 100644 --- a/core/fxge/cfx_fontmapper.cpp +++ b/core/fxge/cfx_fontmapper.cpp @@ -451,7 +451,6 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const ByteString& name, break; } int PitchFamily = 0; - bool bItalic = false; uint32_t nStyle = FXFONT_NORMAL; bool bStyleAvail = false; if (iBaseFont < 12) { @@ -487,7 +486,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const ByteString& name, UpdatePitchFamily(flags, &PitchFamily); } - int old_weight = weight; + const int old_weight = weight; if (FontStyleIsBold(nStyle)) weight = FXFONT_FW_BOLD; @@ -537,23 +536,23 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const ByteString& name, i += buf.GetLength() + 1; } } - if (FontStyleIsItalic(nStyle)) - bItalic = true; + + if (!m_pFontInfo) { + return UseInternalSubst(pSubstFont, iBaseFont, italic_angle, old_weight, + PitchFamily); + } int Charset = FX_CHARSET_ANSI; if (WindowCP) Charset = GetCharsetFromCodePage(WindowCP); else if (iBaseFont == kNumStandardFonts && FontStyleIsSymbolic(flags)) Charset = FX_CHARSET_Symbol; + const bool bCJK = (Charset == FX_CHARSET_ShiftJIS || + Charset == FX_CHARSET_ChineseSimplified || + Charset == FX_CHARSET_Hangul || + Charset == FX_CHARSET_ChineseTraditional); + bool bItalic = FontStyleIsItalic(nStyle); - bool bCJK = (Charset == FX_CHARSET_ShiftJIS || - Charset == FX_CHARSET_ChineseSimplified || - Charset == FX_CHARSET_Hangul || - Charset == FX_CHARSET_ChineseTraditional); - if (!m_pFontInfo) { - return UseInternalSubst(pSubstFont, iBaseFont, italic_angle, old_weight, - PitchFamily); - } GetFontFamily(nStyle, &family); ByteString match = MatchInstalledFonts(TT_NormalizeName(family.c_str())); if (match.IsEmpty() && family != SubstName && |