Make Type1Font
more class-like, by adding closure
*Note:* Ignoring whitespace should simplify reviewing a great deal.
This commit is contained in:
parent
447c48ea27
commit
c40df8a393
@ -3637,8 +3637,9 @@ var CFFStandardStrings = [
|
||||
];
|
||||
|
||||
// Type1Font is also a CIDFontType0.
|
||||
var Type1Font = function Type1Font(name, file, properties) {
|
||||
// Some bad generators embed pfb file as is, we have to strip 6-byte headers.
|
||||
var Type1Font = (function Type1FontClosure() {
|
||||
function Type1Font(name, file, properties) {
|
||||
// Some bad generators embed pfb file as is, we have to strip 6-byte header.
|
||||
// Also, length1 and length2 might be off by 6 bytes as well.
|
||||
// http://www.math.ubc.ca/~cass/piscript/type1.pdf
|
||||
var PFB_HEADER_SIZE = 6;
|
||||
@ -3679,9 +3680,9 @@ var Type1Font = function Type1Font(name, file, properties) {
|
||||
this.data = this.wrap(name, type2Charstrings, this.charstrings,
|
||||
subrs, properties);
|
||||
this.seacs = this.getSeacs(data.charstrings);
|
||||
};
|
||||
}
|
||||
|
||||
Type1Font.prototype = {
|
||||
Type1Font.prototype = {
|
||||
get numGlyphs() {
|
||||
return this.charstrings.length + 1;
|
||||
},
|
||||
@ -3762,7 +3763,8 @@ Type1Font.prototype = {
|
||||
return type2Subrs;
|
||||
},
|
||||
|
||||
wrap: function Type1Font_wrap(name, glyphs, charstrings, subrs, properties) {
|
||||
wrap: function Type1Font_wrap(name, glyphs, charstrings, subrs,
|
||||
properties) {
|
||||
var cff = new CFF();
|
||||
cff.header = new CFFHeader(1, 0, 4, 4);
|
||||
|
||||
@ -3861,7 +3863,10 @@ Type1Font.prototype = {
|
||||
var compiler = new CFFCompiler(cff);
|
||||
return compiler.compile();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
return Type1Font;
|
||||
})();
|
||||
|
||||
var CFFFont = (function CFFFontClosure() {
|
||||
function CFFFont(file, properties) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user