JuliaGraphics / Luxor.jl

Simple drawings using vector graphics; Cairo "for tourists!"
http://juliagraphics.github.io/Luxor.jl/
Other
586 stars 71 forks source link

Cairo.jl (and hence Luxor.jl) doesn't support emoji currently. šŸ˜¢ #319

Open rayegun opened 1 week ago

rayegun commented 1 week ago

Hey, is there any chance this could be fixed? I use Luxor.jl for generating our YouTube thumbnails (with Cormullion's backgrounds), and lack of emoji support makes it difficult for some talks who naughtily included emojis in their titles!

cormullion commented 1 week ago

A good question.

https://github.com/JuliaGraphics/Cairo.jl/issues/311

Perhaps if there was a text function that scanned input text for emoji characters and switched fontsā€¦. but youā€™d also have to extract the widths of the emoji glyphs, which might involve Freetype. It could get tricky.

Typically in Cairo, text is one string/one fontface/one size, whereas in a terminal or browser the OS will rapidly switch between different fonts depending on which of the current active fonts can supply a valid glyph: on MacOS, emoji codes force a switch to AppleColorEmoji. ā€œfont fallbackā€ is cool.

I donā€™t think thereā€™s font fallback in Cairo - it would need to be written as a new method. The Makie folks donā€™t support emoji either, which suggests that itā€™s not trivial to do.

(I used to strip them from incoming text šŸ˜‚)