Closed mendhak closed 5 months ago
Tested on a freshly formatted Raspberry Pi Zero with Raspberry Pi OS lite. It was missing a cairo dependency so I've added an instruction for that.
It's funny that my version of inkscape worked ok -- it could be something to do with the build, alright. For what it's worth I am on Inkscape 0.92.4 (5da689c313, 2019-01-14)
, from Raspbian 10 (Buster). Anyway -- this looks great, I'll give it a go!
This worked pretty nicely for me; one thing is that I wanted to get it working with monochrome emoji, and that's a bit tricky on Raspbian 10.
I got it working by downloading the Noto Emoji TTFs from https://fonts.google.com/noto/specimen/Noto+Emoji , installing them to /usr/local/share/fonts/ :
ls -l /usr/local/share/fonts/
total 4312
-rw-r--r-- 1 root staff 877472 Apr 9 23:58 NotoEmoji-Bold.ttf
-rw-r--r-- 1 root staff 878928 Apr 9 23:58 NotoEmoji-Light.ttf
-rw-r--r-- 1 root staff 879128 Apr 9 23:58 NotoEmoji-Medium.ttf
-rw-r--r-- 1 root staff 878928 Apr 9 23:58 NotoEmoji-Regular.ttf
-rw-r--r-- 1 root staff 878980 Apr 9 23:58 NotoEmoji-SemiBold.ttf
then running:
sudo apt remove fonts-noto-color-emoji
It'd be nice if there was a way to override the font config files to avoid using the color emoji font, but I couldn't get it working without the uninstall.
Using the
emoji
library to escape emojis and surround them with a<tspan style="font-family:emoji">
. The reason this is needed is that cairo/inkscape don't appear to fallback on fonts, so this is the workaround - specifically tell it which font to use. Using the fallback font nameemoji
instead of a specific font name (like 'Noto Color Emoji') should serve as a system font I think.To allow the above
tspan
s, in all the templates I've removed the CDATA for calendars.Instead I'm now doing the XML safety escape in the Python.
Limitation: 'combined' fonts don't appear as one. For example, 👨🚀 astronaut will appear as 👨🚀