getSVG = (config = {}) => {
let {
width = 64,
height = 512,
title = "南無阿弥陀仏",
publisher = "岩波書店",
fontFamily = "YuMincho"
} = config;
const svg = d3.create("svg").attr("width", width).attr("height", height);
svg
.append("rect")
.attr("width", width)
.attr("height", height)
.attr("fill", "hsla(0,0%,97.5%,1)");
svg
.append("text")
.attr("x", width / 2)
.attr("y", height * 0.05)
.attr("text-anchor", "start")
.attr("font-family", fontFamily)
.attr("font-size", `40px`)
.style("writing-mode", "vertical-rl")
.text(title);
svg
.append("text")
.attr("x", width / 2)
.attr("y", height * 0.95)
.attr("text-anchor", "end")
.attr("font-family", fontFamily)
.attr("font-size", `18px`)
.style("writing-mode", "vertical-rl")
.text(publisher);
return svg.node();
}