-
-
Notifications
You must be signed in to change notification settings - Fork 155
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
Cairosvg doesn't support unicode #72
Comments
It's probably a problem related to fonts, not unicode. CairoSVG doesn't automatically find fallback fonts when the default font misses some characters. Please try to set a font-family property (with a font with Chinese characters), it should work. |
Thanks, After try on another Ubuntu system, I think it's something related to fonts too, cause the svg is rend correctly on a desktop ubuntu, but would fail when on a ubuntu server edition environment. |
Servers typically don’t have many fonts installed (if any). Try installing some Chinese fonts on that server? |
Got the same issue. |
Installing fonts on your system should fix this issue. |
How to install, is there any document? |
It depends, what’s your OS? |
I hope to use it on both Mac and Windows. |
Oh, I thought that you had an obscure Linux distribution :D. You can install a font just you would normally do. On Windows, you can right-click on the font and choose "install for all users". On macOS, you can follow the official support page. |
I think I have installed many fonts in my Mac, here is my font book: Do I need more configuration? For example, how can I set the font that cairosvg uses? |
You have to use the |
Thank you! I solve the problem. Before generating the .svg file, I must set the font-family to a font which supports Chinese. Now I set the font-family to "Heiti SC Medium", and it can support Chinese. |
same issue,ubuntu server,how to install font? |
You can find some information on Internet about that, this is not a support forum. 😄 |
I have some Chinese characters in my svg file, just like:
when I use cairosvg to convert the svg to png, I got a result like bellow:
my svg file is encoding in
utf-8
format, is there any way to make Cairosvg convert unicode characters correctlly?The text was updated successfully, but these errors were encountered: