diff --git a/README.md b/README.md index 7df2b50f..49357bbd 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ -# PDFKit +# Fork of PDFKit [![npm][npm_img]][npm_url] + +[npm_img]: https://img.shields.io/npm/v/@foliojs-fork/pdfkit.svg?colorB=0E7FBF +[npm_url]: https://www.npmjs.com/package/@foliojs-fork/pdfkit A JavaScript PDF generation library for Node and the browser. @@ -16,11 +19,17 @@ folder. You can also try out an interactive in-browser demo of PDFKit [here](http://pdfkit.org/demo/browser.html). +## Why fork? + +Because PDFKit require up-to-date these dependencies: +- [foliojs-fork/fontkit](https://github.com/foliojs-fork/fontkit) (see [Why fork?](https://github.com/foliojs-fork/fontkit#why-fork)) +- [foliojs-fork/linebreak](https://github.com/foliojs-fork/linebreak) (see [Why fork?](https://github.com/foliojs-fork/linebreak#why-fork)) + ## Installation Installation uses the [npm](http://npmjs.org/) package manager. Just type the following command after installing npm. - npm install pdfkit + npm install @foliojs-fork/pdfkit ## Features diff --git a/lib/font_factory.js b/lib/font_factory.js index cfb74367..a5772799 100644 --- a/lib/font_factory.js +++ b/lib/font_factory.js @@ -1,5 +1,5 @@ import fs from 'fs'; -import fontkit from 'fontkit'; +import fontkit from '@foliojs-fork/fontkit'; import StandardFont from './font/standard'; import EmbeddedFont from './font/embedded'; diff --git a/lib/line_wrapper.js b/lib/line_wrapper.js index b1e05a3e..0f70536b 100644 --- a/lib/line_wrapper.js +++ b/lib/line_wrapper.js @@ -1,5 +1,5 @@ import { EventEmitter } from 'events'; -import LineBreaker from 'linebreak'; +import LineBreaker from '@foliojs-fork/linebreak'; class LineWrapper extends EventEmitter { constructor(document, options) { diff --git a/package.json b/package.json index 6e2bf2f4..2335ca74 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "pdfkit", + "name": "@foliojs-fork/pdfkit", "description": "A PDF generation library for Node.js", "keywords": [ "pdf", @@ -19,9 +19,9 @@ "license": "MIT", "repository": { "type": "git", - "url": "https://github.com/foliojs/pdfkit.git" + "url": "https://github.com/foliojs-fork/pdfkit.git" }, - "bugs": "https://github.com/foliojs/pdfkit/issues", + "bugs": "https://github.com/foliojs-fork/pdfkit/issues", "devDependencies": { "@babel/core": "^7.11.6", "@babel/plugin-external-helpers": "^7.10.4", @@ -49,15 +49,14 @@ }, "dependencies": { "crypto-js": "^4.2.0", - "fontkit": "^1.8.1", - "linebreak": "^1.0.2", + "@foliojs-fork/fontkit": "^1.9.1", + "@foliojs-fork/linebreak": "^1.1.1", "png-js": "^1.0.0" }, "scripts": { "prepublishOnly": "npm run build", - "build": "rollup -c && browserify --standalone PDFDocument --ignore crypto --ignore iconv-lite js/pdfkit.js > js/pdfkit.standalone.js", - "browserify-example": "browserify examples/browserify/browser.js > examples/browserify/bundle.js", - "pdf-guide": "node docs/generate.js", + "build": "rollup -c", + "browserify-example": "browserify examples/browserify/browser.js > examples/browserify/bundle.js", "pdf-guide": "node docs/generate.js", "website": "node docs/generate_website.js", "publish-website": "node docs/publish_website.js", "docs": "npm run pdf-guide && npm run website && npm run browserify-example", diff --git a/rollup.config.js b/rollup.config.js index 54a194cb..bdbba908 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -6,9 +6,9 @@ const external = [ 'stream', 'fs', 'zlib', - 'fontkit', + '@foliojs-fork/fontkit', 'events', - 'linebreak', + '@foliojs-fork/linebreak', 'png-js', 'crypto-js', 'saslprep' diff --git a/yarn.lock b/yarn.lock index 95c548ac..58fa25f9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1222,6 +1222,36 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" +"@foliojs-fork/fontkit@^1.9.1": + version "1.9.1" + resolved "https://registry.yarnpkg.com/@foliojs-fork/fontkit/-/fontkit-1.9.1.tgz#8124649168eb5273f580f66697a139fb5041296b" + integrity sha512-U589voc2/ROnvx1CyH9aNzOQWJp127JGU1QAylXGQ7LoEAF6hMmahZLQ4eqAcgHUw+uyW4PjtCItq9qudPkK3A== + dependencies: + "@foliojs-fork/restructure" "^2.0.2" + brfs "^2.0.0" + brotli "^1.2.0" + browserify-optional "^1.0.1" + clone "^1.0.4" + deep-equal "^1.0.0" + dfa "^1.2.0" + tiny-inflate "^1.0.2" + unicode-properties "^1.2.2" + unicode-trie "^2.0.0" + +"@foliojs-fork/linebreak@^1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@foliojs-fork/linebreak/-/linebreak-1.1.1.tgz#93ecd695b7d2bb0334b9481058c3e610e019a4eb" + integrity sha512-pgY/+53GqGQI+mvDiyprvPWgkTlVBS8cxqee03ejm6gKAQNsR1tCYCIvN9FHy7otZajzMqCgPOgC4cHdt4JPig== + dependencies: + base64-js "1.3.1" + brfs "^2.0.2" + unicode-trie "^2.0.0" + +"@foliojs-fork/restructure@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@foliojs-fork/restructure/-/restructure-2.0.2.tgz#73759aba2aff1da87b7c4554e6839c70d43c92b4" + integrity sha512-59SgoZ3EXbkfSX7b63tsou/SDGzwUEK6MuB5sKqgVK1/XE0fxmpsOb9DQI8LXW3KfGnAjImCGhhEb7uPPAUVNA== + "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" @@ -2204,10 +2234,10 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= -base64-js@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-0.0.8.tgz#1101e9544f4a76b1bc3b26d452ca96d7a35e7978" - integrity sha1-EQHpVE9KdrG8OybUUsqW16NeeXg= +base64-js@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1" + integrity sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g== base64-js@^1.0.2, base64-js@^1.1.2: version "1.3.0" @@ -2357,7 +2387,7 @@ browserify-des@^1.0.0: inherits "^2.0.1" safe-buffer "^5.1.2" -browserify-optional@^1.0.0, browserify-optional@^1.0.1: +browserify-optional@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/browserify-optional/-/browserify-optional-1.0.1.tgz#1e13722cfde0d85f121676c2a72ced533a018869" integrity sha1-HhNyLP3g2F8SFnbCpyztUzoBiGk= @@ -3755,23 +3785,6 @@ flatted@^2.0.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.1.tgz#69e57caa8f0eacbc281d2e2cb458d46fdb449e08" integrity sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg== -fontkit@^1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/fontkit/-/fontkit-1.8.1.tgz#ae77485376f1096b45548bf6ced9a07af62a7846" - integrity sha512-BsNCjDoYRxmNWFdAuK1y9bQt+igIxGtTC9u/jSFjR9MKhmI00rP1fwSvERt+5ddE82544l0XH5mzXozQVUy2Tw== - dependencies: - babel-runtime "^6.26.0" - brfs "^2.0.0" - brotli "^1.2.0" - browserify-optional "^1.0.1" - clone "^1.0.4" - deep-equal "^1.0.0" - dfa "^1.2.0" - restructure "^0.5.3" - tiny-inflate "^1.0.2" - unicode-properties "^1.2.2" - unicode-trie "^0.3.0" - for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" @@ -5173,15 +5186,6 @@ levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" -linebreak@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/linebreak/-/linebreak-1.0.2.tgz#4b5781733e9a9eb2849dba2f963e47c887f8aa06" - integrity sha512-bJwSRsJeAmaZYnkcwl5sCQNfSDAhBuXxb6L27tb+qkBRtUQSSTUa5bcgCPD6hFEkRNlpWHfK7nFMmcANU7ZP1w== - dependencies: - base64-js "0.0.8" - brfs "^2.0.2" - unicode-trie "^1.0.0" - lines-and-columns@^1.1.6: version "1.2.4" resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" @@ -6403,13 +6407,6 @@ resolve@^1.20.0: path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" -restructure@^0.5.3: - version "0.5.4" - resolved "https://registry.yarnpkg.com/restructure/-/restructure-0.5.4.tgz#f54e7dd563590fb34fd6bf55876109aeccb28de8" - integrity sha1-9U591WNZD7NP1r9Vh2EJrsyyjeg= - dependencies: - browserify-optional "^1.0.0" - ret@~0.1.10: version "0.1.15" resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" @@ -7274,22 +7271,6 @@ unicode-property-aliases-ecmascript@^1.0.4: resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.5.tgz#a9cc6cc7ce63a0a3023fc99e341b94431d405a57" integrity sha512-L5RAqCfXqAwR3RriF8pM0lU0w4Ryf/GgzONwi6KnL1taJQa7x1TCxdJnILX59WIGOwR57IVxn7Nej0fz1Ny6fw== -unicode-trie@^0.3.0: - version "0.3.1" - resolved "https://registry.yarnpkg.com/unicode-trie/-/unicode-trie-0.3.1.tgz#d671dddd89101a08bac37b6a5161010602052085" - integrity sha1-1nHd3YkQGgi6w3tqUWEBBgIFIIU= - dependencies: - pako "^0.2.5" - tiny-inflate "^1.0.0" - -unicode-trie@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unicode-trie/-/unicode-trie-1.0.0.tgz#f649afdca127135edb55ca0ad7c8c60656d92ad1" - integrity sha512-v5raLKsobbFbWLMoX9+bChts/VhPPj3XpkNr/HbqkirXR1DPk8eo9IYKyvk0MQZFkaoRsFj2Rmaqgi2rfAZYtA== - dependencies: - pako "^0.2.5" - tiny-inflate "^1.0.0" - unicode-trie@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/unicode-trie/-/unicode-trie-2.0.0.tgz#8fd8845696e2e14a8b67d78fa9e0dd2cad62fec8"