SVG export (#598)
* first draft of export to SVG. WIP * enabled text rendeing - which is not quite right atm * placeholder svg icon * size the canvas based on the bounding box of elements * Do not add opacity attributes if default * render background rect * Ensure arrows are in the same SVG group * parse font-size from font * export web fonts * use fixed locations for fonts * Rename export functions * renamed export file * oops broke the icon.
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { getExportCanvasPreview } from "../src/scene/getExportCanvasPreview";
|
||||
import { exportToCanvas } from "./scene/export";
|
||||
|
||||
const { registerFont, createCanvas } = require("canvas");
|
||||
|
||||
@ -58,7 +58,7 @@ const elements = [
|
||||
|
||||
registerFont("./public/FG_Virgil.ttf", { family: "Virgil" });
|
||||
registerFont("./public/Cascadia.ttf", { family: "Cascadia" });
|
||||
const canvas = getExportCanvasPreview(
|
||||
const canvas = exportToCanvas(
|
||||
elements as any,
|
||||
{
|
||||
exportBackground: true,
|
||||
|
Reference in New Issue
Block a user