summaryrefslogtreecommitdiff
path: root/core/fpdfapi/font/cpdf_simplefont.cpp
diff options
context:
space:
mode:
authorNicolas Pena <npm@chromium.org>2017-02-24 16:16:02 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-02-24 21:37:22 +0000
commit412fa65331cc04776bf1e3da5f51f29ea0fc7937 (patch)
treec705c0fdbf29e1b51ff268aa18352e1ffd6c0562 /core/fpdfapi/font/cpdf_simplefont.cpp
parent0b6447a7231b5263d10f2bd9be3088f93af9629f (diff)
downloadpdfium-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_simplefont.cpp')
-rw-r--r--core/fpdfapi/font/cpdf_simplefont.cpp24
1 files changed, 10 insertions, 14 deletions
diff --git a/core/fpdfapi/font/cpdf_simplefont.cpp b/core/fpdfapi/font/cpdf_simplefont.cpp
index ed9860970e..c414270068 100644
--- a/core/fpdfapi/font/cpdf_simplefont.cpp
+++ b/core/fpdfapi/font/cpdf_simplefont.cpp
@@ -127,15 +127,13 @@ bool CPDF_SimpleFont::LoadCommon() {
}
}
if (m_pFontFile) {
- if (m_BaseFont.GetLength() > 8 && m_BaseFont[7] == '+') {
+ if (m_BaseFont.GetLength() > 8 && m_BaseFont[7] == '+')
m_BaseFont = m_BaseFont.Mid(8);
- }
} else {
LoadSubstFont();
}
- if (!(m_Flags & PDFFONT_SYMBOLIC)) {
+ if (!(m_Flags & FXFONT_SYMBOLIC))
m_BaseEncoding = PDFFONT_ENCODING_STANDARD;
- }
CPDF_Object* pEncoding = m_pFontDict->GetDirectObjectFor("Encoding");
LoadPDFEncoding(pEncoding, m_BaseEncoding, &m_CharNames, !!m_pFontFile,
m_Font.IsTTFont());
@@ -144,7 +142,7 @@ bool CPDF_SimpleFont::LoadCommon() {
if (!m_Font.GetFace())
return true;
- if (m_Flags & PDFFONT_ALLCAP) {
+ if (m_Flags & FXFONT_ALLCAP) {
unsigned char kLowercases[][2] = {{'a', 'z'}, {0xe0, 0xf6}, {0xf8, 0xfd}};
for (size_t range = 0; range < FX_ArraySize(kLowercases); ++range) {
const auto& lower = kLowercases[range];
@@ -166,21 +164,19 @@ bool CPDF_SimpleFont::LoadCommon() {
}
void CPDF_SimpleFont::LoadSubstFont() {
- if (!m_bUseFontWidth && !(m_Flags & PDFFONT_FIXEDPITCH)) {
+ if (!m_bUseFontWidth && !(m_Flags & FXFONT_FIXED_PITCH)) {
int width = 0, i;
for (i = 0; i < 256; i++) {
- if (m_CharWidth[i] == 0 || m_CharWidth[i] == 0xffff) {
+ if (m_CharWidth[i] == 0 || m_CharWidth[i] == 0xffff)
continue;
- }
- if (width == 0) {
+
+ if (width == 0)
width = m_CharWidth[i];
- } else if (width != m_CharWidth[i]) {
+ else if (width != m_CharWidth[i])
break;
- }
- }
- if (i == 256 && width) {
- m_Flags |= PDFFONT_FIXEDPITCH;
}
+ if (i == 256 && width)
+ m_Flags |= FXFONT_FIXED_PITCH;
}
pdfium::base::CheckedNumeric<int> safeStemV(m_StemV);
if (m_StemV < 140)