-
Notifications
You must be signed in to change notification settings - Fork 690
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
Encoding warning: Prawn::Errors::IncompatibleStringEncoding, "Your document includes text that's not compatible with the Windows-1252 character set.\n If you need full UTF-8 support, use TTF fonts instead of PDF's built-in fonts" #1272
Comments
I'm open for suggestions. As far as the message goes, it's pretty straight-forward. PDF built-in fonts only support limited set of characters. It does not include umlauts. In order to have proper rendering of umlauts you need to supply your own font file. Refer to the Manual for how to use external fonts. |
Suggestion: |
Maybe the name of the font that resulted in the error should be mentioned, too? And maybe just leave out the Windows-1252 part because this is an internal detail that an ordinary Prawn user won't know. Also, since Prawn/ttfunk now supports OpenType fonts, it should probably read "... TTF/OTF font ...". |
Naming a font is probably not useful. I'm fairly confident this error occurs 90% with no font set, that is a default font (Times) used. Leaving out encoding may be an improvement. You're quite correct that it's a misdirection. Specifying TTF is not correct, that's true. But adding OTF doesn't quite fix it. As you noted, TTFunk supports a few font formats and TTF and OTF is not the full list. It's probably better to just mention "external font". |
(In my proposed message intentionally put encoding after "PDF's built-in font". I agree it's it is less useful information, but still relevant. If Prawn users don't know what a character enconding is... well they should!) |
Hey guys, any updates on this problem? I'm using Prawn 2.3, I get the same error even when I use a external font like this: error: |
The message might be a little misleading. Sometimes it means that your fonts have no glyphs for the text you're trying to render. As a way to debug this try adding Last Resort Font to your |
Could the error message be improved?
"use TTF fonts instead of PDF's built-in font" does not tell me that much. I had to google
and still have absolutely no idea what to do. I don't even understand why it writes
"instead of PDF's built-in font". What does this even mean? Does this mean prawn's
built in font or something?
I don't remember having had this issue years ago but now I have it. Has that behaviour
be changed? I have mostly german umlauts which I keep in UTF-8. In ruby all works
fine. This is a bit annoying that with prawn I now have to find out what to do - all is
in UTF-8 ... I don't even understand why I have to use windows-1252...
The text was updated successfully, but these errors were encountered: