chore(og-image): force twemoji for emoji util
This commit is contained in:
parent
c97fd7089a
commit
3c8ccde624
2 changed files with 10 additions and 41 deletions
|
@ -29,15 +29,12 @@ async function generateSocialImage(
|
|||
width,
|
||||
height,
|
||||
fonts,
|
||||
// `code` will be the detected language code, `emoji` if it's an Emoji, or `unknown` if not able to tell.
|
||||
// `segment` will be the content to render.
|
||||
loadAdditionalAsset: async (code: string, segment: string) => {
|
||||
if (code === "emoji") {
|
||||
// if segment is an emoji, load the image.
|
||||
return `data:image/svg+xml;base64,${btoa(await loadEmoji("twemoji", getIconCode(segment)))}`
|
||||
loadAdditionalAsset: async (languageCode: string, segment: string) => {
|
||||
if (languageCode === "emoji") {
|
||||
return `data:image/svg+xml;base64,${btoa(await loadEmoji(getIconCode(segment)))}`
|
||||
}
|
||||
// if segment is normal text
|
||||
return code
|
||||
|
||||
return languageCode
|
||||
},
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue