summaryrefslogtreecommitdiff
path: root/xfa/fde/cfde_textout.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-09-28 11:51:24 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-09-28 20:39:56 +0000
commitdd0e6e1eba14c76dedd4b4e55ab47406856c9a76 (patch)
tree36f27e3ec86b5c376d51bcd753cbdfbe3402e6c7 /xfa/fde/cfde_textout.cpp
parent58418a24debb15019ec71eca193eff02c2a4846c (diff)
downloadpdfium-dd0e6e1eba14c76dedd4b4e55ab47406856c9a76.tar.xz
Cleanup font defines
This CL removes duplicate defines between XFA and core. Several OR'd values have been coverted into individual booleans to make the code clearer. Change-Id: Ic32a71c711cffd9a0cf1136e5a22f0502e085c39 Reviewed-on: https://pdfium-review.googlesource.com/15071 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fde/cfde_textout.cpp')
-rw-r--r--xfa/fde/cfde_textout.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/xfa/fde/cfde_textout.cpp b/xfa/fde/cfde_textout.cpp
index 8a1f56876c..2cdaeba27b 100644
--- a/xfa/fde/cfde_textout.cpp
+++ b/xfa/fde/cfde_textout.cpp
@@ -42,8 +42,7 @@ bool CFDE_TextOut::DrawString(CFX_RenderDevice* device,
ASSERT(pFont && pCharPos && iCount > 0);
CFX_Font* pFxFont = pFont->GetDevFont();
- if ((pFont->GetFontStyles() & FX_FONTSTYLE_Italic) != 0 &&
- !pFxFont->IsItalic()) {
+ if ((pFont->GetFontStyles() & FXFONT_ITALIC) != 0 && !pFxFont->IsItalic()) {
for (int32_t i = 0; i < iCount; ++i) {
static const float mc = 0.267949f;
float* pAM = pCharPos->m_AdjustMatrix;
@@ -57,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 & FX_FONTSTYLE_Bold ? 700 : 400;
- SubstFxFont->m_ItalicAngle = dwFontStyle & FX_FONTSTYLE_Italic ? -12 : 0;
+ SubstFxFont->m_Weight = dwFontStyle & FXFONT_BOLD ? 700 : 400;
+ SubstFxFont->m_ItalicAngle = dwFontStyle & FXFONT_ITALIC ? -12 : 0;
SubstFxFont->m_WeightCJK = SubstFxFont->m_Weight;
- SubstFxFont->m_bItalicCJK = !!(dwFontStyle & FX_FONTSTYLE_Italic);
+ SubstFxFont->m_bItalicCJK = !!(dwFontStyle & FXFONT_ITALIC);
FxFont.SetSubstFont(std::move(SubstFxFont));
#endif // _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_