UNPKG

@tidepool/viz

Version:

Tidepool data visualization for diabetes device data.

936 lines (813 loc) • 1.93 MB
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.PDFDocument = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ var Data; Data = (function() { function Data(data) { this.data = data != null ? data : []; this.pos = 0; this.length = this.data.length; } Data.prototype.readByte = function() { return this.data[this.pos++]; }; Data.prototype.writeByte = function(byte) { return this.data[this.pos++] = byte; }; Data.prototype.byteAt = function(index) { return this.data[index]; }; Data.prototype.readBool = function() { return !!this.readByte(); }; Data.prototype.writeBool = function(val) { return this.writeByte(val ? 1 : 0); }; Data.prototype.readUInt32 = function() { var b1, b2, b3, b4; b1 = this.readByte() * 0x1000000; b2 = this.readByte() << 16; b3 = this.readByte() << 8; b4 = this.readByte(); return b1 + b2 + b3 + b4; }; Data.prototype.writeUInt32 = function(val) { this.writeByte((val >>> 24) & 0xff); this.writeByte((val >> 16) & 0xff); this.writeByte((val >> 8) & 0xff); return this.writeByte(val & 0xff); }; Data.prototype.readInt32 = function() { var int; int = this.readUInt32(); if (int >= 0x80000000) { return int - 0x100000000; } else { return int; } }; Data.prototype.writeInt32 = function(val) { if (val < 0) { val += 0x100000000; } return this.writeUInt32(val); }; Data.prototype.readUInt16 = function() { var b1, b2; b1 = this.readByte() << 8; b2 = this.readByte(); return b1 | b2; }; Data.prototype.writeUInt16 = function(val) { this.writeByte((val >> 8) & 0xff); return this.writeByte(val & 0xff); }; Data.prototype.readInt16 = function() { var int; int = this.readUInt16(); if (int >= 0x8000) { return int - 0x10000; } else { return int; } }; Data.prototype.writeInt16 = function(val) { if (val < 0) { val += 0x10000; } return this.writeUInt16(val); }; Data.prototype.readString = function(length) { var i, ret, _i; ret = []; for (i = _i = 0; 0 <= length ? _i < length : _i > length; i = 0 <= length ? ++_i : --_i) { ret[i] = String.fromCharCode(this.readByte()); } return ret.join(''); }; Data.prototype.writeString = function(val) { var i, _i, _ref, _results; _results = []; for (i = _i = 0, _ref = val.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) { _results.push(this.writeByte(val.charCodeAt(i))); } return _results; }; Data.prototype.stringAt = function(pos, length) { this.pos = pos; return this.readString(length); }; Data.prototype.readShort = function() { return this.readInt16(); }; Data.prototype.writeShort = function(val) { return this.writeInt16(val); }; Data.prototype.readLongLong = function() { var b1, b2, b3, b4, b5, b6, b7, b8; b1 = this.readByte(); b2 = this.readByte(); b3 = this.readByte(); b4 = this.readByte(); b5 = this.readByte(); b6 = this.readByte(); b7 = this.readByte(); b8 = this.readByte(); if (b1 & 0x80) { return ((b1 ^ 0xff) * 0x100000000000000 + (b2 ^ 0xff) * 0x1000000000000 + (b3 ^ 0xff) * 0x10000000000 + (b4 ^ 0xff) * 0x100000000 + (b5 ^ 0xff) * 0x1000000 + (b6 ^ 0xff) * 0x10000 + (b7 ^ 0xff) * 0x100 + (b8 ^ 0xff) + 1) * -1; } return b1 * 0x100000000000000 + b2 * 0x1000000000000 + b3 * 0x10000000000 + b4 * 0x100000000 + b5 * 0x1000000 + b6 * 0x10000 + b7 * 0x100 + b8; }; Data.prototype.writeLongLong = function(val) { var high, low; high = Math.floor(val / 0x100000000); low = val & 0xffffffff; this.writeByte((high >> 24) & 0xff); this.writeByte((high >> 16) & 0xff); this.writeByte((high >> 8) & 0xff); this.writeByte(high & 0xff); this.writeByte((low >> 24) & 0xff); this.writeByte((low >> 16) & 0xff); this.writeByte((low >> 8) & 0xff); return this.writeByte(low & 0xff); }; Data.prototype.readInt = function() { return this.readInt32(); }; Data.prototype.writeInt = function(val) { return this.writeInt32(val); }; Data.prototype.slice = function(start, end) { return this.data.slice(start, end); }; Data.prototype.read = function(bytes) { var buf, i, _i; buf = []; for (i = _i = 0; 0 <= bytes ? _i < bytes : _i > bytes; i = 0 <= bytes ? ++_i : --_i) { buf.push(this.readByte()); } return buf; }; Data.prototype.write = function(bytes) { var byte, _i, _len, _results; _results = []; for (_i = 0, _len = bytes.length; _i < _len; _i++) { byte = bytes[_i]; _results.push(this.writeByte(byte)); } return _results; }; return Data; })(); module.exports = Data; },{}],2:[function(require,module,exports){ (function (Buffer){ /* PDFDocument - represents an entire PDF document By Devon Govett */ var PDFDocument, PDFObject, PDFPage, PDFReference, fs, stream, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; stream = require('stream'); fs = require('fs'); PDFObject = require('./object'); PDFReference = require('./reference'); PDFPage = require('./page'); PDFDocument = (function(_super) { var mixin; __extends(PDFDocument, _super); function PDFDocument(options) { var key, val, _ref, _ref1; this.options = options != null ? options : {}; PDFDocument.__super__.constructor.apply(this, arguments); this.version = 1.3; this.compress = (_ref = this.options.compress) != null ? _ref : true; this._pageBuffer = []; this._pageBufferStart = 0; this._offsets = []; this._waiting = 0; this._ended = false; this._offset = 0; this._root = this.ref({ Type: 'Catalog', Pages: this.ref({ Type: 'Pages', Count: 0, Kids: [] }) }); this.page = null; this.initColor(); this.initVector(); this.initFonts(); this.initText(); this.initImages(); this.info = { Producer: 'PDFKit', Creator: 'PDFKit', CreationDate: new Date() }; if (this.options.info) { _ref1 = this.options.info; for (key in _ref1) { val = _ref1[key]; this.info[key] = val; } } this._write("%PDF-" + this.version); this._write("%\xFF\xFF\xFF\xFF"); if (this.options.autoFirstPage !== false) { this.addPage(); } } mixin = function(methods) { var method, name, _results; _results = []; for (name in methods) { method = methods[name]; _results.push(PDFDocument.prototype[name] = method); } return _results; }; mixin(require('./mixins/color')); mixin(require('./mixins/vector')); mixin(require('./mixins/fonts')); mixin(require('./mixins/text')); mixin(require('./mixins/images')); mixin(require('./mixins/annotations')); PDFDocument.prototype.addPage = function(options) { var pages; if (options == null) { options = this.options; } if (!this.options.bufferPages) { this.flushPages(); } this.page = new PDFPage(this, options); this._pageBuffer.push(this.page); pages = this._root.data.Pages.data; pages.Kids.push(this.page.dictionary); pages.Count++; this.x = this.page.margins.left; this.y = this.page.margins.top; this._ctm = [1, 0, 0, 1, 0, 0]; this.transform(1, 0, 0, -1, 0, this.page.height); this.emit('pageAdded'); return this; }; PDFDocument.prototype.bufferedPageRange = function() { return { start: this._pageBufferStart, count: this._pageBuffer.length }; }; PDFDocument.prototype.switchToPage = function(n) { var page; if (!(page = this._pageBuffer[n - this._pageBufferStart])) { throw new Error("switchToPage(" + n + ") out of bounds, current buffer covers pages " + this._pageBufferStart + " to " + (this._pageBufferStart + this._pageBuffer.length - 1)); } return this.page = page; }; PDFDocument.prototype.flushPages = function() { var page, pages, _i, _len; pages = this._pageBuffer; this._pageBuffer = []; this._pageBufferStart += pages.length; for (_i = 0, _len = pages.length; _i < _len; _i++) { page = pages[_i]; page.end(); } }; PDFDocument.prototype.ref = function(data) { var ref; ref = new PDFReference(this, this._offsets.length + 1, data); this._offsets.push(null); this._waiting++; return ref; }; PDFDocument.prototype._read = function() {}; PDFDocument.prototype._write = function(data) { if (!Buffer.isBuffer(data)) { data = new Buffer(data + '\n', 'binary'); } this.push(data); return this._offset += data.length; }; PDFDocument.prototype.addContent = function(data) { this.page.write(data); return this; }; PDFDocument.prototype._refEnd = function(ref) { this._offsets[ref.id - 1] = ref.offset; if (--this._waiting === 0 && this._ended) { this._finalize(); return this._ended = false; } }; PDFDocument.prototype.write = function(filename, fn) { var err; err = new Error('PDFDocument#write is deprecated, and will be removed in a future version of PDFKit. Please pipe the document into a Node stream.'); console.warn(err.stack); this.pipe(fs.createWriteStream(filename)); this.end(); return this.once('end', fn); }; PDFDocument.prototype.output = function(fn) { throw new Error('PDFDocument#output is deprecated, and has been removed from PDFKit. Please pipe the document into a Node stream.'); }; PDFDocument.prototype.end = function() { var font, key, name, val, _ref, _ref1; this.flushPages(); this._info = this.ref(); _ref = this.info; for (key in _ref) { val = _ref[key]; if (typeof val === 'string') { val = new String(val); } this._info.data[key] = val; } this._info.end(); _ref1 = this._fontFamilies; for (name in _ref1) { font = _ref1[name]; font.finalize(); } this._root.end(); this._root.data.Pages.end(); if (this._waiting === 0) { return this._finalize(); } else { return this._ended = true; } }; PDFDocument.prototype._finalize = function(fn) { var offset, xRefOffset, _i, _len, _ref; xRefOffset = this._offset; this._write("xref"); this._write("0 " + (this._offsets.length + 1)); this._write("0000000000 65535 f "); _ref = this._offsets; for (_i = 0, _len = _ref.length; _i < _len; _i++) { offset = _ref[_i]; offset = ('0000000000' + offset).slice(-10); this._write(offset + ' 00000 n '); } this._write('trailer'); this._write(PDFObject.convert({ Size: this._offsets.length + 1, Root: this._root, Info: this._info })); this._write('startxref'); this._write("" + xRefOffset); this._write('%%EOF'); return this.push(null); }; PDFDocument.prototype.toString = function() { return "[object PDFDocument]"; }; return PDFDocument; })(stream.Readable); module.exports = PDFDocument; }).call(this,require("buffer").Buffer) },{"./mixins/annotations":12,"./mixins/color":13,"./mixins/fonts":14,"./mixins/images":15,"./mixins/text":16,"./mixins/vector":17,"./object":18,"./page":19,"./reference":21,"buffer":60,"fs":59,"stream":216}],3:[function(require,module,exports){ (function (Buffer){ var EmbeddedFont, PDFFont, StandardFont, fontkit; fontkit = require('fontkit'); PDFFont = (function() { PDFFont.open = function(document, src, family, id) { var font; if (typeof src === 'string') { if (StandardFont.isStandardFont(src)) { return new StandardFont(document, src, id); } font = fontkit.openSync(src, family); } else if (Buffer.isBuffer(src)) { font = fontkit.create(src, family); } else if (src instanceof Uint8Array) { font = fontkit.create(new Buffer(src), family); } else if (src instanceof ArrayBuffer) { font = fontkit.create(new Buffer(new Uint8Array(src)), family); } if (font == null) { throw new Error('Not a supported font format or standard PDF font.'); } return new EmbeddedFont(document, font, id); }; function PDFFont() { throw new Error('Cannot construct a PDFFont directly.'); } PDFFont.prototype.encode = function(text) { throw new Error('Must be implemented by subclasses'); }; PDFFont.prototype.widthOfString = function(text) { throw new Error('Must be implemented by subclasses'); }; PDFFont.prototype.ref = function() { return this.dictionary != null ? this.dictionary : this.dictionary = this.document.ref(); }; PDFFont.prototype.finalize = function() { if (this.embedded || (this.dictionary == null)) { return; } this.embed(); return this.embedded = true; }; PDFFont.prototype.embed = function() { throw new Error('Must be implemented by subclasses'); }; PDFFont.prototype.lineHeight = function(size, includeGap) { var gap; if (includeGap == null) { includeGap = false; } gap = includeGap ? this.lineGap : 0; return (this.ascender + gap - this.descender) / 1000 * size; }; return PDFFont; })(); module.exports = PDFFont; StandardFont = require('./font/standard'); EmbeddedFont = require('./font/embedded'); }).call(this,require("buffer").Buffer) },{"./font/embedded":5,"./font/standard":6,"buffer":60,"fontkit":165}],4:[function(require,module,exports){ var AFMFont, fs; fs = require('fs'); AFMFont = (function() { var WIN_ANSI_MAP, characters; AFMFont.open = function(filename) { return new AFMFont(fs.readFileSync(filename, 'utf8')); }; function AFMFont(contents) { var e, i; this.contents = contents; this.attributes = {}; this.glyphWidths = {}; this.boundingBoxes = {}; this.kernPairs = {}; this.parse(); this.charWidths = (function() { var _i, _results; _results = []; for (i = _i = 0; _i <= 255; i = ++_i) { _results.push(this.glyphWidths[characters[i]]); } return _results; }).call(this); this.bbox = (function() { var _i, _len, _ref, _results; _ref = this.attributes['FontBBox'].split(/\s+/); _results = []; for (_i = 0, _len = _ref.length; _i < _len; _i++) { e = _ref[_i]; _results.push(+e); } return _results; }).call(this); this.ascender = +(this.attributes['Ascender'] || 0); this.descender = +(this.attributes['Descender'] || 0); this.lineGap = (this.bbox[3] - this.bbox[1]) - (this.ascender - this.descender); } AFMFont.prototype.parse = function() { var a, key, line, match, name, section, value, _i, _len, _ref; section = ''; _ref = this.contents.split('\n'); for (_i = 0, _len = _ref.length; _i < _len; _i++) { line = _ref[_i]; if (match = line.match(/^Start(\w+)/)) { section = match[1]; continue; } else if (match = line.match(/^End(\w+)/)) { section = ''; continue; } switch (section) { case 'FontMetrics': match = line.match(/(^\w+)\s+(.*)/); key = match[1]; value = match[2]; if (a = this.attributes[key]) { if (!Array.isArray(a)) { a = this.attributes[key] = [a]; } a.push(value); } else { this.attributes[key] = value; } break; case 'CharMetrics': if (!/^CH?\s/.test(line)) { continue; } name = line.match(/\bN\s+(\.?\w+)\s*;/)[1]; this.glyphWidths[name] = +line.match(/\bWX\s+(\d+)\s*;/)[1]; break; case 'KernPairs': match = line.match(/^KPX\s+(\.?\w+)\s+(\.?\w+)\s+(-?\d+)/); if (match) { this.kernPairs[match[1] + '\0' + match[2]] = parseInt(match[3]); } } } }; WIN_ANSI_MAP = { 402: 131, 8211: 150, 8212: 151, 8216: 145, 8217: 146, 8218: 130, 8220: 147, 8221: 148, 8222: 132, 8224: 134, 8225: 135, 8226: 149, 8230: 133, 8364: 128, 8240: 137, 8249: 139, 8250: 155, 710: 136, 8482: 153, 338: 140, 339: 156, 732: 152, 352: 138, 353: 154, 376: 159, 381: 142, 382: 158 }; AFMFont.prototype.encodeText = function(text) { var char, i, res, _i, _ref; res = []; for (i = _i = 0, _ref = text.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) { char = text.charCodeAt(i); char = WIN_ANSI_MAP[char] || char; res.push(char.toString(16)); } return res; }; AFMFont.prototype.glyphsForString = function(string) { var charCode, glyphs, i, _i, _ref; glyphs = []; for (i = _i = 0, _ref = string.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) { charCode = string.charCodeAt(i); glyphs.push(this.characterToGlyph(charCode)); } return glyphs; }; AFMFont.prototype.characterToGlyph = function(character) { return characters[WIN_ANSI_MAP[character] || character] || '.notdef'; }; AFMFont.prototype.widthOfGlyph = function(glyph) { return this.glyphWidths[glyph] || 0; }; AFMFont.prototype.getKernPair = function(left, right) { return this.kernPairs[left + '\0' + right] || 0; }; AFMFont.prototype.advancesForGlyphs = function(glyphs) { var advances, index, left, right, _i, _len; advances = []; for (index = _i = 0, _len = glyphs.length; _i < _len; index = ++_i) { left = glyphs[index]; right = glyphs[index + 1]; advances.push(this.widthOfGlyph(left) + this.getKernPair(left, right)); } return advances; }; characters = '.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n\nspace exclam quotedbl numbersign\ndollar percent ampersand quotesingle\nparenleft parenright asterisk plus\ncomma hyphen period slash\nzero one two three\nfour five six seven\neight nine colon semicolon\nless equal greater question\n\nat A B C\nD E F G\nH I J K\nL M N O\nP Q R S\nT U V W\nX Y Z bracketleft\nbackslash bracketright asciicircum underscore\n\ngrave a b c\nd e f g\nh i j k\nl m n o\np q r s\nt u v w\nx y z braceleft\nbar braceright asciitilde .notdef\n\nEuro .notdef quotesinglbase florin\nquotedblbase ellipsis dagger daggerdbl\ncircumflex perthousand Scaron guilsinglleft\nOE .notdef Zcaron .notdef\n.notdef quoteleft quoteright quotedblleft\nquotedblright bullet endash emdash\ntilde trademark scaron guilsinglright\noe .notdef zcaron ydieresis\n\nspace exclamdown cent sterling\ncurrency yen brokenbar section\ndieresis copyright ordfeminine guillemotleft\nlogicalnot hyphen registered macron\ndegree plusminus twosuperior threesuperior\nacute mu paragraph periodcentered\ncedilla onesuperior ordmasculine guillemotright\nonequarter onehalf threequarters questiondown\n\nAgrave Aacute Acircumflex Atilde\nAdieresis Aring AE Ccedilla\nEgrave Eacute Ecircumflex Edieresis\nIgrave Iacute Icircumflex Idieresis\nEth Ntilde Ograve Oacute\nOcircumflex Otilde Odieresis multiply\nOslash Ugrave Uacute Ucircumflex\nUdieresis Yacute Thorn germandbls\n\nagrave aacute acircumflex atilde\nadieresis aring ae ccedilla\negrave eacute ecircumflex edieresis\nigrave iacute icircumflex idieresis\neth ntilde ograve oacute\nocircumflex otilde odieresis divide\noslash ugrave uacute ucircumflex\nudieresis yacute thorn ydieresis'.split(/\s+/); return AFMFont; })(); module.exports = AFMFont; },{"fs":59}],5:[function(require,module,exports){ var EmbeddedFont, PDFFont, PDFObject, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, __slice = [].slice; PDFFont = require('../font'); PDFObject = require('../object'); EmbeddedFont = (function(_super) { var toHex; __extends(EmbeddedFont, _super); function EmbeddedFont(document, font, id) { this.document = document; this.font = font; this.id = id; this.subset = this.font.createSubset(); this.unicode = [[0]]; this.widths = [this.font.getGlyph(0).advanceWidth]; this.name = this.font.postscriptName; this.scale = 1000 / this.font.unitsPerEm; this.ascender = this.font.ascent * this.scale; this.descender = this.font.descent * this.scale; this.lineGap = this.font.lineGap * this.scale; this.bbox = this.font.bbox; } EmbeddedFont.prototype.encode = function(text, features) { var gid, glyph, glyphs, i, key, positions, res, _base, _base1, _i, _len, _ref; _ref = this.font.layout(text, features), glyphs = _ref.glyphs, positions = _ref.positions; res = []; for (i = _i = 0, _len = glyphs.length; _i < _len; i = ++_i) { glyph = glyphs[i]; gid = this.subset.includeGlyph(glyph.id); res.push(('0000' + gid.toString(16)).slice(-4)); if ((_base = this.widths)[gid] == null) { _base[gid] = glyph.advanceWidth * this.scale; } if ((_base1 = this.unicode)[gid] == null) { _base1[gid] = glyph.codePoints; } for (key in positions[i]) { positions[i][key] *= this.scale; } positions[i].advanceWidth = glyph.advanceWidth * this.scale; } return [res, positions]; }; EmbeddedFont.prototype.widthOfString = function(string, size, features) { var scale, width; width = this.font.layout(string, features).advanceWidth; scale = size / this.font.unitsPerEm; return width * scale; }; EmbeddedFont.prototype.embed = function() { var bbox, descendantFont, descriptor, familyClass, flags, fontFile, i, isCFF, name, tag, _ref; isCFF = this.subset.cff != null; fontFile = this.document.ref(); if (isCFF) { fontFile.data.Subtype = 'CIDFontType0C'; } this.subset.encodeStream().pipe(fontFile); familyClass = (((_ref = this.font['OS/2']) != null ? _ref.sFamilyClass : void 0) || 0) >> 8; flags = 0; if (this.font.post.isFixedPitch) { flags |= 1 << 0; } if ((1 <= familyClass && familyClass <= 7)) { flags |= 1 << 1; } flags |= 1 << 2; if (familyClass === 10) { flags |= 1 << 3; } if (this.font.head.macStyle.italic) { flags |= 1 << 6; } tag = ((function() { var _i, _results; _results = []; for (i = _i = 0; _i < 6; i = ++_i) { _results.push(String.fromCharCode(Math.random() * 26 + 65)); } return _results; })()).join(''); name = tag + '+' + this.font.postscriptName; bbox = this.font.bbox; descriptor = this.document.ref({ Type: 'FontDescriptor', FontName: name, Flags: flags, FontBBox: [bbox.minX * this.scale, bbox.minY * this.scale, bbox.maxX * this.scale, bbox.maxY * this.scale], ItalicAngle: this.font.italicAngle, Ascent: this.ascender, Descent: this.descender, CapHeight: (this.font.capHeight || this.font.ascent) * this.scale, XHeight: (this.font.xHeight || 0) * this.scale, StemV: 0 }); if (isCFF) { descriptor.data.FontFile3 = fontFile; } else { descriptor.data.FontFile2 = fontFile; } descriptor.end(); descendantFont = this.document.ref({ Type: 'Font', Subtype: isCFF ? 'CIDFontType0' : 'CIDFontType2', BaseFont: name, CIDSystemInfo: { Registry: new String('Adobe'), Ordering: new String('Identity'), Supplement: 0 }, FontDescriptor: descriptor, W: [0, this.widths] }); descendantFont.end(); this.dictionary.data = { Type: 'Font', Subtype: 'Type0', BaseFont: name, Encoding: 'Identity-H', DescendantFonts: [descendantFont], ToUnicode: this.toUnicodeCmap() }; return this.dictionary.end(); }; toHex = function() { var code, codePoints, codes; codePoints = 1 <= arguments.length ? __slice.call(arguments, 0) : []; codes = (function() { var _i, _len, _results; _results = []; for (_i = 0, _len = codePoints.length; _i < _len; _i++) { code = codePoints[_i]; _results.push(('0000' + code.toString(16)).slice(-4)); } return _results; })(); return codes.join(''); }; EmbeddedFont.prototype.toUnicodeCmap = function() { var cmap, codePoints, encoded, entries, value, _i, _j, _len, _len1, _ref; cmap = this.document.ref(); entries = []; _ref = this.unicode; for (_i = 0, _len = _ref.length; _i < _len; _i++) { codePoints = _ref[_i]; encoded = []; for (_j = 0, _len1 = codePoints.length; _j < _len1; _j++) { value = codePoints[_j]; if (value > 0xffff) { value -= 0x10000; encoded.push(toHex(value >>> 10 & 0x3ff | 0xd800)); value = 0xdc00 | value & 0x3ff; } encoded.push(toHex(value)); } entries.push("<" + (encoded.join(' ')) + ">"); } cmap.end("/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap\n/CIDSystemInfo <<\n /Registry (Adobe)\n /Ordering (UCS)\n /Supplement 0\n>> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange\n<0000><ffff>\nendcodespacerange\n1 beginbfrange\n<0000> <" + (toHex(entries.length - 1)) + "> [" + (entries.join(' ')) + "]\nendbfrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend"); return cmap; }; return EmbeddedFont; })(PDFFont); module.exports = EmbeddedFont; },{"../font":3,"../object":18}],6:[function(require,module,exports){ var AFMFont, PDFFont, StandardFont, fs, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; AFMFont = require('./afm'); PDFFont = require('../font'); fs = require('fs'); StandardFont = (function(_super) { var STANDARD_FONTS; __extends(StandardFont, _super); function StandardFont(document, name, id) { var _ref; this.document = document; this.name = name; this.id = id; this.font = new AFMFont(STANDARD_FONTS[this.name]()); _ref = this.font, this.ascender = _ref.ascender, this.descender = _ref.descender, this.bbox = _ref.bbox, this.lineGap = _ref.lineGap; } StandardFont.prototype.embed = function() { this.dictionary.data = { Type: 'Font', BaseFont: this.name, Subtype: 'Type1', Encoding: 'WinAnsiEncoding' }; return this.dictionary.end(); }; StandardFont.prototype.encode = function(text) { var advances, encoded, glyph, glyphs, i, positions, _i, _len; encoded = this.font.encodeText(text); glyphs = this.font.glyphsForString('' + text); advances = this.font.advancesForGlyphs(glyphs); positions = []; for (i = _i = 0, _len = glyphs.length; _i < _len; i = ++_i) { glyph = glyphs[i]; positions.push({ xAdvance: advances[i], yAdvance: 0, xOffset: 0, yOffset: 0, advanceWidth: this.font.widthOfGlyph(glyph) }); } return [encoded, positions]; }; StandardFont.prototype.widthOfString = function(string, size) { var advance, advances, glyphs, scale, width, _i, _len; glyphs = this.font.glyphsForString('' + string); advances = this.font.advancesForGlyphs(glyphs); width = 0; for (_i = 0, _len = advances.length; _i < _len; _i++) { advance = advances[_i]; width += advance; } scale = size / 1000; return width * scale; }; StandardFont.isStandardFont = function(name) { return name in STANDARD_FONTS; }; STANDARD_FONTS = { "Courier": function() { return "StartFontMetrics 4.1\nComment Copyright (c) 1989, 1990, 1991, 1992, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.\nComment Creation Date: Thu May 1 17:27:09 1997\nComment UniqueID 43050\nComment VMusage 39754 50779\nFontName Courier\nFullName Courier\nFamilyName Courier\nWeight Medium\nItalicAngle 0\nIsFixedPitch true\nCharacterSet ExtendedRoman\nFontBBox -23 -250 715 805 \nUnderlinePosition -100\nUnderlineThickness 50\nVersion 003.000\nNotice Copyright (c) 1989, 1990, 1991, 1992, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.\nEncodingScheme AdobeStandardEncoding\nCapHeight 562\nXHeight 426\nAscender 629\nDescender -157\nStdHW 51\nStdVW 51\nStartCharMetrics 315\nC 32 ; WX 600 ; N space ; B 0 0 0 0 ;\nC 33 ; WX 600 ; N exclam ; B 236 -15 364 572 ;\nC 34 ; WX 600 ; N quotedbl ; B 187 328 413 562 ;\nC 35 ; WX 600 ; N numbersign ; B 93 -32 507 639 ;\nC 36 ; WX 600 ; N dollar ; B 105 -126 496 662 ;\nC 37 ; WX 600 ; N percent ; B 81 -15 518 622 ;\nC 38 ; WX 600 ; N ampersand ; B 63 -15 538 543 ;\nC 39 ; WX 600 ; N quoteright ; B 213 328 376 562 ;\nC 40 ; WX 600 ; N parenleft ; B 269 -108 440 622 ;\nC 41 ; WX 600 ; N parenright ; B 160 -108 331 622 ;\nC 42 ; WX 600 ; N asterisk ; B 116 257 484 607 ;\nC 43 ; WX 600 ; N plus ; B 80 44 520 470 ;\nC 44 ; WX 600 ; N comma ; B 181 -112 344 122 ;\nC 45 ; WX 600 ; N hyphen ; B 103 231 497 285 ;\nC 46 ; WX 600 ; N period ; B 229 -15 371 109 ;\nC 47 ; WX 600 ; N slash ; B 125 -80 475 629 ;\nC 48 ; WX 600 ; N zero ; B 106 -15 494 622 ;\nC 49 ; WX 600 ; N one ; B 96 0 505 622 ;\nC 50 ; WX 600 ; N two ; B 70 0 471 622 ;\nC 51 ; WX 600 ; N three ; B 75 -15 466 622 ;\nC 52 ; WX 600 ; N four ; B 78 0 500 622 ;\nC 53 ; WX 600 ; N five ; B 92 -15 497 607 ;\nC 54 ; WX 600 ; N six ; B 111 -15 497 622 ;\nC 55 ; WX 600 ; N seven ; B 82 0 483 607 ;\nC 56 ; WX 600 ; N eight ; B 102 -15 498 622 ;\nC 57 ; WX 600 ; N nine ; B 96 -15 489 622 ;\nC 58 ; WX 600 ; N colon ; B 229 -15 371 385 ;\nC 59 ; WX 600 ; N semicolon ; B 181 -112 371 385 ;\nC 60 ; WX 600 ; N less ; B 41 42 519 472 ;\nC 61 ; WX 600 ; N equal ; B 80 138 520 376 ;\nC 62 ; WX 600 ; N greater ; B 66 42 544 472 ;\nC 63 ; WX 600 ; N question ; B 129 -15 492 572 ;\nC 64 ; WX 600 ; N at ; B 77 -15 533 622 ;\nC 65 ; WX 600 ; N A ; B 3 0 597 562 ;\nC 66 ; WX 600 ; N B ; B 43 0 559 562 ;\nC 67 ; WX 600 ; N C ; B 41 -18 540 580 ;\nC 68 ; WX 600 ; N D ; B 43 0 574 562 ;\nC 69 ; WX 600 ; N E ; B 53 0 550 562 ;\nC 70 ; WX 600 ; N F ; B 53 0 545 562 ;\nC 71 ; WX 600 ; N G ; B 31 -18 575 580 ;\nC 72 ; WX 600 ; N H ; B 32 0 568 562 ;\nC 73 ; WX 600 ; N I ; B 96 0 504 562 ;\nC 74 ; WX 600 ; N J ; B 34 -18 566 562 ;\nC 75 ; WX 600 ; N K ; B 38 0 582 562 ;\nC 76 ; WX 600 ; N L ; B 47 0 554 562 ;\nC 77 ; WX 600 ; N M ; B 4 0 596 562 ;\nC 78 ; WX 600 ; N N ; B 7 -13 593 562 ;\nC 79 ; WX 600 ; N O ; B 43 -18 557 580 ;\nC 80 ; WX 600 ; N P ; B 79 0 558 562 ;\nC 81 ; WX 600 ; N Q ; B 43 -138 557 580 ;\nC 82 ; WX 600 ; N R ; B 38 0 588 562 ;\nC 83 ; WX 600 ; N S ; B 72 -20 529 580 ;\nC 84 ; WX 600 ; N T ; B 38 0 563 562 ;\nC 85 ; WX 600 ; N U ; B 17 -18 583 562 ;\nC 86 ; WX 600 ; N V ; B -4 -13 604 562 ;\nC 87 ; WX 600 ; N W ; B -3 -13 603 562 ;\nC 88 ; WX 600 ; N X ; B 23 0 577 562 ;\nC 89 ; WX 600 ; N Y ; B 24 0 576 562 ;\nC 90 ; WX 600 ; N Z ; B 86 0 514 562 ;\nC 91 ; WX 600 ; N bracketleft ; B 269 -108 442 622 ;\nC 92 ; WX 600 ; N backslash ; B 118 -80 482 629 ;\nC 93 ; WX 600 ; N bracketright ; B 158 -108 331 622 ;\nC 94 ; WX 600 ; N asciicircum ; B 94 354 506 622 ;\nC 95 ; WX 600 ; N underscore ; B 0 -125 600 -75 ;\nC 96 ; WX 600 ; N quoteleft ; B 224 328 387 562 ;\nC 97 ; WX 600 ; N a ; B 53 -15 559 441 ;\nC 98 ; WX 600 ; N b ; B 14 -15 575 629 ;\nC 99 ; WX 600 ; N c ; B 66 -15 529 441 ;\nC 100 ; WX 600 ; N d ; B 45 -15 591 629 ;\nC 101 ; WX 600 ; N e ; B 66 -15 548 441 ;\nC 102 ; WX 600 ; N f ; B 114 0 531 629 ; L i fi ; L l fl ;\nC 103 ; WX 600 ; N g ; B 45 -157 566 441 ;\nC 104 ; WX 600 ; N h ; B 18 0 582 629 ;\nC 105 ; WX 600 ; N i ; B 95 0 505 657 ;\nC 106 ; WX 600 ; N j ; B 82 -157 410 657 ;\nC 107 ; WX 600 ; N k ; B 43 0 580 629 ;\nC 108 ; WX 600 ; N l ; B 95 0 505 629 ;\nC 109 ; WX 600 ; N m ; B -5 0 605 441 ;\nC 110 ; WX 600 ; N n ; B 26 0 575 441 ;\nC 111 ; WX 600 ; N o ; B 62 -15 538 441 ;\nC 112 ; WX 600 ; N p ; B 9 -157 555 441 ;\nC 113 ; WX 600 ; N q ; B 45 -157 591 441 ;\nC 114 ; WX 600 ; N r ; B 60 0 559 441 ;\nC 115 ; WX 600 ; N s ; B 80 -15 513 441 ;\nC 116 ; WX 600 ; N t ; B 87 -15 530 561 ;\nC 117 ; WX 600 ; N u ; B 21 -15 562 426 ;\nC 118 ; WX 600 ; N v ; B 10 -10 590 426 ;\nC 119 ; WX 600 ; N w ; B -4 -10 604 426 ;\nC 120 ; WX 600 ; N x ; B 20 0 580 426 ;\nC 121 ; WX 600 ; N y ; B 7 -157 592 426 ;\nC 122 ; WX 600 ; N z ; B 99 0 502 426 ;\nC 123 ; WX 600 ; N braceleft ; B 182 -108 437 622 ;\nC 124 ; WX 600 ; N bar ; B 275 -250 326 750 ;\nC 125 ; WX 600 ; N braceright ; B 163 -108 418 622 ;\nC 126 ; WX 600 ; N asciitilde ; B 63 197 540 320 ;\nC 161 ; WX 600 ; N exclamdown ; B 236 -157 364 430 ;\nC 162 ; WX 600 ; N cent ; B 96 -49 500 614 ;\nC 163 ; WX 600 ; N sterling ; B 84 -21 521 611 ;\nC 164 ; WX 600 ; N fraction ; B 92 -57 509 665 ;\nC 165 ; WX 600 ; N yen ; B 26 0 574 562 ;\nC 166 ; WX 600 ; N florin ; B 4 -143 539 622 ;\nC 167 ; WX 600 ; N section ; B 113 -78 488 580 ;\nC 168 ; WX 600 ; N currency ; B 73 58 527 506 ;\nC 169 ; WX 600 ; N quotesingle ; B 259 328 341 562 ;\nC 170 ; WX 600 ; N quotedblleft ; B 143 328 471 562 ;\nC 171 ; WX 600 ; N guillemotleft ; B 37 70 563 446 ;\nC 172 ; WX 600 ; N guilsinglleft ; B 149 70 451 446 ;\nC 173 ; WX 600 ; N guilsinglright ; B 149 70 451 446 ;\nC 174 ; WX 600 ; N fi ; B 3 0 597 629 ;\nC 175 ; WX 600 ; N fl ; B 3 0 597 629 ;\nC 177 ; WX 600 ; N endash ; B 75 231 525 285 ;\nC 178 ; WX 600 ; N dagger ; B 141 -78 459 580 ;\nC 179 ; WX 600 ; N daggerdbl ; B 141 -78 459 580 ;\nC 180 ; WX 600 ; N periodcentered ; B 222 189 378 327 ;\nC 182 ; WX 600 ; N paragraph ; B 50 -78 511 562 ;\nC 183 ; WX 600 ; N bullet ; B 172 130 428 383 ;\nC 184 ; WX 600 ; N quotesinglbase ; B 213 -134 376 100 ;\nC 185 ; WX 600 ; N quotedblbase ; B 143 -134 457 100 ;\nC 186 ; WX 600 ; N quotedblright ; B 143 328 457 562 ;\nC 187 ; WX 600 ; N guillemotright ; B 37 70 563 446 ;\nC 188 ; WX 600 ; N ellipsis ; B 37 -15 563 111 ;\nC 189 ; WX 600 ; N perthousand ; B 3 -15 600 622 ;\nC 191 ; WX 600 ; N questiondown ; B 108 -157 471 430 ;\nC 193 ; WX 600 ; N grave ; B 151 497 378 672 ;\nC 194 ; WX 600 ; N acute ; B 242 497 469 672 ;\nC 195 ; WX 600 ; N circumflex ; B 124 477 476 654 ;\nC 196 ; WX 600 ; N tilde ; B 105 489 503 606 ;\nC 197 ; WX 600 ; N macron ; B 120 525 480 565 ;\nC 198 ; WX 600 ; N breve ; B 153 501 447 609 ;\nC 199 ; WX 600 ; N dotaccent ; B 249 537 352 640 ;\nC 200 ; WX 600 ; N dieresis ; B 148 537 453 640 ;\nC 202 ; WX 600 ; N ring ; B 218 463 382 627 ;\nC 203 ; WX 600 ; N cedilla ; B 224 -151 362 10 ;\nC 205 ; WX 600 ; N hungarumlaut ; B 133 497 540 672 ;\nC 206 ; WX 600 ; N ogonek ; B 211 -172 407 4 ;\nC 207 ; WX 600 ; N caron ; B 124 492 476 669 ;\nC 208 ; WX 600 ; N emdash ; B 0 231 600 285 ;\nC 225 ; WX 600 ; N AE ; B 3 0 550 562 ;\nC 227 ; WX 600 ; N ordfeminine ; B 156 249 442 580 ;\nC 232 ; WX 600 ; N Lslash ; B 47 0 554 562 ;\nC 233 ; WX 600 ; N Oslash ; B 43 -80 557 629 ;\nC 234 ; WX 600 ; N OE ; B 7 0 567 562 ;\nC 235 ; WX 600 ; N ordmasculine ; B 157 249 443 580 ;\nC 241 ; WX 600 ; N ae ; B 19 -15 570 441 ;\nC 245 ; WX 600 ; N dotlessi ; B 95 0 505 426 ;\nC 248 ; WX 600 ; N lslash ; B 95 0 505 629 ;\nC 249 ; WX 600 ; N oslash ; B 62 -80 538 506 ;\nC 250 ; WX 600 ; N oe ; B 19 -15 559 441 ;\nC 251 ; WX 600 ; N germandbls ; B 48 -15 588 629 ;\nC -1 ; WX 600 ; N Idieresis ; B 96 0 504 753 ;\nC -1 ; WX 600 ; N eacute ; B 66 -15 548 672 ;\nC -1 ; WX 600 ; N abreve ; B 53 -15 559 609 ;\nC -1 ; WX 600 ; N uhungarumlaut ; B 21 -15 580 672 ;\nC -1 ; WX 600 ; N ecaron ; B 66 -15 548 669 ;\nC -1 ; WX 600 ; N Ydieresis ; B 24 0 576 753 ;\nC -1 ; WX 600 ; N divide ; B 87 48 513 467 ;\nC -1 ; WX 600 ; N Yacute ; B 24 0 576 805 ;\nC -1 ; WX 600 ; N Acircumflex ; B 3 0 597 787 ;\nC -1 ; WX 600 ; N aacute ; B 53 -15 559 672 ;\nC -1 ; WX 600 ; N Ucircumflex ; B 17 -18 583 787 ;\nC -1 ; WX 600 ; N yacute ; B 7 -157 592 672 ;\nC -1 ; WX 600 ; N scommaaccent ; B 80 -250 513 441 ;\nC -1 ; WX 600 ; N ecircumflex ; B 66 -15 548 654 ;\nC -1 ; WX 600 ; N Uring ; B 17 -18 583 760 ;\nC -1 ; WX 600 ; N Udieresis ; B 17 -18 583 753 ;\nC -1 ; WX 600 ; N aogonek ; B 53 -172 587 441 ;\nC -1 ; WX 600 ; N Uacute ; B 17 -18 583 805 ;\nC -1 ; WX 600 ; N uogonek ; B 21 -172 590 426 ;\nC -1 ; WX 600 ; N Edieresis ; B 53 0 550 753 ;\nC -1 ; WX 600 ; N Dcroat ; B 30 0 574 562 ;\nC -1 ; WX 600 ; N commaaccent ; B 198 -250 335 -58 ;\nC -1 ; WX 600 ; N copyright ; B 0 -18 600 580 ;\nC -1 ; WX 600 ; N Emacron ; B 53 0 550 698 ;\nC -1 ; WX 600 ; N ccaron ; B 66 -15 529 669 ;\nC -1 ; WX 600 ; N aring ; B 53 -15 559 627 ;\nC -1 ; WX 600 ; N Ncommaaccent ; B 7 -250 593 562 ;\nC -1 ; WX 600 ; N lacute ; B 95 0 505 805 ;\nC -1 ; WX 600 ; N agrave ; B 53 -15 559 672 ;\nC -1 ; WX 600 ; N Tcommaaccent ; B 38 -250 563 562 ;\nC -1 ; WX 600 ; N Cacute ; B 41 -18 540 805 ;\nC -1 ; WX 600 ; N atilde ; B 53 -15 559 606 ;\nC -1 ; WX 600 ; N Edotaccent ; B 53 0 550 753 ;\nC -1 ; WX 600 ; N scaron ; B 80 -15 513 669 ;\nC -1 ; WX 600 ; N scedilla ; B 80 -151 513 441 ;\nC -1 ; WX 600 ; N iacute ; B 95 0 505 672 ;\nC -1 ; WX 600 ; N lozenge ; B 18 0 443 706 ;\nC -1 ; WX 600 ; N Rcaron ; B 38 0 588 802 ;\nC -1 ; WX 600 ; N Gcommaaccent ; B 31 -250 575 580 ;\nC -1 ; WX 600 ; N ucircumflex ; B 21 -15 562 654 ;\nC -1 ; WX 600 ; N acircumflex ; B 53 -15 559 654 ;\nC -1 ; WX 600 ; N Amacron ; B 3 0 597 698 ;\nC -1 ; WX 600 ; N rcaron ; B 60 0 559 669 ;\nC -1 ; WX 600 ; N ccedilla ; B 66 -151 529 441 ;\nC -1 ; WX 600 ; N Zdotaccent ; B 86 0 514 753 ;\nC -1 ; WX 600 ; N Thorn ; B 79 0 538 562 ;\nC -1 ; WX 600 ; N Omacron ; B 43 -18 557 698 ;\nC -1 ; WX 600 ; N Racute ; B 38 0 588 805 ;\nC -1 ; WX 600 ; N Sacute ; B 72 -20 529 805 ;\nC -1 ; WX 600 ; N dcaron ; B 45 -15 715 629 ;\nC -1 ; WX 600 ; N Umacron ; B 17 -18 583 698 ;\nC -1 ; WX 600 ; N uring ; B 21 -15 562 627 ;\nC -1 ; WX 600 ; N threesuperior ; B 155 240 406 622 ;\nC -1 ; WX 600 ; N Ograve ; B 43 -18 557 805 ;\nC -1 ; WX 600 ; N Agrave ; B 3 0 597 805 ;\nC -1 ; WX 600 ; N Abreve ; B 3 0 597 732 ;\nC -1 ; WX 600 ; N multiply ; B 87 43 515 470 ;\nC -1 ; WX 600 ; N uacute ; B 21 -15 562 672 ;\nC -1 ; WX 600 ; N Tcaron ; B 38 0 563 802 ;\nC -1 ; WX 600 ; N partialdiff ; B 17 -38 459 710 ;\nC -1 ; WX 600 ; N ydieresis ; B 7 -157 592 620 ;\nC -1 ; WX 600 ; N Nacute ; B 7 -13 593 805 ;\nC -1 ; WX 600 ; N icircumflex ; B 94 0 505 654 ;\nC -1 ; WX 600 ; N Ecircumflex ; B 53 0 550 787 ;\nC -1 ; WX 600 ; N adieresis ; B 53 -15 559 620 ;\nC -1 ; WX 600 ; N edieresis ; B 66 -15 548 620 ;\nC -1 ; WX 600 ; N cacute ; B 66 -15 529 672 ;\nC -1 ; WX 600 ; N nacute ; B 26 0 575 672 ;\nC -1 ; WX 600 ; N umacron ; B 21 -15 562 565 ;\nC -1 ; WX 600 ; N Ncaron ; B 7 -13 593 802 ;\nC -1 ; WX 600 ; N Iacute ; B 96 0 504 805 ;\nC -1 ; WX 600 ; N plusminus ; B 87 44 513 558 ;\nC -1 ; WX 600 ; N brokenbar ; B 275 -175 326 675 ;\nC -1 ; WX 600 ; N registered ; B 0 -18 600 580 ;\nC -1 ; WX 600 ; N Gbreve ; B 31 -18 575 732 ;\nC -1 ; WX 600 ; N Idotaccent ; B 96 0 504 753 ;\nC -1 ; WX 600 ; N summation ; B 15 -10 585 706 ;\nC -1 ; WX 600 ; N Egrave ; B 53 0 550 805 ;\nC -1 ; WX 600 ; N racute ; B 60 0 559 672 ;\nC -1 ; WX 600 ; N omacron ; B 62 -15 538 565 ;\nC -1 ; WX 600 ; N Zacute ; B 86 0 514 805 ;\nC -1 ; WX 600 ; N Zcaron ; B 86 0 514 802 ;\nC -1 ; WX 600 ; N greaterequal ; B 98 0 502 710 ;\nC -1 ; WX 600 ; N Eth ; B 30 0 574 562 ;\nC -1 ; WX 600 ; N Ccedilla ; B 41 -151 540 580 ;\nC -1 ; WX 600 ; N lcommaaccent ; B 95 -250 505 629 ;\nC -1 ; WX 600 ; N tcaron ; B 87 -15 530 717 ;\nC -1 ; WX 600 ; N eogonek ; B 66 -172 548 441 ;\nC -1 ; WX 600 ; N Uogonek ; B 17 -172 583 562 ;\nC -1 ; WX 600 ; N Aacute ; B 3 0 597 805 ;\nC -1 ; WX 600 ; N Adieresis ; B 3 0 597 753 ;\nC -1 ; WX 600 ; N egrave ; B 66 -15 548 672 ;\nC -1 ; WX 600 ; N zacute ; B 99 0 502 672 ;\nC -1 ; WX 600 ; N iogonek ; B 95 -172 505 657 ;\nC -1 ; WX 600 ; N Oacute ; B 43 -18 557 805 ;\nC -1 ; WX 600 ; N oacute ; B 62 -15 538 672 ;\nC -1 ; WX 600 ; N amacron ; B 53 -15 559 565 ;\nC -1 ; WX 600 ; N sacute ; B 80 -15 513 672 ;\nC -1 ; WX 600 ; N idieresis ; B 95 0 505 620 ;\nC -1 ; WX 600 ; N Ocircumflex ; B 43 -18 557 787 ;\nC -1 ; WX 600 ; N Ugrave ; B 17 -18 583 805 ;\nC -1 ; WX 600 ; N Delta ; B 6 0 598 688 ;\nC -1 ; WX 600 ; N thorn ; B -6 -157 555 629 ;\nC -1 ; WX 600 ; N twosuperior ; B 177 249 424 622 ;\nC -1 ; WX 600 ; N Odieresis ; B 43 -18 557 753 ;\nC -1 ; WX 600 ; N mu ; B 21 -157 562 426 ;\nC -1 ; WX 600 ; N igrave ; B 95 0 505 672 ;\nC -1 ; WX 600 ; N ohungarumlaut ; B 62 -15 580 672 ;\nC -1 ; WX 600 ; N Eogonek ; B 53 -172 561 562 ;\nC -1 ; WX 600 ; N dcroat ; B 45 -15 591 629 ;\nC -1 ; WX 600 ; N threequarters ; B 8 -56 593 666 ;\nC -1 ; WX 600 ; N Scedilla ; B 72 -151 529 580 ;\nC -1 ; WX 600 ; N lcaron ; B 95 0 533 629 ;\nC -1 ; WX 600 ; N Kcommaaccent ; B 38 -250 582 562 ;\nC -1 ; WX 600 ; N Lacute ; B 47 0 554 805 ;\nC -1 ; WX 600 ; N trademark ; B -23 263 623 562 ;\nC -1 ; WX 600 ; N edotaccent ; B 66 -15 548 620 ;\nC -1 ; WX 600 ; N Igrave ; B 96 0 504 805 ;\nC -1 ; WX 600 ; N Imacron ; B 96 0 504 698 ;\nC -1 ; WX 600 ; N Lcaron ; B 47 0 554 562 ;\nC -1 ; WX 600 ; N onehalf ; B 0 -57 611 665 ;\nC -1 ; WX 600 ; N lessequal ; B 98 0 502 710 ;\nC -1 ; WX 600 ; N ocircumflex ; B 62 -15 538 654 ;\nC -1 ; WX 600 ; N ntilde ; B 26 0 575 606 ;\nC -1 ; WX 600 ; N Uhungarumlaut ; B 17 -18 590 805 ;\nC -1 ; WX 600 ; N Eacute ; B 53 0 550 805 ;\nC -1 ; WX 600 ; N emacron ; B 66 -15 548 565 ;\nC -1 ; WX 600 ; N gbreve ; B 45 -157 566 609 ;\nC -1 ; WX 600 ; N onequarter ; B 0 -57 600 665 ;\nC -1 ; WX 600 ; N Scaron ; B 72 -20 529 802 ;\nC -1 ; WX 600 ; N Scommaaccent ; B 72 -250 529 580 ;\nC -1 ; WX 600 ; N Ohungarumlaut ; B 43 -18 580 805 ;\nC -1 ; WX 600 ; N degree ; B 123 269 477 622 ;\nC -1 ; WX 600 ; N ograve ; B 62 -15 538 672 ;\nC -1 ; WX 600 ; N Ccaron ; B 41 -18 540 802 ;\nC -1 ; WX 600 ; N ugrave ; B 21 -15 562 672 ;\nC -1 ; WX 600 ; N radical ; B 3 -15 597 792 ;\nC -1 ; WX 600 ; N Dcaron ; B 43 0 574 802 ;\nC -1 ; WX 600 ; N rcommaaccent ; B 60 -250 559 441 ;\nC -1 ; WX 600 ; N Ntilde ; B 7 -13 593 729 ;\nC -1 ; WX 600 ; N otilde ; B 62 -15 538 606 ;\nC -1 ; WX 600 ; N Rcommaaccent ; B 38 -250 588 562 ;\nC -1 ; WX 600 ; N Lcommaaccent ; B 47 -250 554 562 ;\nC -1 ; WX 600 ; N Atilde ; B 3 0 597 729 ;\nC -1 ; WX 600 ; N Aogonek ; B 3 -172 608 562 ;\nC -1 ; WX 600 ; N Aring ; B 3 0 597 750 ;\nC -1 ; WX 600 ; N Otilde ; B 43 -18 557 729 ;\nC -1 ; WX 600 ; N zdotaccent ; B 99 0 502 620 ;\nC -1 ; WX 600 ; N Ecaron ; B 53 0 550 802 ;\nC -1 ; WX 600 ; N Iogonek ; B 96 -172 504 562 ;\nC -1 ; WX 600 ; N kcommaaccent ; B 43 -250 580 629 ;\nC -1 ; WX 600 ; N minus ; B 80 232 520 283 ;\nC -1 ; WX 600 ; N Icircumflex ; B 96 0 504 787 ;\nC -1 ; WX 600 ; N ncaron ; B 26 0 575 669 ;\nC -1 ; WX 600 ; N tcommaaccent ; B 87 -250 530 561 ;\nC -1 ; WX 600 ; N logicalnot ; B 87 108 513 369 ;\nC -1 ; WX 600 ; N odieresis ; B 62 -15 538 620 ;\nC -1 ; WX 600 ; N udieresis ; B 21 -15 562 620 ;\nC -1 ; WX 600 ; N notequal ; B 15 -16 540 529 ;\nC -1 ; WX 600 ; N gcommaaccent ; B 45 -157 566 708 ;\nC -1 ; WX 600 ; N eth ; B 62 -15 538 629 ;\nC -1 ; WX 600 ; N zcaron ; B 99 0 502 669 ;\nC -1 ; WX 600 ; N ncommaaccent ; B 26 -250 575 441 ;\nC -1 ; WX 600 ; N onesuperior ; B 172 249 428 622 ;\nC -1 ; WX 600 ; N imacron ; B 95 0 505 565 ;\nC -1 ; WX 600 ; N Euro ; B 0 0 0 0 ;\nEndCharMetrics\nEndFontMetrics\n"; }, "Courier-Bold": function() { return "StartFontMetrics 4.1\nComment Copyright (c) 1989, 1990, 1991, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.\nComment Creation Date: Mon Jun 23 16:28:00 1997\nComment UniqueID 43048\nComment VMusage 41139 52164\nFontName Courier-Bold\nFullName Courier Bold\nFamilyName Courier\nWeight Bold\nItalicAngle 0\nIsFixedPitch true\nCharacterSet ExtendedRoman\nFontBBox -113 -250 749 801 \nUnderlinePosition -100\nUnderlineThickness 50\nVersion 003.000\nNotice Copyright (c) 1989, 1990, 1991, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.\nEncodingScheme AdobeStandardEncoding\nCapHeight 562\nXHeight 439\nAscender 629\nDescender -157\nStdHW 84\nStdVW 106\nStartCharMetrics 315\nC 32 ; WX 600 ; N space ; B 0 0 0 0 ;\nC 33 ; WX 600 ; N exclam ; B 202 -15 398 572 ;\nC 34 ; WX 600 ; N quotedbl ; B 135 277 465 562 ;\nC 35 ; WX 600 ; N numbersign ; B 56 -45 544 651 ;\nC 36 ; WX 600 ; N dollar ; B 82 -126 519 666 ;\nC 37 ; WX 600 ; N percent ; B 5 -15 595 616 ;\nC 38 ; WX 600 ; N ampersand ; B 36 -15 546 543 ;\nC 39 ; WX 600 ; N quoteright ; B 171 277 423 562 ;\nC 40 ; WX 600 ; N parenleft ; B 219 -102 461 616 ;\nC 41 ; WX 600 ; N parenright ; B 139 -102 381 616 ;\nC 42 ; WX 600 ; N asterisk ; B 91 219 509 601 ;\nC 43 ; WX 600 ; N plus ; B 71 39 529 478 ;\nC 44 ; WX 600 ; N comma ; B 123 -111 393 174 ;\nC 45 ; WX 600 ; N hyphen ; B 100 203 500 313 ;\nC 46 ; WX 600 ; N period ; B 192 -15 408 171 ;\nC 47 ; WX 600 ; N slash ; B 98 -77 502 626 ;\nC 48 ; WX 600 ; N zero ; B 87 -15 513 616 ;\nC 49 ; WX 600 ; N one ; B 81 0 539 616 ;\nC 50 ; WX 600 ; N two ; B 61 0 499 616 ;\nC 51 ; WX 600 ; N three ; B 63 -15 501 616 ;\nC 52 ; WX 600 ; N four ; B 53 0 507 616 ;\nC 53 ; WX 600 ; N five ; B 70 -15 521 601 ;\nC 54 ; WX 600 ; N six ; B 90 -15 521 616 ;\nC 55 ; WX 600 ; N seven ; B 55 0 494 601 ;\nC 56 ; WX 600 ; N eight ; B 83 -15 517 616 ;\nC 57 ; WX 600 ; N nine ; B 79 -15 510 616 ;\nC 58 ; WX 600 ; N colon ; B 191 -15 407 425 ;\nC 59 ; WX 600 ; N semicolon ; B 123 -111 408 425 ;\nC 60 ; WX 600 ; N less ; B 66 15 523 501 ;\nC 61 ; WX 600 ; N equal ; B 71 118 529 398 ;\nC 62 ; WX 600 ; N greater ; B 77 15 534 501 ;\nC 63 ; WX 600 ; N question ; B 98 -14 501 580 ;\nC 64 ; WX 600 ; N at ; B 16 -15 584 616 ;\nC 65 ; WX 600 ; N A ; B -9 0 609 562 ;\nC 66 ; WX 600 ; N B ; B 30 0 573 562 ;\nC 67 ; WX 600 ; N C ; B 22 -18 560 580 ;\nC 68 ; WX 600 ; N D ; B 30 0 594 562 ;\nC 69 ; WX 600 ; N E ; B 25 0 560 562 ;\nC 70 ; WX 600 ; N F ; B 39 0 570 562 ;\nC 71 ; WX 600 ; N G ; B 22 -18 594 580 ;\nC 72 ; WX 600 ; N H ; B 20 0 580 562 ;\nC 73 ; WX 600 ; N I ; B 77 0 523 562 ;\nC 74 ; WX 600 ; N J ; B 37 -18 601 562 ;\nC 75 ; WX 600 ; N K ; B 21 0 599 562 ;\nC 76 ; WX 600 ; N L ; B 39 0 578 562 ;\nC 77 ; WX 600 ; N M ; B -2 0 602 562 ;\nC 78 ; WX 600 ; N N ; B 8 -12 610 562 ;\nC 79 ; WX 600 ; N O ; B 22 -18 578 580 ;\nC 80 ; WX 600 ; N P ; B 48 0 559 562 ;\nC 81 ; WX 600 ; N Q ; B 32 -138 578 580 ;\nC 82 ; WX 600 ; N R ; B 24 0 599 562 ;\nC 83 ; WX 600 ; N S ; B 47 -22 553 582 ;\nC 84 ; WX 600 ; N T ; B 21 0 579 562 ;\nC 85 ; WX 600 ; N U ; B 4 -18 596 562 ;\nC 86 ; WX 600 ; N V ; B -13 0 613 562 ;\nC 87 ; WX 600 ; N W ; B -18 0 618 562 ;\nC 88 ; WX 600 ; N X ; B 12 0 588 562 ;\nC 89 ; WX 600 ; N Y ; B 12 0 589 562 ;\nC 90 ; WX 600 ; N Z ; B 62 0 539 562 ;\nC 91 ; WX 600 ; N bracketleft ; B 245 -102 475 616 ;\nC 92 ; WX 600 ; N backslash ; B 99 -77 503 626 ;\nC 93 ; WX 600 ; N bracketright ; B 125 -