bostrom/text-to-image

any support for emojis?

Closed this issue · 2 comments

any way to make it work with emojis?
I try to create sentences with emoji but the emoji appears with numeric codes inside a box

AFAIK emojis are just unicode characters, so as long as your selected font supports those characters, it's enough to just include the escaped unicode character

generate("Look ma' a rainbow! \u{1F308}", {});

Here's a live demo.

https://codesandbox.io/s/text-to-image-emoji-unicode-example-dzqpj

Currently there's no support for multiple fonts in text-to-image, so if your selected font doesn't support emojis, then you'll have to pick one that does, I'm afraid.

AFAIK emojis are just unicode characters, so as long as your selected font supports those characters, it's enough to just include the escaped unicode character

generate("Look ma' a rainbow! \u{1F308}", {});

Here's a live demo.

https://codesandbox.io/s/text-to-image-emoji-unicode-example-dzqpj

Currently there's no support for multiple fonts in text-to-image, so if your selected font doesn't support emojis, then you'll have to pick one that does, I'm afraid.

thank you very much for the quick reply.