diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-09-28 15:59:42 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-09-28 20:40:36 +0000 |
commit | 10e1f05a9e644cd954792bcd40ef787551cbd209 (patch) | |
tree | d203254a0a2c856a9b8ba5a0445a883c7072dd77 /core/fxge/cfx_folderfontinfo.cpp | |
parent | dd0e6e1eba14c76dedd4b4e55ab47406856c9a76 (diff) | |
download | pdfium-10e1f05a9e644cd954792bcd40ef787551cbd209.tar.xz |
Cleanup font defines
Use methods to match font information; cleanup some font code.
Change-Id: Ib99c1e466e56723cb5d264d49e1caf9bbbc0daed
Reviewed-on: https://pdfium-review.googlesource.com/15072
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxge/cfx_folderfontinfo.cpp')
-rw-r--r-- | core/fxge/cfx_folderfontinfo.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/core/fxge/cfx_folderfontinfo.cpp b/core/fxge/cfx_folderfontinfo.cpp index dbc8142d69..1ee9ea729a 100644 --- a/core/fxge/cfx_folderfontinfo.cpp +++ b/core/fxge/cfx_folderfontinfo.cpp @@ -92,18 +92,16 @@ int32_t GetSimilarValue(int weight, int pitch_family, uint32_t style) { int32_t iSimilarValue = 0; - if (!!(style & FXFONT_BOLD) == (weight > 400)) + if (FontStyleIsBold(style) == (weight > 400)) iSimilarValue += 16; - if (!!(style & FXFONT_ITALIC) == bItalic) + if (FontStyleIsItalic(style) == bItalic) iSimilarValue += 16; - if (!!(style & FXFONT_SERIF) == !!(pitch_family & FXFONT_FF_ROMAN)) + if (FontStyleIsSerif(style) == FontFamilyIsRoman(pitch_family)) iSimilarValue += 16; - if (!!(style & FXFONT_SCRIPT) == !!(pitch_family & FXFONT_FF_SCRIPT)) + if (FontStyleIsScript(style) == FontFamilyIsScript(pitch_family)) iSimilarValue += 8; - if (!!(style & FXFONT_FIXED_PITCH) == - !!(pitch_family & FXFONT_FF_FIXEDPITCH)) { + if (FontStyleIsFixedPitch(style) == FontFamilyIsFixedPitch(pitch_family)) iSimilarValue += 8; - } return iSimilarValue; } @@ -284,7 +282,7 @@ void* CFX_FolderFontInfo::FindFont(int weight, const char* family, bool bMatchName) { FontFaceInfo* pFind = nullptr; - if (charset == FX_CHARSET_ANSI && (pitch_family & FXFONT_FF_FIXEDPITCH)) + if (charset == FX_CHARSET_ANSI && FontFamilyIsFixedPitch(pitch_family)) return GetFont("Courier New"); uint32_t charset_flag = GetCharset(charset); |