Compound/ZWJ-joined emoji
As far as I can tell, resvg doesn't render compound emojis:
Am I doing something wrong, or is it indeed not implemented (yet, ever)?
Related: https://github.com/linebender/resvg/pull/735
I do think it should work, it looks more like resvg wasn't able to find a font with the emoji on your system. Could you maybe send the SVG so I can try it?
<svg xmlns="http://www.w3.org/2000/svg" width="1500" height="600" viewBox="0 0 1500 600">
<text x="50" y="550" text-anchor="start" dominant-baseline="text-after-edge"
font-family="Nunito" fill="white"
style="filter:drop-shadow(0 3px 7px black)">
<tspan x="50" dy="-190" font-size="120px" font-weight="800">
Every Time ✅
</tspan>
<tspan x="50" dy="113" font-size="66px" font-weight="800">12:25</tspan>
<tspan x="50" dy="97" font-size="66px">London 🇬🇧</tspan>
</text>
</svg>
Font DB is passed in explicitly and initialised like this:
let mut fontdb = usvg::fontdb::Database::new();
fontdb.load_font_data(
include_bytes!("../fonts/apple_color_emoji/AppleColorEmoji.ttf").to_vec(),
);
fontdb.load_font_data(include_bytes!("../fonts/nunito/Nunito-Regular.ttf").to_vec());
fontdb.load_font_data(include_bytes!("../fonts/nunito/Nunito-ExtraBold.ttf").to_vec());
The first font comes from this repackaged font which, as far as I can tell, does include flags: https://github.com/samuelngs/apple-emoji-linux
If it doesn't reproduce I'm happy to add you to the repo
Hmm yeah, can reproduce.
The following does indeed not work:
<tspan x="50" dy="97" font-size="66px">London 🇬🇧</tspan>
but if I change it to just containing the flag it works:
<tspan x="50" dy="97" font-size="66px"> 🇬🇧</tspan>
usvg's font fallback logic has unfortunately never been great, it's a hard problem.