summaryrefslogtreecommitdiff
path: root/core/fpdfapi/font
diff options
context:
space:
mode:
authornpm <npm@chromium.org>2017-01-17 15:15:38 -0800
committerCommit bot <commit-bot@chromium.org>2017-01-17 15:15:38 -0800
commit21ae2b7297e005576afeb9f0230d1f69b3abc857 (patch)
tree803869c2e20d0b38f9fc0f6f32d41a78a8b560db /core/fpdfapi/font
parenta715f524e66a1fd8b974f6e2af0db3c23b8c5190 (diff)
downloadpdfium-21ae2b7297e005576afeb9f0230d1f69b3abc857.tar.xz
Stop using Encoding array to get unicode from charcode in Type 3 fontschromium/2985
We should not fill out the m_Encoding for Type3 fonts. This way, we stop getting garbage characters from text extraction. Guessing that unicode == charcode (in the absence of ToUnicode) is our best bet. BUG=pdfium:642 Review-Url: https://codereview.chromium.org/2643543002
Diffstat (limited to 'core/fpdfapi/font')
-rw-r--r--core/fpdfapi/font/cpdf_type3font.cpp12
1 files changed, 1 insertions, 11 deletions
diff --git a/core/fpdfapi/font/cpdf_type3font.cpp b/core/fpdfapi/font/cpdf_type3font.cpp
index 8a0a115992..9542945845 100644
--- a/core/fpdfapi/font/cpdf_type3font.cpp
+++ b/core/fpdfapi/font/cpdf_type3font.cpp
@@ -72,18 +72,8 @@ bool CPDF_Type3Font::Load() {
}
m_pCharProcs = m_pFontDict->GetDictFor("CharProcs");
CPDF_Object* pEncoding = m_pFontDict->GetDirectObjectFor("Encoding");
- if (pEncoding) {
+ if (pEncoding)
LoadPDFEncoding(pEncoding, m_BaseEncoding, &m_CharNames, false, false);
- if (!m_CharNames.empty()) {
- for (int i = 0; i < 256; i++) {
- m_Encoding.m_Unicodes[i] =
- PDF_UnicodeFromAdobeName(m_CharNames[i].c_str());
- if (m_Encoding.m_Unicodes[i] == 0) {
- m_Encoding.m_Unicodes[i] = i;
- }
- }
- }
- }
return true;
}