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E;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;;;ACNA;;;;;;;;;;;;;;;;;;;;;;;;EAwBE;AAEuD;AACM","sources":["webpack://rtfjs/webpack/universalModuleDefinition","webpack://rtfjs/./src/util/SVG.ts","webpack://rtfjs/./src/util/index.ts","webpack://rtfjs/./src/wmfjs/Bitmap.ts","webpack://rtfjs/./src/wmfjs/Blob.ts","webpack://rtfjs/./src/wmfjs/GDIContext.ts","webpack://rtfjs/./src/wmfjs/Helper.ts","webpack://rtfjs/./src/wmfjs/Primitives.ts","webpack://rtfjs/./src/wmfjs/Region.ts","webpack://rtfjs/./src/wmfjs/Renderer.ts","webpack://rtfjs/./src/wmfjs/Style.ts","webpack://rtfjs/./src/wmfjs/WMFRecords.ts","webpack://rtfjs/webpack/bootstrap","webpack://rtfjs/webpack/runtime/define property getters","webpack://rtfjs/webpack/runtime/hasOwnProperty shorthand","webpack://rtfjs/webpack/runtime/make namespace object","webpack://rtfjs/./src/wmfjs/index.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"WMFJS\"] = factory();\n\telse\n\t\troot[\"WMFJS\"] = factory();\n})(this, () => {\nreturn ","/*\n\nThe MIT License (MIT)\n\nCopyright (c) 2020 Ynse Hoornenborg\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n\nexport class SVGFilters {\n\n public flood(filter: SVGFilterElement, resultId: string, color: string, opacity: number, _settings?: any): void {\n const floodElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"feFlood\");\n if (resultId) {\n floodElement.setAttribute(\"id\", resultId);\n }\n floodElement.setAttribute(\"flood-color\", color);\n floodElement.setAttribute(\"flood-opacity\", opacity.toString());\n filter.appendChild(floodElement);\n }\n\n public composite(filter: SVGFilterElement,\n resultId: string,\n in1: string,\n in2: string,\n k1?: number,\n k2?: number,\n k3?: number,\n k4?: number,\n _settings?: any): void {\n const compositeElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"feComposite\");\n if (resultId) {\n compositeElement.setAttribute(\"id\", resultId);\n }\n compositeElement.setAttribute(\"in\", in1);\n compositeElement.setAttribute(\"in2\", in2);\n filter.appendChild(compositeElement);\n }\n}\n\nexport class SVGPathBuilder {\n private _path = \"\";\n\n public move(x: number, y: number): void {\n this._path += ` M ${x} ${y}`;\n }\n\n public path(): string {\n return this._path.substr(1);\n }\n\n public line(pts: number[][]): void {\n pts.forEach((point) => {\n this._path += ` L ${point[0]} ${point[1]}`;\n });\n }\n\n public curveC(x1: number, y1: number, x2: number, y2: number, x: number, y: number): void {\n this._path += ` C ${x1} ${y1}, ${x2} ${y2}, ${x} ${y}`;\n }\n\n public close(): void {\n this._path += ` Z`;\n }\n}\n\nexport class SVG {\n public filters = new SVGFilters();\n private _svg: SVGElement;\n private _defs: SVGDefsElement | undefined = undefined;\n\n constructor(svg: SVGElement) {\n this._svg = svg;\n }\n\n public svg(parent: Element,\n x: number,\n y: number,\n width: number,\n height: number,\n settings?: any): SVGElement {\n const svgElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n svgElement.setAttribute(\"x\", x.toString());\n svgElement.setAttribute(\"y\", y.toString());\n svgElement.setAttribute(\"width\", width.toString());\n svgElement.setAttribute(\"height\", height.toString());\n this._appendSettings(settings, svgElement);\n\n if (parent != null) {\n parent.appendChild(svgElement);\n } else {\n this._svg.appendChild(svgElement);\n }\n\n return svgElement;\n }\n\n public image(parent: Element,\n x: number,\n y: number,\n width: number,\n height: number,\n url: string,\n settings?: any): SVGImageElement {\n const imageElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"image\");\n imageElement.setAttribute(\"x\", x.toString());\n imageElement.setAttribute(\"y\", y.toString());\n imageElement.setAttribute(\"width\", width.toString());\n imageElement.setAttribute(\"height\", height.toString());\n imageElement.setAttributeNS(\"http://www.w3.org/1999/xlink\", \"href\", url);\n this._appendSettings(settings, imageElement);\n parent.appendChild(imageElement);\n return imageElement;\n }\n\n public rect(parent: Element,\n x: number,\n y: number,\n width: number,\n height: number,\n rx?: number,\n ry?: number,\n settings?: any): SVGRectElement;\n public rect(parent: Element, x: number, y: number, width: number, height: number, settings?: any): SVGRectElement;\n public rect(parent: Element,\n x: number,\n y: number,\n width: number,\n height: number,\n rx?: number | any,\n ry?: number,\n settings?: any): SVGRectElement {\n const rectElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"rect\");\n rectElement.setAttribute(\"x\", x.toString());\n rectElement.setAttribute(\"y\", y.toString());\n rectElement.setAttribute(\"width\", width.toString());\n rectElement.setAttribute(\"height\", height.toString());\n if (rx !== undefined) {\n if (rx instanceof Number) {\n rectElement.setAttribute(\"rx\", rx.toString());\n } else if (rx instanceof Object) {\n this._appendSettings(rx, rectElement);\n }\n }\n if (ry !== undefined) {\n rectElement.setAttribute(\"ry\", ry.toString());\n }\n this._appendSettings(settings, rectElement);\n parent.appendChild(rectElement);\n return rectElement;\n }\n\n public line(parent: Element, x1: number, y1: number, x2: number, y2: number, settings?: any): SVGLineElement {\n const lineElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"line\");\n lineElement.setAttribute(\"x1\", x1.toString());\n lineElement.setAttribute(\"y1\", y1.toString());\n lineElement.setAttribute(\"x2\", x2.toString());\n lineElement.setAttribute(\"y2\", y2.toString());\n this._appendSettings(settings, lineElement);\n parent.appendChild(lineElement);\n return lineElement;\n }\n\n public polygon(parent: Element, points: number[][], settings?: any): SVGPolygonElement {\n const polygonElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"polygon\");\n polygonElement.setAttribute(\"points\", points.map((point) => point.join(\",\")).join(\" \"));\n this._appendSettings(settings, polygonElement);\n parent.appendChild(polygonElement);\n return polygonElement;\n }\n\n public polyline(parent: Element, points: number[][], settings?: any): SVGPolylineElement {\n const polylineElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"polyline\");\n polylineElement.setAttribute(\"points\", points.map((point) => point.join(\",\")).join(\" \"));\n this._appendSettings(settings, polylineElement);\n parent.appendChild(polylineElement);\n return polylineElement;\n }\n\n public ellipse(parent: Element, cx: number, cy: number, rx: number, ry: number, settings?: any): SVGEllipseElement {\n const ellipseElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"ellipse\");\n ellipseElement.setAttribute(\"cx\", cx.toString());\n ellipseElement.setAttribute(\"cy\", cy.toString());\n ellipseElement.setAttribute(\"rx\", rx.toString());\n ellipseElement.setAttribute(\"ry\", ry.toString());\n this._appendSettings(settings, ellipseElement);\n parent.appendChild(ellipseElement);\n return ellipseElement;\n }\n\n public path(parent: SVGElement, builder: SVGPathBuilder, settings?: any): SVGPathElement {\n const pathElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"path\");\n pathElement.setAttribute(\"d\", builder.path());\n this._appendSettings(settings, pathElement);\n parent.appendChild(pathElement);\n return pathElement;\n }\n\n public text(parent: Element, x: number, y: number, value: string, settings?: any): SVGTextElement {\n const textElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"text\");\n textElement.setAttribute(\"x\", x.toString());\n textElement.setAttribute(\"y\", y.toString());\n this._appendSettings(settings, textElement);\n const textNode = document.createTextNode(value);\n textElement.appendChild(textNode);\n parent.appendChild(textElement);\n return textElement;\n }\n\n public filter(parent: Element,\n id: string,\n x: number,\n y: number,\n width: number,\n height: number,\n settings?: any): SVGFilterElement {\n const filterElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"filter\");\n filterElement.setAttribute(\"x\", x.toString());\n filterElement.setAttribute(\"y\", y.toString());\n filterElement.setAttribute(\"width\", width.toString());\n filterElement.setAttribute(\"height\", height.toString());\n this._appendSettings(settings, filterElement);\n parent.appendChild(filterElement);\n return filterElement;\n }\n\n public pattern(parent: Element,\n resultId: string,\n x: number,\n y: number,\n width: number,\n height: number,\n settings?: any): SVGPatternElement {\n const patternElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"pattern\");\n if (resultId) {\n patternElement.setAttribute(\"id\", resultId);\n }\n patternElement.setAttribute(\"x\", x.toString());\n patternElement.setAttribute(\"y\", y.toString());\n patternElement.setAttribute(\"width\", width.toString());\n patternElement.setAttribute(\"height\", height.toString());\n this._appendSettings(settings, patternElement);\n parent.appendChild(patternElement);\n return patternElement;\n }\n\n public defs(): SVGDefsElement {\n if (this._defs === undefined) {\n const defsElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"defs\");\n this._svg.appendChild(defsElement);\n this._defs = defsElement;\n }\n return this._defs;\n }\n\n public clipPath(parent: Element, resultId: string, units?: string, settings?: any): SVGClipPathElement {\n const clipElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"clipPath\");\n if (resultId) {\n clipElement.setAttribute(\"id\", resultId);\n }\n if (units === undefined) {\n units = \"userSpaceOnUse\";\n }\n clipElement.setAttribute(\"clipPathUnits\", units);\n this._appendSettings(settings, clipElement);\n parent.appendChild(clipElement);\n return clipElement;\n }\n\n public createPath(): SVGPathBuilder {\n return new SVGPathBuilder();\n }\n\n private _appendSettings(settings: any | undefined, element: Element): void {\n if (settings !== undefined) {\n Object.keys(settings).forEach((key) => {\n element.setAttribute(key, settings[key]);\n });\n }\n }\n\n}\n","/*\n\nThe MIT License (MIT)\n\nCopyright (c) 2020 Tom Zoehner\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n\nexport { SVG } from \"./SVG\";\n","/*\n\nThe MIT License (MIT)\n\nCopyright (c) 2015 Thomas Bluemel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n\nimport { Blob } from \"./Blob\";\nimport { Helper, WMFJSError } from \"./Helper\";\n\ninterface Bitmap {\n getWidth(): number\n\n getHeight(): number\n}\n\nclass BitmapCoreHeader {\n public width: number;\n public height: number;\n public planes: number;\n public bitcount: number;\n\n constructor(reader: Blob, skipsize: boolean) {\n if (skipsize) {\n reader.skip(4);\n }\n this.width = reader.readUint16();\n this.height = reader.readUint16();\n this.planes = reader.readUint16();\n this.bitcount = reader.readUint16();\n }\n\n public colors(): number {\n return this.bitcount <= 8 ? 1 << this.bitcount : 0;\n }\n}\n\nclass BitmapInfoHeader {\n public width: number;\n public height: number;\n public planes: number;\n public bitcount: number;\n public compression: number;\n public sizeimage: number;\n public xpelspermeter: number;\n public ypelspermeter: number;\n public clrused: number;\n public clrimportant: number;\n\n constructor(reader: Blob, skipsize: boolean) {\n if (skipsize) {\n reader.skip(4);\n }\n this.width = reader.readInt32();\n this.height = reader.readInt32();\n this.planes = reader.readUint16();\n this.bitcount = reader.readUint16();\n this.compression = reader.readUint32();\n this.sizeimage = reader.readUint32();\n this.xpelspermeter = reader.readInt32();\n this.ypelspermeter = reader.readInt32();\n this.clrused = reader.readUint32();\n this.clrimportant = reader.readUint32();\n }\n\n public colors(): number {\n if (this.clrused !== 0) {\n return this.clrused < 256 ? this.clrused : 256;\n } else {\n return this.bitcount > 8 ? 0 : 1 << this.bitcount;\n }\n }\n}\n\nexport class BitmapInfo implements Bitmap {\n private _reader: Blob;\n private _offset: number;\n private _usergb: boolean;\n private _infosize: number;\n private _header: BitmapCoreHeader | BitmapInfoHeader;\n\n constructor(reader: Blob, usergb: boolean) {\n this._reader = reader;\n this._offset = reader.pos;\n this._usergb = usergb;\n const hdrsize = reader.readUint32();\n this._infosize = hdrsize;\n if (hdrsize === Helper.GDI.BITMAPCOREHEADER_SIZE) {\n this._header = new BitmapCoreHeader(reader, false);\n this._infosize += this._header.colors() * (usergb ? 3 : 2);\n } else {\n this._header = new BitmapInfoHeader(reader, false);\n const masks =\n (this._header as BitmapInfoHeader).compression === Helper.GDI.BitmapCompression.BI_BITFIELDS ? 3 : 0;\n if (hdrsize <= Helper.GDI.BITMAPINFOHEADER_SIZE + (masks * 4)) {\n this._infosize = Helper.GDI.BITMAPINFOHEADER_SIZE + (masks * 4);\n }\n this._infosize += this._header.colors() * (usergb ? 4 : 2);\n }\n }\n\n public getWidth(): number {\n return this._header.width;\n }\n\n public getHeight(): number {\n return Math.abs(this._header.height);\n }\n\n public infosize(): number {\n return this._infosize;\n }\n\n public header(): BitmapCoreHeader | BitmapInfoHeader {\n return this._header;\n }\n}\n\nexport class DIBitmap implements Bitmap {\n private _reader: Blob;\n private _offset: number;\n private _size: number;\n private _info: BitmapInfo;\n\n constructor(reader: Blob, size: number) {\n this._reader = reader;\n this._offset = reader.pos;\n this._size = size;\n this._info = new BitmapInfo(reader, true);\n }\n\n public getWidth(): number {\n return this._info.getWidth();\n }\n\n public getHeight(): number {\n return this._info.getHeight();\n }\n\n public base64ref(): string {\n const prevpos = this._reader.pos;\n this._reader.seek(this._offset);\n let mime = \"image/bmp\";\n const header = this._info.header();\n let data;\n if (header instanceof BitmapInfoHeader && header.compression != null) {\n switch (header.compression) {\n case Helper.GDI.BitmapCompression.BI_JPEG:\n mime = \"data:image/jpeg\";\n break;\n case Helper.GDI.BitmapCompression.BI_PNG:\n mime = \"data:image/png\";\n break;\n default:\n data = this.makeBitmapFileHeader();\n break;\n }\n } else {\n data = this.makeBitmapFileHeader();\n }\n\n if (data != null) {\n data += this._reader.readBinary(this._size);\n } else {\n data = this._reader.readBinary(this._size);\n }\n\n const ref = \"data:\" + mime + \";base64,\" + btoa(data);\n this._reader.seek(prevpos);\n return ref;\n }\n\n private makeBitmapFileHeader() {\n const buf = new ArrayBuffer(14);\n const view = new Uint8Array(buf);\n view[0] = 0x42;\n view[1] = 0x4d;\n Helper._writeUint32Val(view, 2, this._size + 14);\n Helper._writeUint32Val(view, 10, this._info.infosize() + 14);\n return Helper._blobToBinary(view);\n }\n}\n\nexport class Bitmap16 implements Bitmap {\n public type: number;\n public width: number;\n public height: number;\n public widthBytes: number;\n public planes: number;\n public bitsPixel: number;\n public bitsOffset: number;\n public bitsSize: number;\n private _reader: Blob;\n private _offset: number;\n private _size: number;\n\n constructor(reader: Blob, size: number | Bitmap16) {\n if (reader != null) {\n size = size as number;\n this._reader = reader;\n this._offset = reader.pos;\n this._size = size;\n this.type = reader.readInt16();\n this.width = reader.readInt16();\n this.height = reader.readInt16();\n this.widthBytes = reader.readInt16();\n this.planes = reader.readUint8();\n this.bitsPixel = reader.readUint8();\n this.bitsOffset = reader.pos;\n this.bitsSize = (((this.width * this.bitsPixel + 15) >> 4) << 1) * this.height;\n if (this.bitsSize > size - 10) {\n throw new WMFJSError(\"Bitmap should have \" + this.bitsSize + \" bytes, but has \" + (size - 10));\n }\n } else {\n const copy = size as Bitmap16;\n this._reader = copy._reader;\n this._offset = copy._offset;\n this._size = copy._size;\n this.type = copy.type;\n this.width = copy.width;\n this.height = copy.height;\n this.widthBytes = copy.widthBytes;\n this.planes = copy.planes;\n this.bitsPixel = copy.bitsPixel;\n this.bitsOffset = copy.bitsOffset;\n this.bitsSize = copy.bitsSize;\n }\n }\n\n public getWidth(): number {\n return this.width;\n }\n\n public getHeight(): number {\n return this.height;\n }\n\n public clone(): Bitmap16 {\n return new Bitmap16(null, this);\n }\n}\n\nexport class PatternBitmap16 extends Bitmap16 {\n constructor(reader: Blob, size: number | Bitmap16) {\n super(reader, size);\n if (reader != null) {\n this.bitsOffset += 22; // skip bits (4 bytes) + reserved (18 bytes)\n }\n }\n\n public clone(): PatternBitmap16 {\n return new PatternBitmap16(null, this);\n }\n}\n","/*\n\nThe MIT License (MIT)\n\nCopyright (c) 2015 Thomas Bluemel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n\nimport { WMFJSError } from \"./Helper\";\n\nexport class Blob {\n public pos: number;\n private blob: Blob | ArrayBuffer;\n private data: Uint8Array;\n\n constructor(blob: Blob | ArrayBuffer, offset?: number) {\n if (blob instanceof Blob) {\n this.blob = blob.blob;\n this.data = blob.data;\n this.pos = offset || blob.pos;\n } else {\n this.blob = blob;\n this.data = new Uint8Array(blob);\n this.pos = offset || 0;\n }\n }\n\n public eof(): boolean {\n return this.pos >= this.data.length;\n }\n\n public seek(newpos: number): void {\n if (newpos < 0 || newpos > this.data.length) {\n throw new WMFJSError(\"Invalid seek position\");\n }\n this.pos = newpos;\n }\n\n public skip(cnt: number): void {\n const newPos = this.pos + cnt;\n if (newPos > this.data.length) {\n throw new WMFJSError(\"Unexpected end of file\");\n }\n this.pos = newPos;\n }\n\n public readBinary(cnt: number): string {\n const end = this.pos + cnt;\n if (end > this.data.length) {\n throw new WMFJSError(\"Unexpected end of file\");\n }\n let ret = \"\";\n while (cnt-- > 0) {\n ret += String.fromCharCode(this.data[this.pos++]);\n }\n return ret;\n }\n\n public readInt8(): number {\n if (this.pos + 1 > this.data.length) {\n throw new WMFJSError(\"Unexpected end of file\");\n }\n return this.data[this.pos++];\n }\n\n public readUint8(): number {\n return this.readInt8() >>> 0;\n }\n\n public readInt32(): number {\n if (this.pos + 4 > this.data.length) {\n throw new WMFJSError(\"Unexpected end of file\");\n }\n let val = this.data[this.pos++];\n val |= this.data[this.pos++] << 8;\n val |= this.data[this.pos++] << 16;\n val |= this.data[this.pos++] << 24;\n return val;\n }\n\n public readUint32(): number {\n return this.readInt32() >>> 0;\n }\n\n public readUint16(): number {\n if (this.pos + 2 > this.data.length) {\n throw new WMFJSError(\"Unexpected end of file\");\n }\n let val = this.data[this.pos++];\n val |= this.data[this.pos++] << 8;\n return val;\n }\n\n public readInt16(): number {\n let val = this.readUint16();\n if (val > 32767) {\n val -= 65536;\n }\n return val;\n }\n\n public readString(length: number): string {\n if (this.pos + length > this.data.length) {\n throw new WMFJSError(\"Unexpected end of file\");\n }\n let ret = \"\";\n for (let i = 0; i < length; i++) {\n ret += String.fromCharCode(this.data[this.pos++] >>> 0);\n }\n return ret;\n }\n\n public readNullTermString(maxSize: number): string {\n let ret = \"\";\n if (maxSize > 0) {\n maxSize--;\n for (let i = 0; i < maxSize; i++) {\n if (this.pos + i + 1 > this.data.length) {\n throw new WMFJSError(\"Unexpected end of file\");\n }\n const byte = this.data[this.pos + i] >>> 0;\n if (byte === 0) {\n break;\n }\n ret += String.fromCharCode(byte);\n }\n }\n return ret;\n }\n}\n","/*\n\nThe MIT License (MIT)\n\nCopyright (c) 2015 Thomas Bluemel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n\nimport { SVG } from \"../util\";\nimport { DIBitmap } from \"./Bitmap\";\nimport { Blob } from \"./Blob\";\nimport { Helper, WMFJSError } from \"./Helper\";\nimport { Obj, PointS, Rect } from \"./Primitives\";\nimport { CreateSimpleRegion, Region } from \"./Region\";\nimport { Brush, ColorRef, Font, Palette, Pen } from \"./Style\";\n\ninterface ISelectedStyle {\n brush?: Brush;\n pen?: Pen;\n font?: Font;\n palette?: Palette;\n region?: Region;\n\n [key: string]: Obj | undefined;\n}\n\nclass GDIContextState {\n public _svggroup: SVGElement;\n public _svgclipChanged: boolean;\n public _svgtextbkfilter: SVGFilterElement;\n public mapmode: number;\n public stretchmode: number;\n public textalign: number;\n public bkmode: number;\n public textcolor: ColorRef;\n public bkcolor: ColorRef;\n public polyfillmode: number;\n public wx: number;\n public wy: number;\n public ww: number;\n public wh: number;\n public vx: number;\n public vy: number;\n public vw: number;\n public vh: number;\n public x: number;\n public y: number;\n public clip: Region;\n public ownclip: boolean;\n public selected: ISelectedStyle;\n\n constructor(copy: GDIContextState, defObjects?: ISelectedStyle) {\n if (copy != null) {\n this._svggroup = copy._svggroup;\n this._svgclipChanged = copy._svgclipChanged;\n this._svgtextbkfilter = copy._svgtextbkfilter;\n this.mapmode = copy.mapmode;\n this.stretchmode = copy.stretchmode;\n this.textalign = copy.textalign;\n this.bkmode = copy.bkmode;\n this.textcolor = copy.textcolor.clone();\n this.bkcolor = copy.bkcolor.clone();\n this.polyfillmode = copy.polyfillmode;\n this.wx = copy.wx;\n this.wy = copy.wy;\n this.ww = copy.ww;\n this.wh = copy.wh;\n this.vx = copy.vx;\n this.vy = copy.vy;\n this.vw = copy.vw;\n this.vh = copy.vh;\n this.x = copy.x;\n this.y = copy.y;\n\n this.clip = copy.clip;\n this.ownclip = false;\n\n this.selected = {};\n for (const type in copy.selected) {\n this.selected[type] = copy.selected[type];\n }\n } else {\n this._svggroup = null;\n this._svgclipChanged = false;\n this._svgtextbkfilter = null;\n this.mapmode = Helper.GDI.MapMode.MM_ANISOTROPIC;\n this.stretchmode = Helper.GDI.StretchMode.COLORONCOLOR;\n this.textalign = 0; // TA_LEFT | TA_TOP | TA_NOUPDATECP\n this.bkmode = Helper.GDI.MixMode.OPAQUE;\n this.textcolor = new ColorRef(null, 0, 0, 0);\n this.bkcolor = new ColorRef(null, 255, 255, 255);\n this.polyfillmode = Helper.GDI.PolyFillMode.ALTERNATE;\n this.wx = 0;\n this.wy = 0;\n this.ww = 0;\n this.wh = 0;\n this.vx = 0;\n this.vy = 0;\n this.vw = 0;\n this.vh = 0;\n this.x = 0;\n this.y = 0;\n\n this.clip = null;\n this.ownclip = false;\n\n this.selected = {};\n for (const type in defObjects) {\n const defObj = defObjects[type];\n this.selected[type] = defObj != null ? defObj.clone() : null;\n }\n }\n }\n}\n\nexport class GDIContext {\n private _svg: SVG;\n private _svgdefs: SVGDefsElement;\n private _svgPatterns: { [key: string]: Brush };\n private _svgClipPaths: { [key: string]: Region };\n private defObjects: ISelectedStyle;\n private state: GDIContextState;\n private statestack: GDIContextState[];\n private objects: { [key: string]: Obj };\n\n constructor(svg: SVG) {\n this._svg = svg;\n this._svgdefs = null;\n this._svgPatterns = {};\n this._svgClipPaths = {};\n\n this.defObjects = {\n brush: new Brush(null, null),\n pen: new Pen(null, Helper.GDI.PenStyle.PS_SOLID, new PointS(null, 1, 1), new ColorRef(null, 0, 0, 0), 0, 0),\n font: new Font(null, null),\n palette: null,\n region: null,\n };\n\n this.state = new GDIContextState(null, this.defObjects);\n this.statestack = [this.state];\n this.objects = {};\n }\n\n public setMapMode(mode: number): void {\n Helper.log(\"[gdi] setMapMode: mode=\" + mode);\n this.state.mapmode = mode;\n this.state._svggroup = null;\n }\n\n public setWindowOrg(x: number, y: number): void {\n Helper.log(\"[gdi] setWindowOrg: x=\" + x + \" y=\" + y);\n this.state.wx = x;\n this.state.wy = y;\n this.state._svggroup = null;\n }\n\n public setWindowExt(x: number, y: number): void {\n Helper.log(\"[gdi] setWindowExt: x=\" + x + \" y=\" + y);\n this.state.ww = x;\n this.state.wh = y;\n this.state._svggroup = null;\n }\n\n public offsetWindowOrg(offX: number, offY: number): void {\n Helper.log(\"[gdi] offsetWindowOrg: offX=\" + offX + \" offY=\" + offY);\n this.state.wx += offX;\n this.state.wy += offY;\n this.state._svggroup = null;\n }\n\n public setViewportOrg(x: number, y: number): void {\n Helper.log(\"[gdi] setViewportOrg: x=\" + x + \" y=\" + y);\n this.state.vx = x;\n this.state.vy = y;\n this.state._svggroup = null;\n }\n\n public setViewportExt(x: number, y: number): void {\n Helper.log(\"[gdi] setViewportExt: x=\" + x + \" y=\" + y);\n this.state.vw = x;\n this.state.vh = y;\n this.state._svggroup = null;\n }\n\n public offsetViewportOrg(offX: number, offY: number): void {\n Helper.log(\"[gdi] offsetViewportOrg: offX=\" + offX + \" offY=\" + offY);\n this.state.vx += offX;\n this.state.vy += offY;\n this.state._svggroup = null;\n }\n\n public saveDC(): void {\n Helper.log(\"[gdi] saveDC\");\n const prevstate = this.state;\n this.state = new GDIContextState(this.state);\n this.statestack.push(prevstate);\n this.state._svggroup = null;\n }\n\n public restoreDC(saved: number): void {\n Helper.log(\"[gdi] restoreDC: saved=\" + saved);\n if (this.statestack.length > 1) {\n if (saved === -1) {\n this.state = this.statestack.pop();\n } else if (saved < -1) {\n throw new WMFJSError(\"restoreDC: relative restore not implemented\");\n } else if (saved > 1) {\n throw new WMFJSError(\"restoreDC: absolute restore not implemented\");\n }\n } else {\n throw new WMFJSError(\"No saved contexts\");\n }\n\n this.state._svggroup = null;\n }\n\n public escape(func: number, blob: Blob, offset: number, count: number): void {\n Helper.log(\"[gdi] escape: func=\" + func + \" offset=\" + offset + \" count=\" + count);\n }\n\n public setStretchBltMode(stretchMode: number): void {\n Helper.log(\"[gdi] setStretchBltMode: stretchMode=\" + stretchMode);\n }\n\n public stretchDib(srcX: number, srcY: number, srcW: number, srcH: number,\n dstX: number, dstY: number, dstW: number, dstH: number,\n rasterOp: number, colorUsage: number, dib: DIBitmap): void {\n Helper.log(\"[gdi] stretchDib: srcX=\" + srcX + \" srcY=\" + srcY + \" srcW=\" + srcW + \" srcH=\" + srcH\n + \" dstX=\" + dstX + \" dstY=\" + dstY + \" dstW=\" + dstW + \" dstH=\" + dstH\n + \" rasterOp=0x\" + rasterOp.toString(16));\n srcX = this._todevX(srcX);\n srcY = this._todevY(srcY);\n srcW = this._todevW(srcW);\n srcH = this._todevH(srcH);\n dstX = this._todevX(dstX);\n dstY = this._todevY(dstY);\n dstW = this._todevW(dstW);\n dstH = this._todevH(dstH);\n Helper.log(\"[gdi] stretchDib: TRANSLATED: srcX=\" + srcX + \" srcY=\" + srcY + \" srcW=\" + srcW + \" srcH=\" + srcH\n + \" dstX=\" + dstX + \" dstY=\" + dstY + \" dstW=\" + dstW + \" dstH=\" + dstH\n + \" rasterOp=0x\" + rasterOp.toString(16) + \" colorUsage=0x\" + colorUsage.toString(16));\n this._pushGroup();\n this._svg.image(this.state._svggroup, dstX, dstY, dstW, dstH, dib.base64ref());\n }\n\n public dibBits(srcX: number, srcY: number, dstX: number, dstY: number, width: number, height: number,\n rasterOp: number, dib: DIBitmap): void {\n Helper.log(\"[gdi] stretchDibBits: srcX=\" + srcX + \" srcY=\" + srcY\n + \" dstX=\" + dstX + \" dstY=\" + dstY + \" width=\" + width + \" height=\" + height\n + \" rasterOp=0x\" + rasterOp.toString(16));\n srcX = this._todevX(srcX);\n srcY = this._todevY(srcY);\n dstX = this._todevX(dstX);\n dstY = this._todevY(dstY);\n width = this._todevW(width);\n height = this._todevH(height);\n Helper.log(\"[gdi] dibBits: TRANSLATED:\"\n + \" srcX=\" + srcX + \" srcY=\" + srcY + +\" dstX=\" + dstX + \" dstY=\" + dstY\n + \" width=\" + width + \" height=\" + height + \" rasterOp=0x\" + rasterOp.toString(16));\n this._pushGroup();\n this._svg.image(this.state._svggroup, dstX, dstY, width, height, dib.base64ref());\n }\n\n public stretchDibBits(srcX: number, srcY: number, srcW: number, srcH: number,\n dstX: number, dstY: number, dstW: number, dstH: number,\n rasterOp: number, dib: DIBitmap): void {\n Helper.log(\"[gdi] stretchDibBits: srcX=\" + srcX + \" srcY=\" + srcY + \" srcW=\" + srcW + \" srcH=\" + srcH\n + \" dstX=\" + dstX + \" dstY=\" + dstY + \" dstW=\" + dstW + \" dstH=\" + dstH\n + \" rasterOp=0x\" + rasterOp.toString(16));\n srcX = this._todevX(srcX);\n srcY = this._todevY(srcY);\n srcW = this._todevW(srcW);\n srcH = this._todevH(srcH);\n dstX = this._todevX(dstX);\n dstY = this._todevY(dstY);\n dstW = this._todevW(dstW);\n dstH = this._todevH(dstH);\n Helper.log(\"[gdi] stretchDibBits: TRANSLATED:\"\n + \" srcX=\" + srcX + \" srcY=\" + srcY + \" srcW=\" + srcW + \" srcH=\" + srcH\n + \" dstX=\" + dstX + \" dstY=\" + dstY + \" dstW=\" + dstW + \" dstH=\" + dstH\n + \" rasterOp=0x\" + rasterOp.toString(16));\n this._pushGroup();\n this._svg.image(this.state._svggroup, dstX, dstY, dstW, dstH, dib.base64ref());\n }\n\n public rectangle(rect: Rect, rw: number, rh: number): void {\n Helper.log(\"[gdi] rectangle: rect=\" + rect.toString() + \" with pen \" + this.state.selected.pen.toString()\n + \" and brush \" + this.state.selected.brush.toString());\n const bottom = this._todevY(rect.bottom);\n const right = this._todevX(rect.right);\n const top = this._todevY(rect.top);\n const left = this._todevX(rect.left);\n rw = this._todevH(rw);\n rh = this._todevH(rh);\n Helper.log(\"[gdi] rectangle: TRANSLATED: bottom=\" + bottom + \" right=\" + right + \" top=\" + top\n + \" left=\" + left + \" rh=\" + rh + \" rw=\" + rw);\n this._pushGroup();\n\n const opts = this._applyOpts(null, true, true, false);\n this._svg.rect(this.state._svggroup, left, top, right - left, bottom - top, rw / 2, rh / 2, opts);\n }\n\n public textOut(x: number, y: number, text: string): void {\n Helper.log(\"[gdi] textOut: x=\" + x + \" y=\" + y + \" text=\" + text\n + \" with font \" + this.state.selected.font.toString());\n x = this._todevX(x);\n y = this._todevY(y);\n Helper.log(\"[gdi] textOut: TRANSLATED: x=\" + x + \" y=\" + y);\n this._pushGroup();\n\n const opts = this._applyOpts(null, false, false, true);\n if (this.state.selected.font.escapement !== 0) {\n opts.transform = \"rotate(\" + [(-this.state.selected.font.escapement / 10), x, y] + \")\";\n opts.style = \"dominant-baseline: middle; text-anchor: start;\";\n }\n if (this.state.bkmode === Helper.GDI.MixMode.OPAQUE) {\n if (this.state._svgtextbkfilter == null) {\n const filterId = Helper._makeUniqueId(\"f\");\n const filter = this._svg.filter(this._getSvgDef(), filterId, 0, 0, 1, 1);\n this._svg.filters.flood(filter, null, \"#\" + this.state.bkcolor.toHex(), 1.0);\n this._svg.filters.composite(filter, null, null, \"SourceGraphic\");\n this.state._svgtextbkfilter = filter;\n }\n\n opts.filter = \"url(#\" + this.state._svgtextbkfilter.id + \")\";\n }\n this._svg.text(this.state._svggroup, x, y, text, opts);\n }\n\n public extTextOut(x: number, y: number, text: string, fwOpts: number, rect: Rect, dx: number[]): void {\n Helper.log(\"[gdi] extTextOut: x=\" + x + \" y=\" + y + \" text=\" + text\n + \" with font \" + this.state.selected.font.toString());\n x = this._todevX(x);\n y = this._todevY(y);\n Helper.log(\"[gdi] extTextOut: TRANSLATED: x=\" + x + \" y=\" + y);\n this._pushGroup();\n\n const opts = this._applyOpts(null, false, false, true);\n if (this.state.selected.font.escapement !== 0) {\n opts.transform = \"rotate(\" + [(-this.state.selected.font.escapement / 10), x, y] + \")\";\n opts.style = \"dominant-baseline: middle; text-anchor: start;\";\n }\n if (this.state.bkmode === Helper.GDI.MixMode.OPAQUE) {\n if (this.state._svgtextbkfilter == null) {\n const filterId = Helper._makeUniqueId(\"f\");\n const filter = this._svg.filter(this._getSvgDef(), filterId, 0, 0, 1, 1);\n this._svg.filters.flood(filter, null, \"#\" + this.state.bkcolor.toHex(), 1.0);\n this._svg.filters.composite(filter, null, null, \"SourceGraphic\");\n this.state._svgtextbkfilter = filter;\n }\n\n opts.filter = \"url(#\" + this.state._svgtextbkfilter.id + \")\";\n }\n this._svg.text(this.state._svggroup, x, y, text, opts);\n }\n\n public lineTo(x: number, y: number): void {\n Helper.log(\"[gdi] lineTo: x=\" + x + \" y=\" + y + \" with pen \" + this.state.selected.pen.toString());\n const toX = this._todevX(x);\n const toY = this._todevY(y);\n const fromX = this._todevX(this.state.x);\n const fromY = this._todevY(this.state.y);\n\n // Update position\n this.state.x = x;\n this.state.y = y;\n\n Helper.log(\"[gdi] lineTo: TRANSLATED: toX=\" + toX + \" toY=\" + toY + \" fromX=\" + fromX + \" fromY=\" + fromY);\n this._pushGroup();\n\n const opts = this._applyOpts(null, true, false, false);\n this._svg.line(this.state._svggroup, fromX, fromY, toX, toY, opts);\n }\n\n public moveTo(x: number, y: number): void {\n Helper.log(\"[gdi] moveTo: x=\" + x + \" y=\" + y);\n this.state.x = x;\n this.state.y = y;\n }\n\n public polygon(points: PointS[], first: boolean): void {\n Helper.log(\"[gdi] polygon: points=\" + points + \" with pen \" + this.state.selected.pen.toString()\n + \" and brush \" + this.state.selected.brush.toString());\n const pts = [];\n for (let i = 0; i < points.length; i++) {\n const point = points[i];\n pts.push([this._todevX(point.x), this._todevY(point.y)]);\n }\n Helper.log(\"[gdi] polygon: TRANSLATED: pts=\" + pts);\n if (first) {\n this._pushGroup();\n }\n const opts = {\n \"fill-rule\": this.state.polyfillmode === Helper.GDI.PolyFillMode.ALTERNATE ? \"evenodd\" : \"nonzero\",\n };\n this._applyOpts(opts, true, true, false);\n this._svg.polygon(this.state._svggroup, pts, opts);\n }\n\n public polyPolygon(polygons: PointS[][]): void {\n Helper.log(\"[gdi] polyPolygon: polygons.length=\" + polygons.length\n + \" with pen \" + this.state.selected.pen.toString()\n + \" and brush \" + this.state.selected.brush.toString());\n\n const cnt = polygons.length;\n for (let i = 0; i < cnt; i++) {\n this.polygon(polygons[i], i === 0);\n }\n }\n\n public polyline(points: PointS[]): void {\n Helper.log(\"[gdi] polyline: points=\" + points + \" with pen \" + this.state.selected.pen.toString());\n const pts = [];\n for (let i = 0; i < points.length; i++) {\n const point = points[i];\n pts.push([this._todevX(point.x), this._todevY(point.y)]);\n }\n Helper.log(\"[gdi] polyline: TRANSLATED: pts=\" + pts);\n this._pushGroup();\n const opts = this._applyOpts({fill: \"none\"}, true, false, false);\n this._svg.polyline(this.state._svggroup, pts, opts);\n }\n\n public ellipse(rect: Rect): void {\n Helper.log(\"[gdi] ellipse: rect=\" + rect.toString() + \" with pen \" + this.state.selected.pen.toString()\n + \" and brush \" + this.state.selected.brush.toString());\n const bottom = this._todevY(rect.bottom);\n const right = this._todevX(rect.right);\n const top = this._todevY(rect.top);\n const left = this._todevX(rect.left);\n Helper.log(\"[gdi] ellipse: TRANSLATED: bottom=\" + bottom + \" right=\" + right + \" top=\" + top + \" left=\" + left);\n this._pushGroup();\n const width2 = (right - left) / 2;\n const height2 = (bottom - top) / 2;\n const opts = this._applyOpts(null, true, true, false);\n this._svg.ellipse(this.state._svggroup, left + width2, top + height2, width2, height2, opts);\n }\n\n public excludeClipRect(rect: Rect): void {\n Helper.log(\"[gdi] excludeClipRect: rect=\" + rect.toString());\n this._getClipRgn().subtract(rect);\n }\n\n public intersectClipRect(rect: Rect): void {\n Helper.log(\"[gdi] intersectClipRect: rect=\" + rect.toString());\n this._getClipRgn().intersect(rect);\n }\n\n public offsetClipRgn(offX: number, offY: number): void {\n Helper.log(\"[gdi] offsetClipRgn: offX=\" + offX + \" offY=\" + offY);\n this._getClipRgn().offset(offX, offY);\n }\n\n public setTextAlign(textAlignmentMode: number): void {\n Helper.log(\"[gdi] setTextAlign: textAlignmentMode=0x\" + textAlignmentMode.toString(16));\n this.state.textalign = textAlignmentMode;\n }\n\n public setBkMode(bkMode: number): void {\n Helper.log(\"[gdi] setBkMode: bkMode=0x\" + bkMode.toString(16));\n this.state.bkmode = bkMode;\n }\n\n public setTextColor(textColor: ColorRef): void {\n Helper.log(\"[gdi] setTextColor: textColor=\" + textColor.toString());\n this.state.textcolor = textColor;\n }\n\n public setBkColor(bkColor: ColorRef): void {\n Helper.log(\"[gdi] setBkColor: bkColor=\" + bkColor.toString());\n this.state.bkcolor = bkColor;\n this.state._svgtextbkfilter = null;\n }\n\n public setPolyFillMode(polyFillMode: number): void {\n Helper.log(\"[gdi] setPolyFillMode: polyFillMode=\" + polyFillMode);\n this.state.polyfillmode = polyFillMode;\n }\n\n public createBrush(brush: Brush): void {\n const idx = this._storeObject(brush);\n Helper.log(\"[gdi] createBrush: brush=\" + brush.toString() + \" with handle \" + idx);\n }\n\n public createFont(font: Font): void {\n const idx = this._storeObject(font);\n Helper.log(\"[gdi] createFont: font=\" + font.toString() + \" with handle \" + idx);\n }\n\n public createPen(pen: Pen): void {\n const idx = this._storeObject(pen);\n Helper.log(\"[gdi] createPen: pen=\" + pen.toString() + \" width handle \" + idx);\n }\n\n public createPalette(palette: Palette): void {\n const idx = this._storeObject(palette);\n Helper.log(\"[gdi] createPalette: palette=\" + palette.toString() + \" width handle \" + idx);\n }\n\n public createRegion(region: Region): void {\n const idx = this._storeObject(region);\n Helper.log(\"[gdi] createRegion: region=\" + region.toString() + \" width handle \" + idx);\n }\n\n public createPatternBrush(patternBrush: Brush): void {\n const idx = this._storeObject(patternBrush);\n Helper.log(\"[gdi] createRegion: region=\" + patternBrush.toString() + \" width handle \" + idx);\n }\n\n public selectObject(objIdx: number, checkType: string): void {\n const obj = this._getObject(objIdx);\n if (obj != null && (checkType == null || obj.type === checkType)) {\n this._selectObject(obj);\n Helper.log(\"[gdi] selectObject: objIdx=\" + objIdx\n + (obj ? \" selected \" + obj.type + \": \" + obj.toString() : \"[invalid index]\"));\n } else {\n Helper.log(\"[gdi] selectObject: objIdx=\" + objIdx\n + (obj ? \" invalid object type: \" + obj.type : \"[invalid index]\"));\n }\n }\n\n public deleteObject(objIdx: number): void {\n const ret = this._deleteObject(objIdx);\n Helper.log(\"[gdi] deleteObject: objIdx=\" + objIdx + (ret ? \" deleted object\" : \"[invalid index]\"));\n }\n\n private _pushGroup() {\n if (this.state._svggroup == null || this.state._svgclipChanged) {\n this.state._svgclipChanged = false;\n this.state._svgtextbkfilter = null;\n\n const settings: any = {\n viewBox: [this.state.vx, this.state.vy, this.state.vw, this.state.vh].join(\" \"),\n preserveAspectRatio: \"none\",\n };\n if (this.state.clip != null) {\n Helper.log(\"[gdi] new svg x=\" + this.state.vx + \" y=\" + this.state.vy\n + \" width=\" + this.state.vw + \" height=\" + this.state.vh + \" with clipping\");\n settings[\"clip-path\"] = \"url(#\" + this._getSvgClipPathForRegion(this.state.clip) + \")\";\n } else {\n Helper.log(\"[gdi] new svg x=\" + this.state.vx + \" y=\" + this.state.vy\n + \" width=\" + this.state.vw + \" height=\" + this.state.vh + \" without clipping\");\n }\n this.state._svggroup = this._svg.svg(this.state._svggroup,\n this.state.vx, this.state.vy, this.state.vw, this.state.vh, settings);\n }\n }\n\n private _storeObject(obj: Obj) {\n let i = 0;\n while (this.objects[i.toString()] != null && i <= 65535) {\n i++;\n }\n if (i > 65535) {\n Helper.log(\"[gdi] Too many objects!\");\n return -1;\n }\n\n this.objects[i.toString()] = obj;\n return i;\n }\n\n private _getObject(objIdx: number) {\n const obj = this.objects[objIdx.toString()];\n if (obj == null) {\n Helper.log(\"[gdi] No object with handle \" + objIdx);\n }\n return obj;\n }\n\n private _getSvgDef() {\n if (this._svgdefs == null) {\n this._svgdefs = this._svg.defs();\n }\n return this._svgdefs;\n }\n\n private _getSvgClipPathForRegion(region: Region) {\n for (const existingId in this._svgClipPaths) {\n const rgn = this._svgClipPaths[existingId];\n if (rgn === region) {\n return existingId;\n }\n }\n\n const id = Helper._makeUniqueId(\"c\");\n const sclip = this._svg.clipPath(this._getSvgDef(), id, \"userSpaceOnUse\");\n switch (region.complexity) {\n case 1:\n this._svg.rect(sclip, this._todevX(region.bounds.left), this._todevY(region.bounds.top),\n this._todevW(region.bounds.right - region.bounds.left),\n this._todevH(region.bounds.bottom - region.bounds.top),\n {\"fill\": \"black\", \"stroke-width\": 0});\n break;\n case 2:\n for (let i = 0; i < region.scans.length; i++) {\n const scan = region.scans[i];\n for (let j = 0; j < scan.scanlines.length; j++) {\n const scanline = scan.scanlines[j];\n this._svg.rect(sclip, this._todevX(scanline.left), this._todevY(scan.top),\n this._todevW(scanline.right - scanline.left), this._todevH(scan.bottom - scan.top),\n {\"fill\": \"black\", \"stroke-width\": 0});\n }\n }\n break;\n }\n this._svgClipPaths[id] = region;\n return id;\n }\n\n private _getSvgPatternForBrush(brush: Brush) {\n for (const existingId in this._svgPatterns) {\n const pat = this._svgPatterns[existingId];\n if (pat === brush) {\n return existingId;\n }\n }\n\n let width;\n let height;\n let img;\n switch (brush.style) {\n case Helper.GDI.BrushStyle.BS_PATTERN:\n width = brush.pattern.getWidth();\n height = brush.pattern.getHeight();\n break;\n case Helper.GDI.BrushStyle.BS_DIBPATTERNPT:\n width = brush.dibpatternpt.getWidth();\n height = brush.dibpatternpt.getHeight();\n img = brush.dibpatternpt.base64ref();\n break;\n default:\n throw new WMFJSError(\"Invalid brush style\");\n }\n\n const id = Helper._makeUniqueId(\"p\");\n const spat = this._svg.pattern(this._getSvgDef(), id, 0, 0, width, height, {patternUnits: \"userSpaceOnUse\"});\n this._svg.image(spat, 0, 0, width, height, img);\n this._svgPatterns[id] = brush;\n return id;\n }\n\n private _selectObject(obj: Obj) {\n this.state.selected[obj.type] = obj;\n if (obj.type === \"region\") {\n this.state._svgclipChanged = true;\n }\n }\n\n private _deleteObject(objIdx: number) {\n const obj = this.objects[objIdx.toString()];\n if (obj != null) {\n for (let i = 0; i < this.statestack.length; i++) {\n const state = this.statestack[i];\n if (state.selected[obj.type] === obj) {\n state.selected[obj.type] = this.defObjects[obj.type].clone();\n }\n }\n delete this.objects[objIdx.toString()];\n return true;\n }\n\n Helper.log(\"[gdi] Cannot delete object with invalid handle \" + objIdx);\n return false;\n }\n\n private _getClipRgn() {\n if (this.state.clip != null) {\n if (!this.state.ownclip) {\n this.state.clip = this.state.clip.clone();\n }\n } else {\n if (this.state.selected.region != null) {\n this.state.clip = this.state.selected.region.clone();\n } else {\n this.state.clip = CreateSimpleRegion(this.state.wx, this.state.wy, this.state.wx + this.state.ww,\n this.state.wy + this.state.wh);\n }\n }\n this.state.ownclip = true;\n return this.state.clip;\n }\n\n private _todevX(val: number) {\n // http://wvware.sourceforge.net/caolan/mapmode.html\n // logical -> device\n return Math.floor((val - this.state.wx) * (this.state.vw / this.state.ww)) + this.state.vx;\n }\n\n private _todevY(val: number) {\n // http://wvware.sourceforge.net/caolan/mapmode.html\n // logical -> device\n return Math.floor((val - this.state.wy) * (this.state.vh / this.state.wh)) + this.state.vy;\n }\n\n private _todevW(val: number) {\n // http://wvware.sourceforge.net/caolan/mapmode.html\n // logical -> device\n return Math.floor(val * (this.state.vw / this.state.ww)) + this.state.vx;\n }\n\n private _todevH(val: number) {\n // http://wvware.sourceforge.net/caolan/mapmode.html\n // logical -> device\n return Math.floor(val * (this.state.vh / this.state.wh)) + this.state.vy;\n }\n\n private _tologicalX(val: number) {\n // http://wvware.sourceforge.net/caolan/mapmode.html\n // logical -> device\n return Math.floor((val - this.state.vx) / (this.state.vw / this.state.ww)) + this.state.wx;\n }\n\n private _tologicalY(val: number) {\n // http://wvware.sourceforge.net/caolan/mapmode.html\n // logical -> device\n return Math.floor((val - this.state.vy) / (this.state.vh / this.state.wh)) + this.state.wy;\n }\n\n private _tologicalW(val: number) {\n // http://wvware.sourceforge.net/caolan/mapmode.html\n // logical -> device\n return Math.floor(val / (this.state.vw / this.state.ww)) + this.state.wx;\n }\n\n private _tologicalH(val: number) {\n // http://wvware.sourceforge.net/caolan/mapmode.html\n // logical -> device\n return Math.floor(val / (this.state.vh / this.state.wh)) + this.state.wy;\n }\n\n private _applyOpts(opts: any, usePen: boolean, useBrush: boolean, useFont: boolean) {\n if (opts == null) {\n opts = {};\n }\n if (usePen) {\n const pen = this.state.selected.pen;\n if (pen.style !== Helper.GDI.PenStyle.PS_NULL) {\n opts.stroke = \"#\" + pen.color.toHex(), // TODO: pen style\n opts[\"stroke-width\"] = this._todevW(pen.width.x); // TODO: is .y ever used?\n\n let dotWidth;\n if ((pen.linecap & Helper.GDI.PenStyle.PS_ENDCAP_SQUARE) !== 0) {\n opts[\"stroke-linecap\"] = \"square\";\n dotWidth = 1;\n } else if ((pen.linecap & Helper.GDI.PenStyle.PS_ENDCAP_FLAT) !== 0) {\n opts[\"stroke-linecap\"] = \"butt\";\n dotWidth = opts[\"stroke-width\"];\n } else {\n opts[\"stroke-linecap\"] = \"round\";\n dotWidth = 1;\n }\n\n if ((pen.join & Helper.GDI.PenStyle.PS_JOIN_BEVEL) !== 0) {\n opts[\"stroke-linejoin\"] = \"bevel\";\n } else if ((pen.join & Helper.GDI.PenStyle.PS_JOIN_MITER) !== 0) {\n opts[\"stroke-linejoin\"] = \"miter\";\n } else {\n opts[\"stroke-linejoin\"] = \"round\";\n }\n\n const dashWidth = opts[\"stroke-width\"] * 4;\n const dotSpacing = opts[\"stroke-width\"] * 2;\n switch (pen.style) {\n case Helper.GDI.PenStyle.PS_DASH:\n opts[\"stroke-dasharray\"] = [dashWidth, dotSpacing].toString();\n break;\n case Helper.GDI.PenStyle.PS_DOT:\n opts[\"stroke-dasharray\"] = [dotWidth, dotSpacing].toString();\n break;\n case Helper.GDI.PenStyle.PS_DASHDOT:\n opts[\"stroke-dasharray\"] = [dashWidth, dotSpacing, dotWidth, dotSpacing].toString();\n break;\n case Helper.GDI.PenStyle.PS_DASHDOTDOT:\n opts[\"stroke-dasharray\"]\n = [dashWidth, dotSpacing, dotWidth, dotSpacing, dotWidth, dotSpacing].toString();\n break;\n }\n }\n }\n if (useBrush) {\n const brush = this.state.selected.brush;\n switch (brush.style) {\n case Helper.GDI.BrushStyle.BS_SOLID:\n opts.fill = \"#\" + brush.color.toHex();\n break;\n case Helper.GDI.BrushStyle.BS_PATTERN:\n case Helper.GDI.BrushStyle.BS_DIBPATTERNPT:\n opts.fill = \"url(#\" + this._getSvgPatternForBrush(brush) + \")\";\n break;\n case Helper.GDI.BrushStyle.BS_NULL:\n opts.fill = \"none\";\n break;\n default:\n Helper.log(\"[gdi] unsupported brush style: \" + brush.style);\n opts.fill = \"none\";\n break;\n }\n }\n if (useFont) {\n const font = this.state.selected.font;\n opts[\"font-family\"] = font.facename;\n opts[\"font-size\"] = this._todevH(Math.abs(font.height));\n opts.fill = \"#\" + this.state.textcolor.toHex();\n }\n return opts;\n }\n}\n","/*\n\nThe MIT License (MIT)\n\nCopyright (c) 2015 Thomas Bluemel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n\nexport class WMFJSError extends Error {\n constructor(message: string) {\n super(message); // 'Error' breaks prototype chain here\n Object.setPrototypeOf(this, new.target.prototype); // restore prototype chain\n }\n}\n\nlet isLoggingEnabled = true;\n\nexport function loggingEnabled(enabled: boolean): void {\n isLoggingEnabled = enabled;\n}\n\nexport class Helper {\n public static GDI = {\n METAHEADER_SIZE: 18,\n BITMAPINFOHEADER_SIZE: 40,\n BITMAPCOREHEADER_SIZE: 12,\n MetafileType: {\n MEMORYMETAFILE: 1,\n DISKMETAFILE: 2,\n },\n MetafileVersion: {\n METAVERSION100: 0x100,\n METAVERSION300: 0x300,\n },\n RecordType: {\n META_EOF: 0x0000,\n META_REALIZEPALETTE: 0x0035,\n META_SETPALENTRIES: 0x0037,\n META_SETBKMODE: 0x0102,\n META_SETMAPMODE: 0x0103,\n META_SETROP2: 0x0104,\n META_SETRELABS: 0x0105,\n META_SETPOLYFILLMODE: 0x0106,\n META_SETSTRETCHBLTMODE: 0x0107,\n META_SETTEXTCHAREXTRA: 0x0108,\n META_RESTOREDC: 0x0127,\n META_RESIZEPALETTE: 0x0139,\n META_DIBCREATEPATTERNBRUSH: 0x0142,\n META_SETLAYOUT: 0x0149,\n META_SETBKCOLOR: 0x0201,\n META_SETTEXTCOLOR: 0x0209,\n META_OFFSETVIEWPORTORG: 0x0211,\n META_LINETO: 0x0213,\n META_MOVETO: 0x0214,\n META_OFFSETCLIPRGN: 0x0220,\n META_FILLREGION: 0x0228,\n META_SETMAPPERFLAGS: 0x0231,\n META_SELECTPALETTE: 0x0234,\n META_POLYGON: 0x0324,\n META_POLYLINE: 0x0325,\n META_SETTEXTJUSTIFICATION: 0x020a,\n META_SETWINDOWORG: 0x020b,\n META_SETWINDOWEXT: 0x020c,\n META_SETVIEWPORTORG: 0x020d,\n META_SETVIEWPORTEXT: 0x020e,\n META_OFFSETWINDOWORG: 0x020f,\n META_SCALEWINDOWEXT: 0x0410,\n META_SCALEVIEWPORTEXT: 0x0412,\n META_EXCLUDECLIPRECT: 0x0415,\n META_INTERSECTCLIPRECT: 0x0416,\n META_ELLIPSE: 0x0418,\n META_FLOODFILL: 0x0419,\n META_FRAMEREGION: 0x0429,\n META_ANIMATEPALETTE: 0x0436,\n META_TEXTOUT: 0x0521,\n META_POLYPOLYGON: 0x0538,\n META_EXTFLOODFILL: 0x0548,\n META_RECTANGLE: 0x041b,\n META_SETPIXEL: 0x041f,\n META_ROUNDRECT: 0x061c,\n META_PATBLT: 0x061d,\n META_SAVEDC: 0x001e,\n META_PIE: 0x081a,\n META_STRETCHBLT: 0x0b23,\n META_ESCAPE: 0x0626,\n META_INVERTREGION: 0x012a,\n META_PAINTREGION: 0x012b,\n META_SELECTCLIPREGION: 0x012c,\n META_SELECTOBJECT: 0x012d,\n META_SETTEXTALIGN: 0x012e,\n META_ARC: 0x0817,\n META_CHORD: 0x0830,\n META_BITBLT: 0x0922,\n META_EXTTEXTOUT: 0x0a32,\n META_SETDIBTODEV: 0x0d33,\n META_DIBBITBLT: 0x0940,\n META_DIBSTRETCHBLT: 0x0b41,\n META_STRETCHDIB: 0x0f43,\n META_DELETEOBJECT: 0x01f0,\n META_CREATEPALETTE: 0x00f7,\n META_CREATEPATTERNBRUSH: 0x01f9,\n META_CREATEPENINDIRECT: 0x02fa,\n META_CREATEFONTINDIRECT: 0x02fb,\n META_CREATEBRUSHINDIRECT: 0x02fc,\n META_CREATEREGION: 0x06ff,\n },\n MetafileEscapes: {\n NEWFRAME: 0x0001,\n ABORTDOC: 0x0002,\n NEXTBAND: 0x0003,\n SETCOLORTABLE: 0x0004,\n GETCOLORTABLE: 0x0005,\n FLUSHOUT: 0x0006,\n DRAFTMODE: 0x0007,\n QUERYESCSUPPORT: 0x0008,\n SETABORTPROC: 0x0009,\n STARTDOC: 0x000a,\n ENDDOC: 0x000b,\n GETPHYSPAGESIZE: 0x000c,\n GETPRINTINGOFFSET: 0x000d,\n GETSCALINGFACTOR: 0x000e,\n META_ESCAPE_ENHANCED_METAFILE: 0x000f,\n SETPENWIDTH: 0x0010,\n SETCOPYCOUNT: 0x0011,\n SETPAPERSOURCE: 0x0012,\n PASSTHROUGH: 0x0013,\n GETTECHNOLOGY: 0x0014,\n SETLINECAP: 0x0015,\n SETLINEJOIN: 0x0016,\n SETMITERLIMIT: 0x0017,\n BANDINFO: 0x0018,\n DRAWPATTERNRECT: 0x0019,\n GETVECTORPENSIZE: 0x001a,\n GETVECTORBRUSHSIZE: 0x001b,\n ENABLEDUPLEX: 0x001c,\n GETSETPAPERBINS: 0x001d,\n GETSETPRINTORIENT: 0x001e,\n ENUMPAPERBINS: 0x001f,\n SETDIBSCALING: 0x0020,\n EPSPRINTING: 0x0021,\n ENUMPAPERMETRICS: 0x0022,\n GETSETPAPERMETRICS: 0x0023,\n POSTSCRIPT_DATA: 0x0025,\n POSTSCRIPT_IGNORE: 0x0026,\n GETDEVICEUNITS: 0x002a,\n GETEXTENDEDTEXTMETRICS: 0x0100,\n GETPAIRKERNTABLE: 0x0102,\n EXTTEXTOUT: 0x0200,\n GETFACENAME: 0x0201,\n DOWNLOADFACE: 0x0202,\n METAFILE_DRIVER: 0x0801,\n QUERYDIBSUPPORT: 0x0c01,\n BEGIN_PATH: 0x1000,\n CLIP_TO_PATH: 0x1001,\n END_PATH: 0x1002,\n OPEN_CHANNEL: 0x100e,\n DOWNLOADHEADER: 0x100f,\n CLOSE_CHANNEL: 0x1010,\n POSTSCRIPT_PASSTHROUGH: 0x1013,\n ENCAPSULATED_POSTSCRIPT: 0x1014,\n POSTSCRIPT_IDENTIFY: 0x1015,\n POSTSCRIPT_INJECTION: 0x1016,\n CHECKJPEGFORMAT: 0x1017,\n CHECKPNGFORMAT: 0x1018,\n GET_PS_FEATURESETTING: 0x1019,\n MXDC_ESCAPE: 0x101a,\n SPCLPASSTHROUGH2: 0x11d8,\n },\n MapMode: {\n MM_TEXT: 1,\n MM_LOMETRIC: 2,\n MM_HIMETRIC: 3,\n MM_LOENGLISH: 4,\n MM_HIENGLISH: 5,\n MM_TWIPS: 6,\n MM_ISOTROPIC: 7,\n MM_ANISOTROPIC: 8,\n },\n StretchMode: {\n BLACKONWHITE: 1,\n WHITEONBLACK: 2,\n COLORONCOLOR: 3,\n HALFTONE: 4,\n },\n TextAlignmentMode: {\n TA_UPDATECP: 1,\n TA_RIGHT: 2,\n TA_CENTER: 6,\n TA_BOTTOM: 8,\n TA_BASELINE: 24,\n TA_RTLREADING: 256,\n },\n MixMode: {\n TRANSPARENT: 1,\n OPAQUE: 2,\n },\n VerticalTextAlignmentMode: {\n VTA_BOTTOM: 2,\n VTA_CENTER: 6,\n VTA_LEFT: 8,\n VTA_BASELINE: 24,\n },\n BrushStyle: {\n BS_SOLID: 0,\n BS_NULL: 1,\n BS_HATCHED: 2,\n BS_PATTERN: 3,\n BS_INDEXED: 4,\n BS_DIBPATTERN: 5,\n BS_DIBPATTERNPT: 6,\n BS_PATTERN8X8: 7,\n BS_DIBPATTERN8X8: 8,\n BS_MONOPATTERN: 9,\n },\n PenStyle: {\n PS_SOLID: 0,\n PS_DASH: 1,\n PS_DOT: 2,\n PS_DASHDOT: 3,\n PS_DASHDOTDOT: 4,\n PS_NULL: 5,\n PS_INSIDEFRAME: 6,\n PS_USERSTYLE: 7,\n PS_ALTERNATE: 8,\n PS_ENDCAP_SQUARE: 256,\n PS_ENDCAP_FLAT: 512,\n PS_JOIN_BEVEL: 4096,\n PS_JOIN_MITER: 8192,\n },\n PolyFillMode: {\n ALTERNATE: 1,\n WINDING: 2,\n },\n ColorUsage: {\n DIB_RGB_COLORS: 0,\n DIB_PAL_COLORS: 1,\n DIB_PAL_INDICES: 2,\n },\n PaletteEntryFlag: {\n PC_RESERVED: 1,\n PC_EXPLICIT: 2,\n PC_NOCOLLAPSE: 4,\n },\n BitmapCompression: {\n BI_RGB: 0,\n BI_RLE8: 1,\n BI_RLE4: 2,\n BI_BITFIELDS: 3,\n BI_JPEG: 4,\n BI_PNG: 5,\n },\n };\n public static _uniqueId = 0;\n\n public static log(message: string): void {\n if (isLoggingEnabled) {\n console.log(message);\n }\n }\n\n public static _makeUniqueId(prefix: string): string {\n return \"wmfjs_\" + prefix + (this._uniqueId++);\n }\n\n public static _writeUint32Val(uint8arr: Uint8Array, pos: number, val: number): void {\n uint8arr[pos++] = val & 0xff;\n uint8arr[pos++] = (val >>> 8) & 0xff;\n uint8arr[pos++] = (val >>> 16) & 0xff;\n uint8arr[pos++] = (val >>> 24) & 0xff;\n }\n\n public static _blobToBinary(blob: Uint8Array): string {\n let ret = \"\";\n const len = blob.length;\n for (let i = 0; i < len; i++) {\n ret += String.fromCharCode(blob[i]);\n }\n return ret;\n }\n}\n","/*\n\nThe MIT License (MIT)\n\nCopyright (c) 2015 Thomas Bluemel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n\nimport { Blob } from \"./Blob\";\nimport { WMFJSError } from \"./Helper\";\n\nexport class PointS {\n public x: number;\n public y: number;\n\n constructor(reader: Blob, x?: number, y?: number) {\n if (reader != null) {\n this.x = reader.readInt16();\n this.y = reader.readInt16();\n } else {\n this.x = x;\n this.y = y;\n }\n }\n\n public clone(): PointS {\n return new PointS(null, this.x, this.y);\n }\n\n public toString(): string {\n return \"{x: \" + this.x + \", y: \" + this.y + \"}\";\n }\n}\n\nexport class Rect {\n public bottom: number;\n public right: number;\n public top: number;\n public left: number;\n\n constructor(reader: Blob, left?: number, top?: number, right?: number, bottom?: number) {\n if (reader != null) {\n this.bottom = reader.readInt16();\n this.right = reader.readInt16();\n this.top = reader.readInt16();\n this.left = reader.readInt16();\n } else {\n this.bottom = bottom;\n this.right = right;\n this.top = top;\n this.left = left;\n }\n }\n\n public clone(): Rect {\n return new Rect(null, this.left, this.top, this.right, this.bottom);\n }\n\n public toString(): string {\n return \"{left: \" + this.left + \", top: \" + this.top + \", right: \" + this.right\n + \", bottom: \" + this.bottom + \"}\";\n }\n\n public empty(): boolean {\n return this.left >= this.right || this.top >= this.bottom;\n }\n\n public intersect(rect: Rect): null | Rect {\n if (this.empty() || rect.empty()) {\n return null;\n }\n if (this.left >= rect.right || this.top >= rect.bottom ||\n this.right <= rect.left || this.bottom <= rect.top) {\n return null;\n }\n return new Rect(null, Math.max(this.left, rect.left), Math.max(this.top, rect.top),\n Math.min(this.right, rect.right), Math.min(this.bottom, rect.bottom));\n }\n}\n\nexport class Obj {\n public type: string;\n\n constructor(type: string) {\n this.type = type;\n }\n\n public clone(): Obj {\n throw new WMFJSError(\"clone not implemented\");\n }\n\n public toString(): string {\n throw new WMFJSError(\"toString not implemented\");\n }\n}\n","/*\n\nThe MIT License (MIT)\n\nCopyright (c) 2015 Thomas Bluemel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n\nimport { Blob } from \"./Blob\";\nimport { Helper, WMFJSError } from \"./Helper\";\nimport { Obj, Rect } from \"./Primitives\";\n\nexport class Region extends Obj {\n public bounds: Rect;\n public scans: Scan[];\n public complexity: number;\n\n constructor(reader: Blob, copy?: Region) {\n super(\"region\");\n if (reader != null) {\n reader.skip(2);\n if (reader.readInt16() !== 6) {\n throw new WMFJSError(\"Invalid region identifier\");\n }\n reader.skip(2);\n const rgnSize = reader.readInt16();\n const scanCnt = reader.readInt16();\n reader.skip(2);\n // note, Rect in reverse, can't use Rect(reader) directly\n const left = reader.readInt16();\n const top = reader.readInt16();\n const right = reader.readInt16();\n const bottom = reader.readInt16();\n this.bounds = new Rect(null, left, top, right, bottom);\n this.scans = [];\n for (let i = 0; i < scanCnt; i++) {\n this.scans.push(new Scan(reader));\n }\n this._updateComplexity();\n } else if (copy != null) {\n this.bounds = copy.bounds != null ? copy.bounds.clone() : null;\n if (copy.scans != null) {\n this.scans = [];\n for (let i = 0; i < copy.scans.length; i++) {\n this.scans.push(copy.scans[i].clone());\n }\n } else {\n this.scans = null;\n }\n this.complexity = copy.complexity;\n } else {\n this.bounds = null;\n this.scans = null;\n this.complexity = 0;\n }\n }\n\n public clone(): Region {\n return new Region(null, this);\n }\n\n public toString(): string {\n const _complexity = [\"null\", \"simple\", \"complex\"];\n return \"{complexity: \" + _complexity[this.complexity]\n + \" bounds: \" + (this.bounds != null ? this.bounds.toString() : \"[none]\")\n + \" #scans: \" + (this.scans != null ? this.scans.length : \"[none]\") + \"}\";\n }\n\n public _updateComplexity(): void {\n if (this.bounds == null) {\n this.complexity = 0;\n this.scans = null;\n } else if (this.bounds.empty()) {\n this.complexity = 0;\n this.scans = null;\n this.bounds = null;\n } else if (this.scans == null) {\n this.complexity = 1;\n } else {\n this.complexity = 2;\n if (this.scans.length === 1) {\n const scan = this.scans[0];\n if (scan.top === this.bounds.top && scan.bottom === this.bounds.bottom && scan.scanlines.length === 1) {\n const scanline = scan.scanlines[0];\n if (scanline.left === this.bounds.left && scanline.right === this.bounds.right) {\n this.scans = null;\n this.complexity = 1;\n }\n }\n }\n }\n }\n\n public subtract(rect: Rect): void {\n Helper.log(\"[wmf] Region \" + this.toString() + \" subtract \" + rect.toString());\n\n if (this.bounds != null) {\n const isect = this.bounds.intersect(rect);\n if (isect != null) { // Only need to do anything if there is any chance of an overlap\n if (this.scans == null) {\n // We currently have a simple region and there is some kind of an overlap.\n // We need to create scanlines now. Simplest method is to fake one scan line\n // that equals the simple region and re-use the same logic as for complex regions\n this.scans = [];\n this.scans.push(new Scan(null, null, this.bounds.top, this.bounds.bottom,\n [{left: this.bounds.left, right: this.bounds.right}]));\n this.complexity = 2;\n }\n\n // We (now) have a complex region. First we skip any scans that are entirely above rect.top\n // The first scan that falls partially below rect.top needs to be split into two scans.\n let si = 0;\n while (si < this.scans.length) {\n const scan = this.scans[si];\n if (scan.bottom >= rect.top) {\n // We need to clone this scan into two so that we can subtract from the second one\n const cloned = scan.clone();\n scan.bottom = rect.top - 1;\n cloned.top = rect.top;\n if (scan.top >= scan.bottom) {\n this.scans[si] = cloned;\n } else {\n Helper.log(\"[wmf] Region split top scan \" + si + \" for substraction\");\n this.scans.splice(++si, 0, cloned);\n }\n break;\n }\n si++;\n }\n\n // Now find the first one that falls at least partially below rect.bottom, which needs to be\n // split if it is only partially below rect.bottom\n const first = si;\n while (si < this.scans.length) {\n const scan = this.scans[si];\n if (scan.top > rect.bottom) {\n break;\n }\n if (scan.bottom > rect.bottom) {\n // We need to clone this scan into two so that we can subtract from the first one\n const cloned = scan.clone();\n scan.bottom = rect.bottom;\n cloned.top = rect.bottom + 1;\n if (scan.top >= scan.bottom) {\n this.scans[si] = cloned;\n } else {\n Helper.log(\"[wmf] Region split bottom scan \" + si + \" for substraction\");\n this.scans.splice(++si, 0, cloned);\n }\n break;\n }\n si++;\n }\n\n // Now perform a subtraction on each scan in between rect.top and rect.bottom. Because we\n // cloned scans that partially overlapped rect.top and rect.bottom, we don't have to\n // account for this anymore.\n if (first < this.scans.length) {\n let last = si;\n si = first;\n while (si < last) {\n const scan = this.scans[si];\n if (!scan.subtract(rect.left, rect.right)) {\n Helper.log(\"[wmf] Region remove now empty scan \" + si + \" due to subtraction\");\n this.scans.splice(si, 1);\n last--;\n continue;\n }\n\n si++;\n }\n }\n\n // Update bounds\n if (this.scans != null) {\n let left;\n let top;\n let right;\n let bottom;\n const len = this.scans.length;\n for (let i = 0; i < len; i++) {\n const scan = this.scans[i];\n if (i === 0) {\n top = scan.top;\n }\n if (i === len - 1) {\n bottom = scan.bottom;\n }\n\n const slen = scan.scanlines.length;\n if (slen > 0) {\n let scanline = scan.scanlines[0];\n if (left == null || scanline.left < left) {\n left = scanline.left;\n }\n scanline = scan.scanlines[slen - 1];\n if (right == null || scanline.right > right) {\n right = scanline.right;\n }\n }\n }\n\n if (left != null && top != null && right != null && bottom != null) {\n this.bounds = new Rect(null, left, top, right, bottom);\n this._updateComplexity();\n } else {\n // This has to be a null region now\n this.bounds = null;\n this.scans = null;\n this.complexity = 0;\n }\n } else {\n this._updateComplexity();\n }\n }\n }\n\n Helper.log(\"[wmf] Region subtraction -> \" + this.toString());\n }\n\n public intersect(rect: Rect): void {\n Helper.log(\"[wmf] Region \" + this.toString() + \" intersect with \" + rect.toString());\n if (this.bounds != null) {\n this.bounds = this.bounds.intersect(rect);\n if (this.bounds != null) {\n if (this.scans != null) {\n let si = 0;\n // Remove any scans that are entirely above the new bounds.top\n while (si < this.scans.length) {\n const scan = this.scans[si];\n if (scan.bottom < this.bounds.top) {\n si++;\n } else {\n break;\n }\n }\n if (si > 0) {\n Helper.log(\"[wmf] Region remove \" + si + \" scans from top\");\n this.scans.splice(0, si);\n\n // Adjust the first scan's top to match the new bounds.top\n if (this.scans.length > 0) {\n this.scans[0].top = this.bounds.top;\n }\n }\n\n // Get rid of anything that falls outside the new bounds.left/bounds.right\n si = 0;\n while (si < this.scans.length) {\n const scan = this.scans[si];\n if (scan.top > this.bounds.bottom) {\n // Remove this and all remaining scans that fall entirely below the new bounds.bottom\n Helper.log(\"[wmf] Region remove \" + (this.scans.length - si) + \" scans from bottom\");\n this.scans.splice(si, this.scans.length - si);\n break;\n }\n if (!scan.intersect(this.bounds.left, this.bounds.right)) {\n // Remove now empty scan\n Helper.log(\"[wmf] Region remove now empty scan \" + si + \" due to intersection\");\n this.scans.splice(si, 1);\n continue;\n }\n si++;\n }\n\n // If there are any scans left, adjust the last one's bottom to the new bounds.bottom\n if (this.scans.length > 0) {\n this.scans[this.scans.length - 1].bottom = this.bounds.bottom;\n }\n\n this._updateComplexity();\n }\n } else {\n this.scans = null;\n this.complexity = 0;\n }\n }\n Helper.log(\"[wmf] Region intersection -> \" + this.toString());\n }\n\n public offset(offX: number, offY: number): void {\n if (this.bounds != null) {\n this.bounds.left += offX;\n this.bounds.top += offY;\n this.bounds.right += offX;\n this.bounds.bottom += offY;\n }\n\n if (this.scans != null) {\n const slen = this.scans.length;\n for (let si = 0; si < slen; si++) {\n const scan = this.scans[si];\n scan.top += offY;\n scan.bottom += offY;\n\n const len = scan.scanlines.length;\n for (let i = 0; i < len; i++) {\n const scanline = scan.scanlines[i];\n scanline.left += offX;\n scanline.right += offX;\n }\n }\n }\n }\n}\n\nexport function CreateSimpleRegion(left: number, top: number, right: number, bottom: number): Region {\n const rgn = new Region(null, null);\n rgn.bounds = new Rect(null, left, top, right, bottom);\n rgn._updateComplexity();\n return rgn;\n}\n\nexport class Scan {\n public top: number;\n public bottom: number;\n public scanlines: { left: number, right: number }[];\n\n constructor(reader: Blob, copy?: Scan, top?: number, bottom?: number,\n scanlines?: { left: number, right: number }[]) {\n if (reader != null) {\n const cnt = reader.readUint16();\n this.top = reader.readUint16();\n this.bottom = reader.readUint16();\n this.scanlines = [];\n for (let i = 0; i < cnt; i++) {\n const left = reader.readUint16();\n const right = reader.readUint16();\n this.scanlines.push({left, right});\n }\n reader.skip(2);\n } else if (copy != null) {\n this.top = copy.top;\n this.bottom = copy.bottom;\n this.scanlines = [];\n for (let i = 0; i < copy.scanlines.length; i++) {\n const scanline = copy.scanlines[i];\n this.scanlines.push({left: scanline.left, right: scanline.right});\n }\n } else {\n this.top = top;\n this.bottom = bottom;\n this.scanlines = scanlines;\n }\n }\n\n public clone(): Scan {\n return new Scan(null, this);\n }\n\n public subtract(left: number, right: number): boolean {\n let i;\n\n // Keep everything on the left side\n i = 0;\n while (i < this.scanlines.length) {\n const scanline = this.scanlines[i];\n if (scanline.left <= left) {\n if (scanline.right >= left) {\n scanline.right = left - 1;\n if (scanline.left >= scanline.right) {\n this.scanlines.splice(i, 1);\n continue;\n }\n }\n i++;\n } else {\n break;\n }\n }\n\n // Find the first one that may exceed to the right side\n const first = i;\n let cnt = 0;\n while (i < this.scanlines.length) {\n const scanline = this.scanlines[i];\n if (scanline.right > right) {\n scanline.left = right;\n cnt = i - first;\n if (scanline.left >= scanline.right) {\n cnt++;\n }\n break;\n }\n i++;\n }\n\n // Delete everything we're subtracting\n if (cnt > 0 && first < this.scanlines.length) {\n this.scanlines.splice(first, cnt);\n }\n\n return this.scanlines.length > 0;\n }\n\n public intersect(left: number, right: number): boolean {\n // Get rid of anything that falls entirely outside to the left\n for (let i = 0; i < this.scanlines.length; i++) {\n const scanline = this.scanlines[i];\n if (scanline.left >= left || scanline.right >= left) {\n if (i > 0) {\n this.scanlines.splice(0, i);\n }\n break;\n }\n }\n\n if (this.scanlines.length > 0) {\n // Adjust the first to match the left, if needed\n let scanline = this.scanlines[0];\n if (scanline.left < left) {\n scanline.left = left;\n }\n\n // Get rid of anything that falls entirely outside to the right\n for (let i = 0; i < this.scanlines.length; i++) {\n scanline = this.scanlines[i];\n if (scanline.left > right) {\n this.scanlines.splice(i, this.scanlines.length - i);\n break;\n }\n }\n\n if (this.scanlines.length > 0) {\n // Adjust the last to match the right, if needed\n scanline = this.scanlines[this.scanlines.length - 1];\n if (scanline.right > right) {\n scanline.right = right;\n }\n }\n }\n return this.scanlines.length > 0;\n }\n\n public toString(): string {\n return \"{ #scanlines: \" + this.scanlines.length + \"}\";\n }\n}\n","/*\n\nThe MIT License (MIT)\n\nCopyright (c) 2015 Thomas Bluemel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n\nimport { SVG } from \"../util\";\nimport { Blob } from \"./Blob\";\nimport { GDIContext } from \"./GDIContext\";\nimport { Helper, WMFJSError } from \"./Helper\";\nimport { WMFRecords } from \"./WMFRecords\";\n\nexport interface IRendererSettings {\n width: string;\n height: string;\n xExt: number;\n yExt: number;\n mapMode: number;\n}\n\nexport class Renderer {\n private _img: WMF;\n\n constructor(blob: ArrayBuffer) {\n this.parse(blob);\n Helper.log(\"WMFJS.Renderer instantiated\");\n }\n\n public render(info: IRendererSettings): SVGElement {\n const svgElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n\n this._render(new SVG(svgElement), info.mapMode, info.xExt, info.yExt);\n svgElement.setAttribute(\"viewBox\", [0, 0, info.xExt, info.yExt].join(\" \"));\n svgElement.setAttribute(\"preserveAspectRatio\", \"none\"); // TODO: MM_ISOTROPIC vs MM_ANISOTROPIC\n svgElement.setAttribute(\"width\", info.width);\n svgElement.setAttribute(\"height\", info.height);\n return svgElement;\n }\n\n private parse(blob: ArrayBuffer) {\n this._img = null;\n\n const reader = new Blob(blob);\n\n let type;\n let size;\n let placable;\n let headerstart;\n const key = reader.readUint32();\n if (key === 0x9ac6cdd7) {\n placable = new WMFPlacable(reader);\n headerstart = reader.pos;\n type = reader.readUint16();\n size = reader.readUint16();\n } else {\n headerstart = 0;\n type = key & 0xffff;\n size = (key >>> 16) & 0xffff;\n }\n switch (type) {\n case Helper.GDI.MetafileType.MEMORYMETAFILE:\n case Helper.GDI.MetafileType.DISKMETAFILE:\n if (size === Helper.GDI.METAHEADER_SIZE / 2) {\n const version = reader.readUint16();\n switch (version) {\n case Helper.GDI.MetafileVersion.METAVERSION100:\n case Helper.GDI.MetafileVersion.METAVERSION300:\n this._img = new WMF(reader, placable, version, headerstart + (size * 2));\n break;\n }\n }\n break;\n }\n\n if (this._img == null) {\n throw new WMFJSError(\"Format not recognized\");\n }\n }\n\n private _render(svg: SVG, mapMode: number, xExt: number, yExt: number) {\n // See https://www-user.tu-chemnitz.de/~ygu/petzold/ch18b.htm\n const gdi = new GDIContext(svg);\n gdi.setViewportExt(xExt, yExt);\n gdi.setMapMode(mapMode);\n Helper.log(\"[WMF] BEGIN RENDERING --->\");\n this._img.render(gdi);\n Helper.log(\"[WMF] <--- DONE RENDERING\");\n }\n}\n\nclass WMFRect16 {\n private left: number;\n private top: number;\n private right: number;\n private bottom: number;\n\n constructor(reader: Blob) {\n this.left = reader.readInt16();\n this.top = reader.readInt16();\n this.right = reader.readInt16();\n this.bottom = reader.readInt16();\n }\n\n public toString(): string {\n return \"{left: \" + this.left + \", top: \" + this.top + \", right: \" + this.right\n + \", bottom: \" + this.bottom + \"}\";\n }\n}\n\nclass WMFPlacable {\n private boundingBox: WMFRect16;\n private unitsPerInch: number;\n\n constructor(reader: Blob) {\n reader.skip(2);\n this.boundingBox = new WMFRect16(reader);\n this.unitsPerInch = reader.readInt16();\n reader.skip(4);\n reader.skip(2); // TODO: checksum\n Helper.log(\"Got bounding box \" + this.boundingBox + \" and \" + this.unitsPerInch + \" units/inch\");\n }\n}\n\nclass WMF {\n private _version: number;\n private _hdrsize: number;\n private _placable: WMFPlacable;\n private _records: WMFRecords;\n\n constructor(reader: Blob, placable: WMFPlacable, version: number, hdrsize: number) {\n this._version = version;\n this._hdrsize = hdrsize;\n this._placable = placable;\n this._records = new WMFRecords(reader, this._hdrsize);\n }\n\n public render(gdi: GDIContext): void {\n this._records.play(gdi);\n }\n}\n","/*\n\nThe MIT License (MIT)\n\nCopyright (c) 2015 Thomas Bluemel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n\nimport { Bitmap16, DIBitmap, PatternBitmap16 } from \"./Bitmap\";\nimport { Blob } from \"./Blob\";\nimport { Helper } from \"./Helper\";\nimport { Obj, PointS } from \"./Primitives\";\n\nexport class ColorRef {\n public r: number;\n public g: number;\n public b: number;\n\n constructor(reader: Blob, r?: number, g?: number, b?: number) {\n if (reader != null) {\n this.r = reader.readUint8();\n this.g = reader.readUint8();\n this.b = reader.readUint8();\n reader.skip(1);\n } else {\n this.r = r;\n this.g = g;\n this.b = b;\n }\n }\n\n public clone(): ColorRef {\n return new ColorRef(null, this.r, this.g, this.b);\n }\n\n public toHex(): string {\n const rgb = (this.r << 16) | (this.g << 8) | this.b;\n return (0x1000000 + rgb).toString(16).slice(1);\n }\n\n public toString(): string {\n return \"{r: \" + this.r + \", g: \" + this.g + \", b: \" + this.b + \"}\";\n }\n}\n\nexport class Font extends Obj {\n public height: number;\n public width: number;\n public escapement: number;\n public orientation: number;\n public weight: number;\n public italic: number;\n public underline: number;\n public strikeout: number;\n public charset: number;\n public outprecision: number;\n public clipprecision: number;\n public quality: number;\n public pitch: number;\n public family: number;\n public facename: string;\n\n constructor(reader: Blob, copy: Font | number) {\n super(\"font\");\n if (reader != null) {\n this.height = reader.readInt16();\n this.width = reader.readInt16();\n this.escapement = reader.readInt16();\n this.orientation = reader.readInt16();\n this.weight = reader.readInt16();\n this.italic = reader.readUint8();\n this.underline = reader.readUint8();\n this.strikeout = reader.readUint8();\n this.charset = reader.readUint8();\n this.outprecision = reader.readUint8();\n this.clipprecision = reader.readUint8();\n this.quality = reader.readUint8();\n const pitchAndFamily = reader.readUint8();\n this.pitch = pitchAndFamily & 0xf; // TODO: double check\n this.family = (pitchAndFamily >> 6) & 0x3; // TODO: double check\n\n const dataLength = copy as number;\n const start = reader.pos;\n this.facename = reader.readNullTermString(Math.min(dataLength - (reader.pos - start), 32));\n } else if (copy != null) {\n copy = copy as Font;\n this.height = copy.height;\n this.width = copy.width;\n this.escapement = copy.escapement;\n this.orientation = copy.orientation;\n this.weight = copy.weight;\n this.italic = copy.italic;\n this.underline = copy.underline;\n this.strikeout = copy.strikeout;\n this.charset = copy.charset;\n this.outprecision = copy.outprecision;\n this.clipprecision = copy.clipprecision;\n this.quality = copy.quality;\n this.pitch = copy.pitch;\n this.family = copy.family;\n this.facename = copy.facename;\n } else {\n // TODO: Values for a default font?\n this.height = -80;\n this.width = 0;\n this.escapement = 0;\n this.orientation = 0;\n this.weight = 400;\n this.italic = 0;\n this.underline = 0;\n this.strikeout = 0;\n this.charset = 0;\n this.outprecision = 0;\n this.clipprecision = 0;\n this.quality = 0;\n this.pitch = 0;\n this.family = 0;\n this.facename = \"Helvetica\";\n }\n }\n\n public clone(): Font {\n return new Font(null, this);\n }\n\n public toString(): string {\n return JSON.stringify(this);\n }\n}\n\nexport class Brush extends Obj {\n public style: number;\n public color: ColorRef;\n public pattern: Bitmap16;\n public colorusage: number;\n public dibpatternpt: DIBitmap;\n public hatchstyle: number;\n\n constructor(reader: Blob, copy: Brush | number, forceDibPattern?: boolean | PatternBitmap16) {\n super(\"brush\");\n if (reader != null) {\n const dataLength = copy as number;\n const start = reader.pos;\n\n if (forceDibPattern === true || forceDibPattern === false) {\n this.style = reader.readUint16();\n if (forceDibPattern && this.style !== Helper.GDI.BrushStyle.BS_PATTERN) {\n this.style = Helper.GDI.BrushStyle.BS_DIBPATTERNPT;\n }\n switch (this.style) {\n case Helper.GDI.BrushStyle.BS_SOLID:\n this.color = new ColorRef(reader);\n break;\n case Helper.GDI.BrushStyle.BS_PATTERN:\n reader.skip(forceDibPattern ? 2 : 6);\n this.pattern = new Bitmap16(reader, dataLength - (reader.pos - start));\n break;\n case Helper.GDI.BrushStyle.BS_DIBPATTERNPT:\n this.colorusage = forceDibPattern ? reader.readUint16() : reader.readUint32();\n if (!forceDibPattern) {\n reader.skip(2);\n }\n this.dibpatternpt = new DIBitmap(reader, dataLength - (reader.pos - start));\n break;\n case Helper.GDI.BrushStyle.BS_HATCHED:\n this.color = new ColorRef(reader);\n this.hatchstyle = reader.readUint16();\n break;\n }\n } else if (forceDibPattern instanceof PatternBitmap16) {\n this.style = Helper.GDI.BrushStyle.BS_PATTERN;\n this.pattern = forceDibPattern;\n }\n } else if (copy != null) {\n copy = copy as Brush;\n this.style = copy.style;\n switch (this.style) {\n case Helper.GDI.BrushStyle.BS_SOLID:\n this.color = copy.color.clone();\n break;\n case Helper.GDI.BrushStyle.BS_PATTERN:\n this.pattern = copy.pattern.clone();\n break;\n case Helper.GDI.BrushStyle.BS_DIBPATTERNPT:\n this.colorusage = copy.colorusage;\n this.dibpatternpt = copy.dibpatternpt;\n break;\n case Helper.GDI.BrushStyle.BS_HATCHED:\n this.color = copy.color.clone();\n this.hatchstyle = copy.hatchstyle;\n break;\n }\n }\n }\n\n public clone(): Brush {\n return new Brush(null, this);\n }\n\n public toString(): string {\n let ret = \"{style: \" + this.style;\n switch (this.style) {\n case Helper.GDI.BrushStyle.BS_SOLID:\n ret += \", color: \" + this.color.toString();\n break;\n case Helper.GDI.BrushStyle.BS_DIBPATTERNPT:\n ret += \", colorusage: \" + this.colorusage;\n break;\n case Helper.GDI.BrushStyle.BS_HATCHED:\n ret += \", color: \" + this.color.toString() + \", hatchstyle: \" + this.hatchstyle;\n break;\n }\n return ret + \"}\";\n }\n}\n\nexport class Pen extends Obj {\n public style: number;\n public width: PointS;\n public color: ColorRef;\n public linecap: number;\n public join: number;\n\n constructor(reader: Blob, style?: number, width?: PointS, color?: ColorRef, linecap?: number, join?: number) {\n super(\"pen\");\n if (reader != null) {\n style = reader.readUint16();\n this.style = style & 0xFF;\n this.width = new PointS(reader);\n this.color = new ColorRef(reader);\n this.linecap = (style & (Helper.GDI.PenStyle.PS_ENDCAP_SQUARE | Helper.GDI.PenStyle.PS_ENDCAP_FLAT));\n this.join = (style & (Helper.GDI.PenStyle.PS_JOIN_BEVEL | Helper.GDI.PenStyle.PS_JOIN_MITER));\n } else {\n this.style = style;\n this.width = width;\n this.color = color;\n this.linecap = linecap;\n this.join = join;\n }\n }\n\n public clone(): Pen {\n return new Pen(null, this.style, this.width.clone(), this.color.clone(), this.linecap, this.join);\n }\n\n public toString(): string {\n return \"{style: \" + this.style + \", width: \" + this.width.toString() + \", color: \" + this.color.toString()\n + \", linecap: \" + this.linecap + \", join: \" + this.join + \"}\";\n }\n}\n\nexport class PaletteEntry {\n public flag: number;\n public b: number;\n public g: number;\n public r: number;\n\n constructor(reader: Blob, copy?: PaletteEntry) {\n if (reader != null) {\n this.flag = reader.readUint8();\n this.b = reader.readUint8();\n this.g = reader.readUint8();\n this.r = reader.readUint8();\n } else {\n this.flag = copy.flag;\n this.b = copy.b;\n this.g = copy.g;\n this.r = copy.r;\n }\n }\n\n public clone(): PaletteEntry {\n return new PaletteEntry(null, this);\n }\n}\n\nexport class Palette extends Obj {\n public start: number;\n public entries: PaletteEntry[];\n\n constructor(reader: Blob, copy?: Palette) {\n super(\"palette\");\n if (reader != null) {\n this.start = reader.readUint16();\n let cnt = reader.readUint16();\n this.entries = [];\n while (cnt > 0) {\n this.entries.push(new PaletteEntry(reader));\n cnt--;\n }\n } else {\n this.start = copy.start;\n this.entries = [];\n const len = copy.entries.length;\n for (let i = 0; i < len; i++) {\n this.entries.push(copy.entries[i]);\n }\n }\n }\n\n public clone(): Palette {\n return new Palette(null, this);\n }\n\n public toString(): string {\n return \"{ #entries: \" + this.entries.length + \"}\"; // TODO\n }\n}\n","/*\n\nThe MIT License (MIT)\n\nCopyright (c) 2015 Thomas Bluemel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n\nimport { DIBitmap, PatternBitmap16 } from \"./Bitmap\";\nimport { Blob } from \"./Blob\";\nimport { GDIContext } from \"./GDIContext\";\nimport { Helper, WMFJSError } from \"./Helper\";\nimport { PointS, Rect } from \"./Primitives\";\nimport { Region } from \"./Region\";\nimport { Brush, ColorRef, Font, Palette, Pen } from \"./Style\";\n\nexport class WMFRecords {\n private _records: ((gdi: GDIContext) => void)[];\n\n constructor(reader: Blob, first: number) {\n this._records = [];\n\n let all = false;\n let curpos = first;\n main_loop: while (!all) {\n reader.seek(curpos);\n const size = reader.readUint32();\n if (size < 3) {\n throw new WMFJSError(\"Invalid record size\");\n }\n const type = reader.readUint16();\n switch (type) {\n case Helper.GDI.RecordType.META_EOF:\n all = true;\n break main_loop;\n case Helper.GDI.RecordType.META_SETMAPMODE: {\n const mapMode = reader.readUint16();\n this._records.push((gdi) => {\n gdi.setMapMode(mapMode);\n });\n break;\n }\n case Helper.GDI.RecordType.META_SETWINDOWORG: {\n const y = reader.readInt16();\n const x = reader.readInt16();\n this._records.push((gdi) => {\n gdi.setWindowOrg(x, y);\n });\n break;\n }\n case Helper.GDI.RecordType.META_SETWINDOWEXT: {\n const y = reader.readInt16();\n const x = reader.readInt16();\n this._records.push((gdi) => {\n gdi.setWindowExt(x, y);\n });\n break;\n }\n case Helper.GDI.RecordType.META_OFFSETWINDOWORG: {\n const offY = reader.readInt16();\n const offX = reader.readInt16();\n this._records.push((gdi) => {\n gdi.offsetWindowOrg(offX, offY);\n });\n break;\n }\n case Helper.GDI.RecordType.META_SETVIEWPORTORG: {\n const y = reader.readInt16();\n const x = reader.readInt16();\n this._records.push((gdi) => {\n gdi.setViewportOrg(x, y);\n });\n break;\n }\n case Helper.GDI.RecordType.META_SETVIEWPORTEXT: {\n const y = reader.readInt16();\n const x = reader.readInt16();\n this._records.push((gdi) => {\n gdi.setViewportExt(x, y);\n });\n break;\n }\n case Helper.GDI.RecordType.META_OFFSETVIEWPORTORG: {\n const offY = reader.readInt16();\n const offX = reader.readInt16();\n this._records.push((gdi) => {\n gdi.offsetViewportOrg(offX, offY);\n });\n break;\n }\n case Helper.GDI.RecordType.META_SAVEDC: {\n this._records.push((gdi) => {\n gdi.saveDC();\n });\n break;\n }\n case Helper.GDI.RecordType.META_RESTOREDC: {\n const saved = reader.readInt16();\n this._records.push((gdi) => {\n gdi.restoreDC(saved);\n });\n break;\n }\n case Helper.GDI.RecordType.META_SETSTRETCHBLTMODE: {\n const stretchMode = reader.readUint16();\n this._records.push((gdi) => {\n gdi.setStretchBltMode(stretchMode);\n });\n break;\n }\n case Helper.GDI.RecordType.META_DIBBITBLT: {\n const haveSrcDib = ((type >> 8) + 3 !== size);\n const rasterOp = reader.readUint16() | (reader.readUint16() << 16);\n const srcY = reader.readInt16();\n const srcX = reader.readInt16();\n if (!haveSrcDib) {\n // ignore reserved field\n reader.skip(2);\n }\n const height = reader.readInt16();\n const width = reader.readInt16();\n const destY = reader.readInt16();\n const destX = reader.readInt16();\n if (haveSrcDib) {\n const datalength = size * 2 - (reader.pos - curpos);\n const dib = new DIBitmap(reader, datalength);\n this._records.push((gdi) => {\n gdi.dibBits(srcX, srcY, destX, destY, width, height, rasterOp, dib);\n });\n }\n break;\n }\n case Helper.GDI.RecordType.META_DIBSTRETCHBLT: {\n const haveSrcDib = ((type >> 8) + 3 !== size);\n const rasterOp = reader.readUint16() | (reader.readUint16() << 16);\n const srcH = reader.readInt16();\n const srcW = reader.readInt16();\n const srcY = reader.readInt16();\n const srcX = reader.readInt16();\n const destH = reader.readInt16();\n const destW = reader.readInt16();\n const destY = reader.readInt16();\n const destX = reader.readInt16();\n const datalength = size * 2 - (reader.pos - curpos);\n const dib = new DIBitmap(reader, datalength);\n this._records.push((gdi) => {\n gdi.stretchDibBits(srcX, srcY, srcW, srcH, destX, destY, destW, destH, rasterOp, dib);\n });\n break;\n }\n case Helper.GDI.RecordType.META_STRETCHDIB: {\n const rasterOp = reader.readUint16() | (reader.readUint16() << 16);\n const colorUsage = reader.readInt16();\n const srcH = reader.readInt16();\n const srcW = reader.readInt16();\n const srcY = reader.readInt16();\n const srcX = reader.readInt16();\n const destH = reader.readInt16();\n const destW = reader.readInt16();\n const destY = reader.readInt16();\n const destX = reader.readInt16();\n const datalength = size * 2 - (reader.pos - curpos);\n const dib = new DIBitmap(reader, datalength);\n this._records.push((gdi) => {\n gdi.stretchDib(srcX, srcY, srcW, srcH, destX, destY, destW, destH, rasterOp, colorUsage, dib);\n });\n break;\n }\n case Helper.GDI.RecordType.META_ESCAPE: {\n const func = reader.readUint16();\n const count = reader.readUint16();\n const offset = reader.pos;\n const blob = new Blob(reader, offset);\n this._records.push((gdi) => {\n gdi.escape(func, blob, offset, count);\n });\n break;\n }\n case Helper.GDI.RecordType.META_SETTEXTALIGN: {\n const textAlign = reader.readUint16();\n this._records.push((gdi) => {\n gdi.setTextAlign(textAlign);\n });\n break;\n }\n case Helper.GDI.RecordType.META_SETBKMODE: {\n const bkMode = reader.readUint16();\n this._records.push((gdi) => {\n gdi.setBkMode(bkMode);\n });\n break;\n }\n case Helper.GDI.RecordType.META_SETTEXTCOLOR: {\n const textColor = new ColorRef(reader);\n this._records.push((gdi) => {\n gdi.setTextColor(textColor);\n });\n break;\n }\n case Helper.GDI.RecordType.META_SETBKCOLOR: {\n const bkColor = new ColorRef(reader);\n this._records.push((gdi) => {\n gdi.setBkColor(bkColor);\n });\n break;\n }\n case Helper.GDI.RecordType.META_CREATEBRUSHINDIRECT: {\n const datalength = size * 2 - (reader.pos - curpos);\n const brush = new Brush(reader, datalength, false);\n this._records.push((gdi) => {\n gdi.createBrush(brush);\n });\n break;\n }\n case Helper.GDI.RecordType.META_DIBCREATEPATTERNBRUSH: {\n const datalength = size * 2 - (reader.pos - curpos);\n const brush = new Brush(reader, datalength, true);\n this._records.push((gdi) => {\n gdi.createBrush(brush);\n });\n break;\n }\n case Helper.GDI.RecordType.META_CREATEPENINDIRECT: {\n const pen = new Pen(reader);\n this._records.push((gdi) => {\n gdi.createPen(pen);\n });\n break;\n }\n case Helper.GDI.RecordType.META_CREATEFONTINDIRECT: {\n const datalength = size * 2 - (reader.pos - curpos);\n const font = new Font(reader, datalength);\n this._records.push((gdi) => {\n gdi.createFont(font);\n });\n break;\n }\n case Helper.GDI.RecordType.META_SELECTOBJECT: {\n const idx = reader.readUint16();\n this._records.push((gdi) => {\n gdi.selectObject(idx, null);\n });\n break;\n }\n case Helper.GDI.RecordType.META_SELECTPALETTE: {\n const idx = reader.readUint16();\n this._records.push((gdi) => {\n gdi.selectObject(idx, \"palette\");\n });\n break;\n }\n case Helper.GDI.RecordType.META_SELECTCLIPREGION: {\n const idx = reader.readUint16();\n this._records.push((gdi) => {\n gdi.selectObject(idx, \"region\");\n });\n break;\n }\n case Helper.GDI.RecordType.META_DELETEOBJECT: {\n const idx = reader.readUint16();\n this._records.push((gdi) => {\n gdi.deleteObject(idx);\n });\n break;\n }\n case Helper.GDI.RecordType.META_RECTANGLE: {\n const rect = new Rect(reader);\n this._records.push((gdi) => {\n gdi.rectangle(rect, 0, 0);\n });\n break;\n }\n case Helper.GDI.RecordType.META_ROUNDRECT: {\n const rh = reader.readInt16();\n const rw = reader.readInt16();\n const rect = new Rect(reader);\n this._records.push((gdi) => {\n gdi.rectangle(rect, rw, rh);\n });\n break;\n }\n case Helper.GDI.RecordType.META_LINETO: {\n const y = reader.readInt16();\n const x = reader.readInt16();\n this._records.push((gdi) => {\n gdi.lineTo(x, y);\n });\n break;\n }\n case Helper.GDI.RecordType.META_MOVETO: {\n const y = reader.readInt16();\n const x = reader.readInt16();\n this._records.push((gdi) => {\n gdi.moveTo(x, y);\n });\n break;\n }\n case Helper.GDI.RecordType.META_TEXTOUT: {\n const len = reader.readInt16();\n if (len > 0) {\n const text = reader.readString(len);\n reader.skip(len % 2);\n const y = reader.readInt16();\n const x = reader.readInt16();\n this._records.push((gdi) => {\n gdi.textOut(x, y, text);\n });\n }\n break;\n }\n case Helper.GDI.RecordType.META_EXTTEXTOUT: {\n const y = reader.readInt16();\n const x = reader.readInt16();\n const len = reader.readInt16();\n const fwOpts = reader.readUint16();\n\n let hasRect = null;\n let hasDx = null;\n if (size * 2 === 14 + len + len % 2) {\n hasRect = false;\n hasDx = false;\n }\n if (size * 2 === 14 + 8 + len + len % 2) {\n hasRect = true;\n hasDx = false;\n }\n if (size * 2 === 14 + len + len % 2 + len * 2) {\n hasRect = false;\n hasDx = true;\n }\n if (size * 2 === 14 + 8 + len + len % 2 + len * 2) {\n hasRect = true;\n hasDx = true;\n }\n\n const rect = hasRect ? new Rect(reader) : null;\n if (len > 0) {\n const text = reader.readString(len);\n reader.skip(len % 2);\n\n const dx: number[] = [];\n if (hasDx) {\n for (let i = 0; i < text.length; i++) {\n dx.push(reader.readInt16());\n }\n }\n\n this._records.push((gdi) => {\n gdi.extTextOut(x, y, text, fwOpts, rect, dx);\n });\n }\n break;\n }\n case Helper.GDI.RecordType.META_EXCLUDECLIPRECT: {\n const rect = new Rect(reader);\n this._records.push((gdi) => {\n gdi.excludeClipRect(rect);\n });\n break;\n }\n case Helper.GDI.RecordType.META_INTERSECTCLIPRECT: {\n const rect = new Rect(reader);\n this._records.push((gdi) => {\n gdi.intersectClipRect(rect);\n });\n break;\n }\n case Helper.GDI.RecordType.META_POLYGON: {\n let cnt = reader.readInt16();\n const points: PointS[] = [];\n while (cnt > 0) {\n points.push(new PointS(reader));\n cnt--;\n }\n this._records.push((gdi) => {\n gdi.polygon(points, true);\n });\n break;\n }\n case Helper.GDI.RecordType.META_SETPOLYFILLMODE: {\n const polyfillmode = reader.readUint16();\n this._records.push((gdi) => {\n gdi.setPolyFillMode(polyfillmode);\n });\n break;\n }\n case Helper.GDI.RecordType.META_POLYPOLYGON: {\n const cnt = reader.readUint16();\n const polygonsPtCnts = [];\n for (let i = 0; i < cnt; i++) {\n polygonsPtCnts.push(reader.readUint16());\n }\n\n const polygons: PointS[][] = [];\n for (let i = 0; i < cnt; i++) {\n const ptCnt = polygonsPtCnts[i];\n\n const p = [];\n for (let ip = 0; ip < ptCnt; ip++) {\n p.push(new PointS(reader));\n }\n polygons.push(p);\n }\n this._records.push((gdi) => {\n gdi.polyPolygon(polygons);\n });\n break;\n }\n case Helper.GDI.RecordType.META_POLYLINE: {\n let cnt = reader.readInt16();\n const points: PointS[] = [];\n while (cnt > 0) {\n points.push(new PointS(reader));\n cnt--;\n }\n this._records.push((gdi) => {\n gdi.polyline(points);\n });\n break;\n }\n case Helper.GDI.RecordType.META_ELLIPSE: {\n const rect = new Rect(reader);\n this._records.push((gdi) => {\n gdi.ellipse(rect);\n });\n break;\n }\n case Helper.GDI.RecordType.META_CREATEPALETTE: {\n const palette = new Palette(reader);\n this._records.push((gdi) => {\n gdi.createPalette(palette);\n });\n break;\n }\n case Helper.GDI.RecordType.META_CREATEREGION: {\n const region = new Region(reader);\n this._records.push((gdi) => {\n gdi.createRegion(region);\n });\n break;\n }\n case Helper.GDI.RecordType.META_CREATEPATTERNBRUSH: {\n const datalength = size * 2 - (reader.pos - curpos);\n const patternBitmap = new PatternBitmap16(reader, datalength);\n const brush = new Brush(reader, datalength, patternBitmap);\n this._records.push((gdi) => {\n gdi.createPatternBrush(brush);\n });\n break;\n }\n case Helper.GDI.RecordType.META_OFFSETCLIPRGN: {\n const offY = reader.readInt16();\n const offX = reader.readInt16();\n this._records.push((gdi) => {\n gdi.offsetClipRgn(offX, offY);\n });\n break;\n }\n case Helper.GDI.RecordType.META_REALIZEPALETTE:\n case Helper.GDI.RecordType.META_SETPALENTRIES:\n case Helper.GDI.RecordType.META_SETROP2:\n case Helper.GDI.RecordType.META_SETRELABS:\n case Helper.GDI.RecordType.META_SETTEXTCHAREXTRA:\n case Helper.GDI.RecordType.META_RESIZEPALETTE:\n case Helper.GDI.RecordType.META_SETLAYOUT:\n case Helper.GDI.RecordType.META_FILLREGION:\n case Helper.GDI.RecordType.META_SETMAPPERFLAGS:\n case Helper.GDI.RecordType.META_SETTEXTJUSTIFICATION:\n case Helper.GDI.RecordType.META_SCALEWINDOWEXT:\n case Helper.GDI.RecordType.META_SCALEVIEWPORTEXT:\n case Helper.GDI.RecordType.META_FLOODFILL:\n case Helper.GDI.RecordType.META_FRAMEREGION:\n case Helper.GDI.RecordType.META_ANIMATEPALETTE:\n case Helper.GDI.RecordType.META_EXTFLOODFILL:\n case Helper.GDI.RecordType.META_SETPIXEL:\n case Helper.GDI.RecordType.META_PATBLT:\n case Helper.GDI.RecordType.META_PIE:\n case Helper.GDI.RecordType.META_STRETCHBLT:\n case Helper.GDI.RecordType.META_INVERTREGION:\n case Helper.GDI.RecordType.META_PAINTREGION:\n case Helper.GDI.RecordType.META_ARC:\n case Helper.GDI.RecordType.META_CHORD:\n case Helper.GDI.RecordType.META_BITBLT:\n case Helper.GDI.RecordType.META_SETDIBTODEV:\n default: {\n let recordName = \"UNKNOWN\";\n for (const name in Helper.GDI.RecordType) {\n const recordTypes: any = Helper.GDI.RecordType;\n if (recordTypes[name] === type) {\n recordName = name;\n break;\n }\n }\n Helper.log(\"[WMF] \" + recordName + \" record (0x\" + type.toString(16) + \") at offset 0x\"\n + curpos.toString(16) + \" with \" + (size * 2) + \" bytes\");\n break;\n }\n }\n\n curpos += size * 2;\n }\n\n if (!all) {\n throw new WMFJSError(\"Could not read all records\");\n }\n }\n\n public play(gdi: GDIContext): void {\n const len = this._records.length;\n for (let i = 0; i < len; i++) {\n this._records[i](gdi);\n }\n }\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/*\n\nThe MIT License (MIT)\n\nCopyright (c) 2015 Thomas Bluemel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n\nexport { Renderer, IRendererSettings } from \"./Renderer\";\nexport { WMFJSError as Error, loggingEnabled } from \"./Helper\";\n"],"names":[],"sourceRoot":""}