summaryrefslogtreecommitdiff
path: root/core/fxge/cfx_font.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 /core/fxge/cfx_font.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 'core/fxge/cfx_font.cpp')
-rw-r--r--core/fxge/cfx_font.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/core/fxge/cfx_font.cpp b/core/fxge/cfx_font.cpp
index e893c13357..11fa45710d 100644
--- a/core/fxge/cfx_font.cpp
+++ b/core/fxge/cfx_font.cpp
@@ -233,7 +233,11 @@ bool CFX_Font::LoadClone(const CFX_Font* pFont) {
if (pFont->m_pSubstFont) {
m_pSubstFont = pdfium::MakeUnique<CFX_SubstFont>();
m_pSubstFont->m_Charset = pFont->m_pSubstFont->m_Charset;
- m_pSubstFont->m_SubstFlags = pFont->m_pSubstFont->m_SubstFlags;
+ m_pSubstFont->m_bFlagMM = pFont->m_pSubstFont->m_bFlagMM;
+ m_pSubstFont->m_bFlagExact = pFont->m_pSubstFont->m_bFlagExact;
+#ifdef PDF_ENABLE_XFA
+ m_pSubstFont->m_bFlagItalic = pFont->m_pSubstFont->m_bFlagItalic;
+#endif // PDF_ENABLE_XFA
m_pSubstFont->m_Weight = pFont->m_pSubstFont->m_Weight;
m_pSubstFont->m_Family = pFont->m_pSubstFont->m_Family;
m_pSubstFont->m_ItalicAngle = pFont->m_pSubstFont->m_ItalicAngle;
@@ -331,7 +335,7 @@ bool CFX_Font::LoadFile(const RetainPtr<IFX_SeekableReadStream>& pFile,
int CFX_Font::GetGlyphWidth(uint32_t glyph_index) {
if (!m_Face)
return 0;
- if (m_pSubstFont && (m_pSubstFont->m_SubstFlags & FXFONT_SUBST_MM))
+ if (m_pSubstFont && m_pSubstFont->m_bFlagMM)
AdjustMMParams(glyph_index, 0, 0);
int err = FXFT_Load_Glyph(
m_Face, glyph_index,
@@ -590,7 +594,7 @@ CFX_PathData* CFX_Font::LoadGlyphPathImpl(uint32_t glyph_index,
else
ft_matrix.xy -= ft_matrix.xx * skew / 100;
}
- if (m_pSubstFont->m_SubstFlags & FXFONT_SUBST_MM)
+ if (m_pSubstFont->m_bFlagMM)
AdjustMMParams(glyph_index, dest_width, m_pSubstFont->m_Weight);
}
ScopedFontTransform scoped_transform(m_Face, &ft_matrix);
@@ -599,7 +603,7 @@ CFX_PathData* CFX_Font::LoadGlyphPathImpl(uint32_t glyph_index,
load_flags |= FT_LOAD_NO_HINTING;
if (FXFT_Load_Glyph(m_Face, glyph_index, load_flags))
return nullptr;
- if (m_pSubstFont && !(m_pSubstFont->m_SubstFlags & FXFONT_SUBST_MM) &&
+ if (m_pSubstFont && !m_pSubstFont->m_bFlagMM &&
m_pSubstFont->m_Weight > 400) {
uint32_t index = (m_pSubstFont->m_Weight - 400) / 10;
index = std::min(index, static_cast<uint32_t>(kWeightPowArraySize - 1));