Adjusts heuristic for disabling Symbol encoding

This commit is contained in:
Yury Delendik 2014-01-02 18:44:11 -06:00
parent c389451a5b
commit 5973d40afe
5 changed files with 110 additions and 3 deletions

View File

@ -982,10 +982,11 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
Encodings.WinAnsiEncoding :
Encodings.StandardEncoding;
// The Symbolic attribute can be misused for regular fonts
// Heuristic: we have to check if the font is a standard one also
// Heuristic: we have to check if the font is a standard one or
// toUnicode is provided
if (!!(flags & FontFlags.Symbolic)) {
baseEncoding = !properties.file ? Encodings.SymbolSetEncoding :
Encodings.MacRomanEncoding;
baseEncoding = !properties.file && !properties.toUnicode ?
Encodings.SymbolSetEncoding : Encodings.MacRomanEncoding;
}
if (dict.has('Encoding')) {
var encoding = dict.get('Encoding');

1
test/pdfs/.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
*.pdf binary

View File

@ -44,6 +44,7 @@
!helloworld-bad.pdf
!zerowidthline.pdf
!bug868745.pdf
!bug864847.pdf
!issue1002.pdf
!issue925.pdf
!gradientfill.pdf

98
test/pdfs/bug864847.pdf Normal file
View File

@ -0,0 +1,98 @@
%PDF-1.7
1 0 obj % entry point
<<
/Type /Catalog
/Pages 2 0 R
>>
endobj
2 0 obj
<<
/Type /Pages
/MediaBox [ 0 0 200 200 ]
/Count 1
/Kids [ 3 0 R ]
>>
endobj
3 0 obj
<<
/Type /Page
/Parent 2 0 R
/Resources <<
/Font <<
/F1 4 0 R
>>
>>
/Contents 5 0 R
>>
endobj
6 0 obj
<<
/Filter /LZWDecode
/Length 192
>>
stream
Èd!$Üi:å¼ÆS2ÂLÆ“q<E2809C>äe9Χ#”@b2™â€¡ˆÈ@d4˜á2 ¸ͦ€*'ô˜Èe3Mˆ<73>8Âm2ÊCÌž<C38C>$<24>Èf&ùùÌàaŽœŒ&ã9”< ÃÃ1˜|
2ÅLuHÅ^³[®Ô&ãšµ\¯V+ÕòÃ{³ÚL—[½Ç¨sJ5 @c<>ÅÍÇIDª8S¢fã,^3Žˆù®A@@
endstream
endobj
7 0 obj
<<
/FontName /Arial-ItalicMT
/StemV 93
/Ascent 625
/Flags 4
/Descent 0
/ItalicAngle 0
/MissingWidth 750
/FontBBox [0 0 625 625]
/Type /FontDescriptor
/CapHeight 625
>>
endobj
4 0 obj
<<
/BaseFont /Arial-ItalicMT
/LastChar 32
/Subtype /TrueType
/ToUnicode 6 0 R
/FontDescriptor 7 0 R
/Widths [278]
/Type /Font
/FirstChar 32
>>
endobj
5 0 obj % page content
<<
/Length 44
>>
stream
BT
70 50 TD
/F1 12 Tf
(Hello, 864847) Tj
ET
endstream
endobj
xref
0 8
0000000000 65535 f
0000000010 00000 n
0000000079 00000 n
0000000173 00000 n
0000000753 00000 n
0000000913 00000 n
0000000300 00000 n
0000000565 00000 n
trailer
<<
/Size 8
/Root 1 0 R
>>
startxref
1025
%%EOF

View File

@ -769,6 +769,12 @@
"rounds": 1,
"type": "eq"
},
{ "id": "bug864847",
"file": "pdfs/bug864847.pdf",
"md5": "2b62cbba5d40a769be8e611eb5b61bfe",
"rounds": 1,
"type": "eq"
},
{ "id": "issue925",
"file": "pdfs/issue925.pdf",
"md5": "f58fe943090aff89dcc8e771bc0db4c2",