summaryrefslogtreecommitdiff
path: root/xfa/fde
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-09-28 15:59:42 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-09-28 20:40:36 +0000
commit10e1f05a9e644cd954792bcd40ef787551cbd209 (patch)
treed203254a0a2c856a9b8ba5a0445a883c7072dd77 /xfa/fde
parentdd0e6e1eba14c76dedd4b4e55ab47406856c9a76 (diff)
downloadpdfium-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 'xfa/fde')
-rw-r--r--xfa/fde/cfde_textout.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/xfa/fde/cfde_textout.cpp b/xfa/fde/cfde_textout.cpp
index 2cdaeba27b..2f41525c00 100644
--- a/xfa/fde/cfde_textout.cpp
+++ b/xfa/fde/cfde_textout.cpp
@@ -42,7 +42,7 @@ bool CFDE_TextOut::DrawString(CFX_RenderDevice* device,
ASSERT(pFont && pCharPos && iCount > 0);
CFX_Font* pFxFont = pFont->GetDevFont();
- if ((pFont->GetFontStyles() & FXFONT_ITALIC) != 0 && !pFxFont->IsItalic()) {
+ if (FontStyleIsItalic(pFont->GetFontStyles()) && !pFxFont->IsItalic()) {
for (int32_t i = 0; i < iCount; ++i) {
static const float mc = 0.267949f;
float* pAM = pCharPos->m_AdjustMatrix;
@@ -56,10 +56,10 @@ bool CFDE_TextOut::DrawString(CFX_RenderDevice* device,
uint32_t dwFontStyle = pFont->GetFontStyles();
CFX_Font FxFont;
auto SubstFxFont = pdfium::MakeUnique<CFX_SubstFont>();
- SubstFxFont->m_Weight = dwFontStyle & FXFONT_BOLD ? 700 : 400;
- SubstFxFont->m_ItalicAngle = dwFontStyle & FXFONT_ITALIC ? -12 : 0;
+ SubstFxFont->m_Weight = FontStyleIsBold(dwFontStyle) ? 700 : 400;
+ SubstFxFont->m_ItalicAngle = FontStyleIsItalic(dwFontStyle) ? -12 : 0;
SubstFxFont->m_WeightCJK = SubstFxFont->m_Weight;
- SubstFxFont->m_bItalicCJK = !!(dwFontStyle & FXFONT_ITALIC);
+ SubstFxFont->m_bItalicCJK = FontStyleIsItalic(dwFontStyle);
FxFont.SetSubstFont(std::move(SubstFxFont));
#endif // _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_