-
-
Notifications
You must be signed in to change notification settings - Fork 711
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
Unicode is broken #293
Comments
This bug report is funny on my browser: More seriously, the problem is not Unicode, it's the font you use to render your document. On OS X, the font used (probably the default one, if you didn't set one in the stylesheet) has the requested characters, but on Ubuntu the font used to render the document is a fallback font (as it is in my browser). You can set the font you want to use in the stylesheet, and your problem will be fixed. |
To be fair there is a bug here. When a font doesn’t have a requested character, per the CSS spec the rendering engine should try harder than we do to find some font that has it, and only use a fallback font as a last resort. However font selection is in the realm of Pango, so we likely can’t fix this short of rewriting all of WeasyPrint’s text and font handling to not use Pango. (Which unfortunately isn’t likely to happen any time soon.) |
@liZe: I added a font family in my stylesheet explicitly, and still see a similar issue. Platform: Centos release 6.8 (Final) |
@plahoti Could you please provide a short sample of HTML+CSS that doesn't work for you? |
@liZe: As it turns out, I did not have the specified font family installed in my environment. Post doing that, it worked like a charm. Apologies and thanks for your concern. |
Pango should do font fallback just fine, it might be that there was no fonts with Korean support installed on the system. Either that or something is seriously broken. |
Here's the only reliable source I've found about the links between FontConfig (used by Pango at least on UNIX-like platforms) and CSS2 font name fallback. I can't find any other information about this. |
I tried to convert html to pdf using below python code.
Below html code is passed
html
intohtml2pdf
functionBelow image is a screenshot shows unicode is broken.

I tested under Python 2.7.11 in Ubuntu 14.04.3 LTS (3.13.0-48-generic #80-Ubuntu SMP Thu Mar 12 11:16:15 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux) and upgraded packages to the latest version. However, in OS X, it properly works. I think this problem depends on some of required packages.
The text was updated successfully, but these errors were encountered: