diff --git a/src/utils/fonts_utils.js b/src/utils/fonts_utils.js index bbf17a202..27bad2a58 100644 --- a/src/utils/fonts_utils.js +++ b/src/utils/fonts_utils.js @@ -1,5 +1,6 @@ /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ +/* globals CFFDictDataMap, CFFDictPrivateDataMap, CFFEncodingMap, CFFStrings, Components, Dict, dump, error, isNum, log, netscape, Stream, warn */ /* Copyright 2012 Mozilla Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,6 +16,8 @@ * limitations under the License. */ +'use strict'; + /* * The Type2 reader code below is only used for debugging purpose since Type2 * is only a CharString format and is never used directly as a Font file. @@ -33,7 +36,7 @@ function readCharset(aStream, aCharstrings) { var format = aStream.getByte(); var count = aCharstrings.length - 1; - if (format == 0) { + if (format === 0) { charset['.notdef'] = readCharstringEncoding(aCharstrings[0]); for (var i = 1; i < count + 1; i++) { @@ -250,7 +253,7 @@ var Type2Parser = function type2Parser(aFilePath) { var xhr = new XMLHttpRequest(); xhr.open('GET', aFilePath, false); xhr.mozResponseType = xhr.responseType = 'arraybuffer'; - xhr.expected = (document.URL.indexOf('file:') == 0) ? 0 : 200; + xhr.expected = (document.URL.indexOf('file:') === 0) ? 0 : 200; xhr.send(null); this.data = new Stream(xhr.mozResponseArrayBuffer || xhr.mozResponse || xhr.responseArrayBuffer || xhr.response); @@ -365,7 +368,7 @@ var Type2Parser = function type2Parser(aFilePath) { // Read Charset dump('Read Charset for ' + charStrings.length + ' glyphs'); var charsetEntry = font.get('charset'); - if (charsetEntry == 0) { + if (charsetEntry === 0) { error('Need to support CFFISOAdobeCharset'); } else if (charsetEntry == 1) { error('Need to support CFFExpert');