-
Notifications
You must be signed in to change notification settings - Fork 517
Open
Description
Greetings.
I advise to add function characterAsSvgDataUri.
function characterAsSvgDataUri(character) {
// An SVG string with a character.
const svgString = `
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
<text y=".9em" font-size="90">${character}</text>
</svg>
`;
// Encode the SVG string to base64.
const base64Svg = btoa(unescape(encodeURIComponent(svgString)));
// Return a data URL.
return `data:image/svg+xml;base64,${base64Svg}`;
}While this directive would set an image based on a given URI.
GM.notification(message, "π° Greasemonkey Newspaper", URI);This directive would set an image based on a given character.
GM.notification(message, "π° Greasemonkey Newspaper", "π΅");Currently, I utilize this directive.
GM.notification(message, "π° Greasemonkey Newspaper", characterAsSvgDataUri(graphics));Reference.
Metadata
Metadata
Assignees
Labels
No labels