1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 09:38:06 +02:00

Adds UMD headers to core, display and shared files.

This commit is contained in:
Yury Delendik 2015-11-21 10:32:47 -06:00
parent 1b5940edd2
commit 6b60c8f4db
54 changed files with 1876 additions and 572 deletions

View file

@ -12,10 +12,30 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* globals error, bytesToString, Stream, GlyphsUnicode, CFFParser, Encodings,
Util */
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs/core/font_renderer', ['exports', 'pdfjs/shared/util',
'pdfjs/core/stream', 'pdfjs/core/glyphlist'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('../shared/util.js'), require('./stream.js'),
require('./glyphlist.js'));
} else {
factory((root.pdfjsCoreFontRenderer = {}), root.pdfjsSharedUtil,
root.pdfjsCoreStream, root.pdfjsCoreGlyphList);
}
}(this, function (exports, sharedUtil, coreStream, coreGlyphList) {
var Util = sharedUtil.Util;
var bytesToString = sharedUtil.bytesToString;
var error = sharedUtil.error;
var Stream = coreStream.Stream;
var GlyphsUnicode = coreGlyphList.GlyphsUnicode;
var coreFonts; // see _setCoreFonts below
var CFFParser; // = coreFonts.CFFParser;
var Encodings; // = coreFonts.Encodings;
var FontRendererFactory = (function FontRendererFactoryClosure() {
function getLong(data, offset) {
@ -706,3 +726,15 @@ var FontRendererFactory = (function FontRendererFactoryClosure() {
}
};
})();
// TODO refactor to remove cyclic dependency on fonts.js
function _setCoreFonts(coreFonts_) {
coreFonts = coreFonts_;
Encodings = coreFonts_.Encodings;
CFFParser = coreFonts_.CFFParser;
}
exports._setCoreFonts = _setCoreFonts;
exports.FontRendererFactory = FontRendererFactory;
}));