Open reggi opened 1 month ago
I have a command here:
convert -background white -font "/System/Library/Fonts/Supplemental/Comic Sans MS.ttf" -pointsize 30 label:meow png:- | identify -format "%w" - 77
For some reason this just hangs:
#!/usr/bin/env -S deno run --allow-all import $ from "@david/dax"; // "dax-sh" in Node async function getImageWidth(opts: { font: string; fontSize: number; text: string; trim?: boolean; }) { const { font, fontSize, text, trim } = opts; const shouldTrim = trim ? "-trim" : ""; return await $`convert -background white -font ${font} -pointsize ${fontSize} label:${text} ${shouldTrim} png:- | identify -format "%w" -`.text(); } console.log( await getImageWidth({ font: "/System/Library/Fonts/Supplemental/Comic Sans MS.ttf", fontSize: 30, text: "meow", }) );
I have a command here:
For some reason this just hangs: