diff --git a/README.md b/README.md index 3293a0cdd..18e337c82 100644 --- a/README.md +++ b/README.md @@ -145,7 +145,7 @@ one, please see [./d2renderers/d2fonts](./d2renderers/d2fonts). ## Export file types -D2 currently supports SVG exports. More coming soon. +D2 currently supports SVG and PNG exports. More coming soon. ## Language tooling @@ -209,6 +209,7 @@ let us know and we'll be happy to include it here! - **Emacs extension**: [https://github.com/andorsk/d2-mode](https://github.com/andorsk/d2-mode) - **Telegram bot**: [https://github.com/meinside/telegram-d2-bot](https://github.com/meinside/telegram-d2-bot) - **Postgres importer**: [https://github.com/zekenie/d2-erd-from-postgres](https://github.com/zekenie/d2-erd-from-postgres) +- **Structurizr to D2 exporter**: [https://github.com/goto1134/structurizr-d2-exporter](https://github.com/goto1134/structurizr-d2-exporter) ### Misc diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md index 28e0ab2af..f3697a1b2 100644 --- a/ci/release/changelogs/next.md +++ b/ci/release/changelogs/next.md @@ -9,6 +9,7 @@ - `d2 fmt` now preserves leading comment spacing. [#400](https://github.com/terrastruct/d2/issues/400) - Markdown can now be styled with keywords stroke and fill. [https://github.com/terrastruct/d2/pull/460](https://github.com/terrastruct/d2/pull/460) +- PNG export resolution increased by 2x to not be blurry exporting on retina displays. [https://github.com/terrastruct/d2/pull/445](https://github.com/terrastruct/d2/pull/445) #### Bugfixes ⛑️ diff --git a/lib/png/generate_png.js b/lib/png/generate_png.js index 133cadba8..8c1c40806 100644 --- a/lib/png/generate_png.js +++ b/lib/png/generate_png.js @@ -11,8 +11,8 @@ async (imgString) => { }; const img = await loadImage(); const canvas = document.createElement("canvas"); - canvas.width = img.width; - canvas.height = img.height; + canvas.width = img.width * 2; + canvas.height = img.height * 2; const ctx = canvas.getContext("2d"); if (!ctx) { return new Error("could not get canvas context");