|
|
@ -4367,16 +4367,16 @@ var PartialEvaluator = (function() { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return glyphs; |
|
|
|
return glyphs; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
translateFont: function(dict, xref, resources) { |
|
|
|
translateFont: function(dict, xref, resources) { |
|
|
|
var subType = dict.get('Subtype'); |
|
|
|
var baseDict = dict; |
|
|
|
assertWellFormed(IsName(subType), 'invalid font Subtype'); |
|
|
|
var type = dict.get('Subtype'); |
|
|
|
|
|
|
|
assertWellFormed(IsName(type), 'invalid font Subtype'); |
|
|
|
|
|
|
|
|
|
|
|
var composite = false |
|
|
|
var composite = false |
|
|
|
if (subType.name == 'Type0') { |
|
|
|
if (type.name == 'Type0') { |
|
|
|
// If font is a composite
|
|
|
|
// If font is a composite
|
|
|
|
// - get the descendant font
|
|
|
|
// - get the descendant font
|
|
|
|
// - set the type according to the descendant font
|
|
|
|
// - set the type according to the descendant font
|
|
|
@ -4390,8 +4390,8 @@ var PartialEvaluator = (function() { |
|
|
|
|
|
|
|
|
|
|
|
dict = xref.fetch(IsRef(df) ? df : df[0]); |
|
|
|
dict = xref.fetch(IsRef(df) ? df : df[0]); |
|
|
|
|
|
|
|
|
|
|
|
subType = dict.get('Subtype'); |
|
|
|
type = dict.get('Subtype'); |
|
|
|
assertWellFormed(IsName(subType), 'invalid font Subtype'); |
|
|
|
assertWellFormed(IsName(type), 'invalid font Subtype'); |
|
|
|
composite = true; |
|
|
|
composite = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -4417,7 +4417,7 @@ var PartialEvaluator = (function() { |
|
|
|
} |
|
|
|
} |
|
|
|
return { |
|
|
|
return { |
|
|
|
name: baseFontName, |
|
|
|
name: baseFontName, |
|
|
|
dict: dict, |
|
|
|
dict: baseDict, |
|
|
|
properties: { |
|
|
|
properties: { |
|
|
|
encoding: map |
|
|
|
encoding: map |
|
|
|
} |
|
|
|
} |
|
|
@ -4440,9 +4440,9 @@ var PartialEvaluator = (function() { |
|
|
|
if (fontFile) { |
|
|
|
if (fontFile) { |
|
|
|
fontFile = xref.fetchIfRef(fontFile); |
|
|
|
fontFile = xref.fetchIfRef(fontFile); |
|
|
|
if (fontFile.dict) { |
|
|
|
if (fontFile.dict) { |
|
|
|
var fileType = fontFile.dict.get('Subtype'); |
|
|
|
var subtype = fontFile.dict.get('Subtype'); |
|
|
|
if (fileType) |
|
|
|
if (subtype) |
|
|
|
fileType = fileType.name; |
|
|
|
subtype = subtype.name; |
|
|
|
|
|
|
|
|
|
|
|
var length1 = fontFile.dict.get('Length1'); |
|
|
|
var length1 = fontFile.dict.get('Length1'); |
|
|
|
if (!IsInt(length1)) |
|
|
|
if (!IsInt(length1)) |
|
|
@ -4455,8 +4455,8 @@ var PartialEvaluator = (function() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var properties = { |
|
|
|
var properties = { |
|
|
|
type: subType.name, |
|
|
|
type: type.name, |
|
|
|
subtype: fileType, |
|
|
|
subtype: subtype, |
|
|
|
file: fontFile, |
|
|
|
file: fontFile, |
|
|
|
length1: length1, |
|
|
|
length1: length1, |
|
|
|
length2: length2, |
|
|
|
length2: length2, |
|
|
@ -4484,11 +4484,10 @@ var PartialEvaluator = (function() { |
|
|
|
properties.widths[firstChar++] = widths[i]; |
|
|
|
properties.widths[firstChar++] = widths[i]; |
|
|
|
|
|
|
|
|
|
|
|
properties.glyphs = this.extractEncoding(dict, xref, properties); |
|
|
|
properties.glyphs = this.extractEncoding(dict, xref, properties); |
|
|
|
log(properties.encoding); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
return { |
|
|
|
name: fontName.name, |
|
|
|
name: fontName.name, |
|
|
|
dict: dict, |
|
|
|
dict: baseDict, |
|
|
|
file: fontFile, |
|
|
|
file: fontFile, |
|
|
|
properties: properties |
|
|
|
properties: properties |
|
|
|
}; |
|
|
|
}; |
|
|
|