Browse Source

Fix gjslint warnings.

Kalervo Kujala 14 years ago
parent
commit
d9e01b1d7a
  1. 23
      fonts.js
  2. 2
      pdf.js

23
fonts.js

@ -447,10 +447,10 @@ var Font = (function Font() { @@ -447,10 +447,10 @@ var Font = (function Font() {
this.glyphs = properties.glyphs;
this.sizes = [];
var names = name.split("+");
var names = name.split('+');
names = names.length > 1 ? names[1] : names[0];
names = names.split(/[-,_]/g)[0];
this.serif = serifFonts[names] || (name.indexOf("Serif") != -1);
this.serif = serifFonts[names] || (name.indexOf('Serif') != -1);
// If the font is to be ignored, register it like an already loaded font
// to avoid the cost of waiting for it be be loaded by the platform.
@ -470,8 +470,8 @@ var Font = (function Font() { @@ -470,8 +470,8 @@ var Font = (function Font() {
// Use 'name' instead of 'fontName' here because the original
// name ArialNarrow for example will be replaced by Helvetica.
this.narrow = (name.indexOf("Narrow") != -1)
this.black = (name.indexOf("Black") != -1)
this.narrow = (name.indexOf('Narrow') != -1);
this.black = (name.indexOf('Black') != -1);
this.loadedName = fontName.split('-')[0];
this.loading = false;
@ -485,8 +485,8 @@ var Font = (function Font() { @@ -485,8 +485,8 @@ var Font = (function Font() {
this.mimetype = 'font/opentype';
var subtype = properties.subtype;
var cff = (subtype === 'Type1C') ? new Type2CFF(file, properties)
: new CFF(name, file, properties);
var cff = (subtype === 'Type1C') ?
new Type2CFF(file, properties) : new CFF(name, file, properties);
// Wrap the CFF data inside an OTF font file
data = this.convert(name, cff, properties);
@ -912,7 +912,7 @@ var Font = (function Font() { @@ -912,7 +912,7 @@ var Font = (function Font() {
// Check that table are sorted by platformID then encodingID,
records.sort(function(a, b) {
return ((a.platformID << 16) + a.encodingID) -
((b.platformID << 16) + b.encodingID)
((b.platformID << 16) + b.encodingID);
});
var tables = [records[0]];
@ -2360,7 +2360,8 @@ var Type2CFF = (function() { @@ -2360,7 +2360,8 @@ var Type2CFF = (function() {
return charstrings;
},
parseEncoding: function cff_parseencoding(pos, properties, strings, charset) {
parseEncoding: function cff_parseencoding(pos, properties, strings,
charset) {
var encoding = {};
var bytes = this.bytes;
@ -2375,8 +2376,8 @@ var Type2CFF = (function() { @@ -2375,8 +2376,8 @@ var Type2CFF = (function() {
if (pos == 0 || pos == 1) {
var gid = 1;
var baseEncoding = pos ? Encodings.ExpertEncoding
: Encodings.StandardEncoding;
var baseEncoding =
pos ? Encodings.ExpertEncoding : Encodings.StandardEncoding;
for (var i = 0; i < charset.length; i++) {
var index = baseEncoding.indexOf(charset[i]);
if (index != -1)
@ -2413,7 +2414,7 @@ var Type2CFF = (function() { @@ -2413,7 +2414,7 @@ var Type2CFF = (function() {
break;
default:
error('Unknow encoding format: ' + format + " in CFF");
error('Unknow encoding format: ' + format + ' in CFF');
break;
}
}

2
pdf.js

@ -4389,7 +4389,7 @@ var PartialEvaluator = (function() { @@ -4389,7 +4389,7 @@ var PartialEvaluator = (function() {
var type = dict.get('Subtype');
assertWellFormed(IsName(type), 'invalid font Subtype');
var composite = false
var composite = false;
if (type.name == 'Type0') {
// If font is a composite
// - get the descendant font

Loading…
Cancel
Save