diff options
author | Nicolas Pena <npm@chromium.org> | 2017-02-24 16:16:02 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-02-24 21:37:22 +0000 |
commit | 412fa65331cc04776bf1e3da5f51f29ea0fc7937 (patch) | |
tree | c705c0fdbf29e1b51ff268aa18352e1ffd6c0562 /core/fpdfapi/font/cpdf_font.cpp | |
parent | 0b6447a7231b5263d10f2bd9be3088f93af9629f (diff) | |
download | pdfium-412fa65331cc04776bf1e3da5f51f29ea0fc7937.tar.xz |
Remove repeated flags from CPDF_Fontchromium/3023
Moved all the flags to CFX_Font. Explicitly stated which ones are valued
according to the PDF spec to avoid their values being changed.
Change-Id: Ib57593234a4b9b83ef1ad593d0396c64159f303f
Reviewed-on: https://pdfium-review.googlesource.com/2837
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfapi/font/cpdf_font.cpp')
-rw-r--r-- | core/fpdfapi/font/cpdf_font.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/core/fpdfapi/font/cpdf_font.cpp b/core/fpdfapi/font/cpdf_font.cpp index 5563202455..36d7d6aeeb 100644 --- a/core/fpdfapi/font/cpdf_font.cpp +++ b/core/fpdfapi/font/cpdf_font.cpp @@ -161,7 +161,7 @@ uint32_t CPDF_Font::CharCodeFromUnicode(FX_WCHAR unicode) const { } void CPDF_Font::LoadFontDescriptor(CPDF_Dictionary* pFontDesc) { - m_Flags = pFontDesc->GetIntegerFor("Flags", PDFFONT_NONSYMBOLIC); + m_Flags = pFontDesc->GetIntegerFor("Flags", FXFONT_NONSYMBOLIC); int ItalicAngle = 0; bool bExistItalicAngle = false; if (pFontDesc->KeyExist("ItalicAngle")) { @@ -169,7 +169,7 @@ void CPDF_Font::LoadFontDescriptor(CPDF_Dictionary* pFontDesc) { bExistItalicAngle = true; } if (ItalicAngle < 0) { - m_Flags |= PDFFONT_ITALIC; + m_Flags |= FXFONT_ITALIC; m_ItalicAngle = ItalicAngle; } bool bExistStemV = false; @@ -188,16 +188,14 @@ void CPDF_Font::LoadFontDescriptor(CPDF_Dictionary* pFontDesc) { bExistDescent = true; } bool bExistCapHeight = false; - if (pFontDesc->KeyExist("CapHeight")) { + if (pFontDesc->KeyExist("CapHeight")) bExistCapHeight = true; - } if (bExistItalicAngle && bExistAscent && bExistCapHeight && bExistDescent && bExistStemV) { - m_Flags |= PDFFONT_USEEXTERNATTR; + m_Flags |= FXFONT_USEEXTERNATTR; } - if (m_Descent > 10) { + if (m_Descent > 10) m_Descent = -m_Descent; - } CPDF_Array* pBBox = pFontDesc->GetArrayFor("FontBBox"); if (pBBox) { m_FontBBox.left = pBBox->GetIntegerAt(0); @@ -372,10 +370,9 @@ void CPDF_Font::LoadPDFEncoding(CPDF_Object* pEncoding, iBaseEncoding == PDFFONT_ENCODING_ZAPFDINGBATS) { return; } - if ((m_Flags & PDFFONT_SYMBOLIC) && m_BaseFont == "Symbol") { - if (!bTrueType) { + if ((m_Flags & FXFONT_SYMBOLIC) && m_BaseFont == "Symbol") { + if (!bTrueType) iBaseEncoding = PDFFONT_ENCODING_ADOBE_SYMBOL; - } return; } CFX_ByteString bsEncoding = pEncoding->GetString(); |