|
|
@ -19,7 +19,7 @@ |
|
|
|
isNum, ISOAdobeCharset, Stream, stringToArray, stringToBytes, |
|
|
|
isNum, ISOAdobeCharset, Stream, stringToArray, stringToBytes, |
|
|
|
string32, TextDecoder, warn, Lexer, Util, FONT_IDENTITY_MATRIX, |
|
|
|
string32, TextDecoder, warn, Lexer, Util, FONT_IDENTITY_MATRIX, |
|
|
|
FontRendererFactory, shadow, isString, IdentityCMap, Name, |
|
|
|
FontRendererFactory, shadow, isString, IdentityCMap, Name, |
|
|
|
CMapFactory, PDFJS */ |
|
|
|
CMapFactory, PDFJS, readUint32 */ |
|
|
|
|
|
|
|
|
|
|
|
'use strict'; |
|
|
|
'use strict'; |
|
|
|
|
|
|
|
|
|
|
@ -2259,7 +2259,12 @@ var Font = (function FontClosure() { |
|
|
|
// Some fonts might use wrong font types for Type1C or CIDFontType0C
|
|
|
|
// Some fonts might use wrong font types for Type1C or CIDFontType0C
|
|
|
|
var subtype = properties.subtype; |
|
|
|
var subtype = properties.subtype; |
|
|
|
if (subtype == 'Type1C' && (type != 'Type1' && type != 'MMType1')) { |
|
|
|
if (subtype == 'Type1C' && (type != 'Type1' && type != 'MMType1')) { |
|
|
|
type = 'Type1'; |
|
|
|
// Some TrueType fonts by mistake claim Type1C
|
|
|
|
|
|
|
|
if (isTrueTypeFile(file)) { |
|
|
|
|
|
|
|
subtype = 'TrueType'; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
type = 'Type1'; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (subtype == 'CIDFontType0C' && type != 'CIDFontType0') { |
|
|
|
if (subtype == 'CIDFontType0C' && type != 'CIDFontType0') { |
|
|
|
type = 'CIDFontType0'; |
|
|
|
type = 'CIDFontType0'; |
|
|
@ -2407,6 +2412,11 @@ var Font = (function FontClosure() { |
|
|
|
file.virtualOffset += data.length; |
|
|
|
file.virtualOffset += data.length; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function isTrueTypeFile(file) { |
|
|
|
|
|
|
|
var header = file.peekBytes(4); |
|
|
|
|
|
|
|
return readUint32(header, 0) === 0x00010000; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Rebuilds the char code to glyph ID map by trying to replace the char codes |
|
|
|
* Rebuilds the char code to glyph ID map by trying to replace the char codes |
|
|
|
* with their unicode value. It also moves char codes that are in known |
|
|
|
* with their unicode value. It also moves char codes that are in known |
|
|
|