mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
wip
This commit is contained in:
parent
b2a6a87b10
commit
0e02366dee
37 changed files with 1095 additions and 596 deletions
|
@ -1,5 +1,6 @@
|
|||
import { exportToCanvas } from "./scene/export";
|
||||
import { getDefaultAppState } from "./appState";
|
||||
import { COLOR_WHITE } from "./constants";
|
||||
|
||||
const { registerFont, createCanvas } = require("canvas");
|
||||
|
||||
|
@ -57,22 +58,21 @@ const elements = [
|
|||
registerFont("./public/Virgil.woff2", { family: "Virgil" });
|
||||
registerFont("./public/Cascadia.woff2", { family: "Cascadia" });
|
||||
|
||||
const canvas = exportToCanvas(
|
||||
elements as any,
|
||||
{
|
||||
...getDefaultAppState(),
|
||||
offsetTop: 0,
|
||||
offsetLeft: 0,
|
||||
width: 0,
|
||||
height: 0,
|
||||
const canvas = exportToCanvas({
|
||||
data: {
|
||||
elements: elements as any,
|
||||
appState: {
|
||||
...getDefaultAppState(),
|
||||
width: 0,
|
||||
height: 0,
|
||||
},
|
||||
files: {}, // files
|
||||
},
|
||||
{}, // files
|
||||
{
|
||||
exportBackground: true,
|
||||
viewBackgroundColor: "#ffffff",
|
||||
config: {
|
||||
canvasBackgroundColor: COLOR_WHITE,
|
||||
createCanvas,
|
||||
},
|
||||
createCanvas,
|
||||
);
|
||||
});
|
||||
|
||||
const fs = require("fs");
|
||||
const out = fs.createWriteStream("test.png");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue