Sanitizing base font name before comparison with 'Symbol'

This commit is contained in:
notmasteryet 2011-08-23 17:06:45 -05:00
parent d58dac0fd3
commit b90c6945b8

2
pdf.js
View File

@ -4313,7 +4313,7 @@ var PartialEvaluator = (function() {
return null; return null;
// Using base font name as a font name. // Using base font name as a font name.
baseFontName = baseFontName.name.replace(/[\+,\-]/g, '_'); baseFontName = baseFontName.name.replace(/[\+,\-]/g, '_');
if (baseFontName == 'Symbol') { if (/^Symbol(_?(Bold|Italic))*$/.test(baseFontName)) {
// special case for symbols // special case for symbols
var encoding = Encodings.symbolsEncoding; var encoding = Encodings.symbolsEncoding;
for (var i = 0, n = encoding.length, j; i < n; i++) { for (var i = 0, n = encoding.length, j; i < n; i++) {