-
Notifications
You must be signed in to change notification settings - Fork 793
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix writing svg to file including emojis #3015
Conversation
Now all tests pass and the issue raised in OP of #3002 is fixed. I still have the same error in Github Actions as was raised here #3002 (comment):
But for me locally all docs are created fine. I think that this is a different issue. VlConvert seems to work fine: import vl_convert as vlc
from IPython.display import Image, SVG, display
vl_spec = '''
{
"data": {"values": [{}]},
"mark": {"type": "text", "size": 50, "text": "🐄"},
"$schema": "https://vega.github.io/schema/vega-lite/v5.6.1.json"
}
'''
# compile spec
png_data = vlc.vegalite_to_png(vl_spec=vl_spec)
svg_data = vlc.vegalite_to_svg(vl_spec=vl_spec)
# display as (top) SVG & (bottom) PNG
display(SVG(svg_data))
display(Image(png_data)) |
Merging this. |
If the png conversion works locally but not on CI then I would expect it's a difference in what system fonts are available |
That feels like a sensible explanation. Thanks for the quick prompt @jonmmease! |
Fix #3002
Isolated the issue:
The fix introduced behave as follows:
So the SVG str is written as encoded utf-8 byte-string.
Edit:
Tests failing. Should not save as utf-8 byte string, make sure it is writing in utf-8 str: