sveltekit-og icon indicating copy to clipboard operation
sveltekit-og copied to clipboard

upgrading from 2.0.2 to 3.0.0 results in loss of rendering of emojis

Open rbozan opened this issue 1 year ago • 4 comments

Using 2.0.2 emojis render properly, but 3.0.0 does not render emojis anymore and renders them as square blocks.

Can be as simple as:

<div tw="flex flex-col w-full h-full items-center justify-center bg-purple-50">
😳
</div>
	return await ImageResponse(htmlTemplate, {
		width: 1200,
		height: 630,
		fonts: [
			{
				name: 'Lexend',
				data: await (
					await fetch(
						'https://github.com/googlefonts/lexend/raw/main/fonts/lexend/ttf/Lexend-Bold.ttf'
					)
				).arrayBuffer(),
				weight: 700
			},

			{
				name: 'Lexend',
				data: await (
					await fetch(
						'https://github.com/googlefonts/lexend/raw/main/fonts/lexend/ttf/Lexend-Medium.ttf'
					)
				).arrayBuffer(),
				weight: 500
			}
		]
	});

rbozan avatar Mar 19 '24 20:03 rbozan

Attach a screenshot please.

theetherGit avatar Mar 20 '24 18:03 theetherGit

Seeing the same behavior. Generated image with 2.0.2: 2 0 2

Generated image with 3.0.0 (unchanged code): 3 0 0

Let me know if I can support you in any way.

brennerm avatar Mar 27 '24 17:03 brennerm

Ok, If you wanna contribute please do that.

theetherGit avatar Mar 28 '24 13:03 theetherGit

graphemeImages are missing and basically you can not pass them even though they are mentioned in the types of this package. Anyways, even after adding the graphemeImages, they render in SVG but when converting them to PNG they seem to be gone (at least the remote ones)

rbozan avatar Jul 15 '24 12:07 rbozan