Skip to main content


Basic WASM bindings for resvg for Deno.


Take an SVG string and resolves with a typed array with the data encoded as a PNG.

import { render } from "";

const data = await render(`<?xml version="1.0" encoding="UTF-8"?>
<svg width="820px" height="312px" viewBox="0 0 820 312" version="1.1" xmlns="" xmlns:xlink="">
    <g id="testing" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <rect fill="#FFFFFF" x="0" y="0" width="820" height="312"></rect>
        <text id="test-text" font-family="sans-serif" font-size="32" font-weight="bold" fill="#111827">
            <tspan x="51" y="90">Testing Testing Testing</tspan>
        <text id="monospace" font-family="monospace" font-size="32" font-weight="normal" fill="#2D53A4">
            <tspan x="502" y="233">Monospace</tspan>

await Deno.writeFile("example.png", data);

Built-in fonts

Currently there are three fonts built into the WASM library, used for rendering text.

  • Bitter is the default and the serif font.
  • Inter is the sans-serif font.
  • JetBrains Mono is the monospace font.