Closed GoogleCodeExporter closed 9 years ago
Your problem appears to be the version of ttf2pt1 on your system. The version
included with DOMPDF is modified to support Unicode font metrics out of the
box. Did you compile from scratch or use a copy already on your system? You
would have to jump through some hoops to get the same out of the standard
executable
The modified version creates font metrics in both .afm and .ufm format. The UFM
format is required in order to render Unicode text correctly. Without it,
DOMPDF will fall back to Windows ANSI encoding.
If you are unable to compile from source then you might try the web-based font
prep tool:
http://eclecticgeek.com/dompdf/load_font.php
Original comment by eclecticgeek
on 25 Mar 2011 at 6:06
Original comment by eclecticgeek
on 25 Mar 2011 at 6:07
I uploaded Unicode-friendly Arial font files that I got from another source and
changed the font to Arial and it still didn't fix things.
Original comment by wbeau...@gmail.com
on 25 Mar 2011 at 6:13
It's not just the font that needs to be Unicode friendly. You also have to
process your font using ttf2ufm to get the Unicode font metrics (*.ufm) that
DOMPDF needs to process text that uses the font. Without the *.ufm files DOMPDF
will fall back to Windows ANSI encoding.
Original comment by eclecticgeek
on 25 Mar 2011 at 6:24
I know that. That's what I meant: the files I uploaded are .ufm files.
Original comment by wbeau...@gmail.com
on 25 Mar 2011 at 6:33
Ok. Just wanted to clarify that you were uploading all the necessary files.
So to review the requirements for working enabling Unicode support.
1) make sure the MBString PHP extension is enabled
2) set DOMPDF_UNICODE_ENABLED to true
3) install a Unicode font (ttf + ufm)
4) ensure your HTML document includes a meta header indicating the content
type, e.g. <meta http-equiv="Content-Type" content="charset=utf-8" />
You're ok on 2 & 3. What about 1 & 4?
Original comment by eclecticgeek
on 25 Mar 2011 at 7:43
Yes, all of those conditions are satisfied.
Original comment by wbeau...@gmail.com
on 25 Mar 2011 at 7:57
Can you post a sample of your HTML document and font files so we can try it out
on our systems?
Original comment by eclecticgeek
on 25 Mar 2011 at 8:37
[deleted comment]
Shows blank pdf =(
<html>
<head>
<meta http-equiv="Content-Type" content="charset=utf-8" />
<style>
body {
font-family: "DejaVu sans" /* unicode font from the box */
}
</style>
</head>
<body>
Я наконец-то did it!
</body>
</html>
Original comment by pavel.fr...@gmail.com
on 12 Jul 2012 at 8:31
@pavel.frankov which version of dompdf? This seems to render fine on my copy of
dompdf 0.6.0 beta 3 (the most recent). You might also check to see if you have
any PHP errors.
Original comment by eclecticgeek
on 12 Jul 2012 at 5:42
The latest one: 0.6.0 beta 3. No PHP errors.
Works fine for latin letters, but even one cyrillic letter is breaks everything.
When I've remove <meta http-equiv="Content-Type" content="charset=utf-8" /> it
works only for latin letters.
Original comment by pavel.fr...@gmail.com
on 12 Jul 2012 at 5:54
Are errors enabled? Seems you should get *some* kind of error if the characters
are being stripped. Also, can you post your PDF?
Original comment by eclecticgeek
on 13 Jul 2012 at 3:06
Here is screenshot from setup.php
http://speedcap.net/img/e63b6e397b5b9143d7f78497f866bf4f/7a660ded.png
PDF in attachment.
Original comment by pavel.fr...@gmail.com
on 13 Jul 2012 at 7:21
Attachments:
Hm, I've changed my WAMP from XAMPP to latest OpenServer and now all is ok.
Thank you!
Original comment by pavel.fr...@gmail.com
on 13 Jul 2012 at 9:42
Thanks for the update. I'll make a note of the issue. If we have a chance we'll
investigate further. Which version of XAMPP were you using?
Original comment by eclecticgeek
on 13 Jul 2012 at 5:15
XAMPP (Basispaket) version 1.7.4
Original comment by pavel.fr...@gmail.com
on 13 Jul 2012 at 5:20
I've fully reinstalled XAMPP and now all works fine. Thank you again!
Original comment by pavel.fr...@gmail.com
on 16 Jul 2012 at 5:14
Thanks for the update. Odd that a reinstall would have fixed the problem. Maybe
a missing library. At any rate, glad you got it working again.
Original comment by eclecticgeek
on 16 Jul 2012 at 5:00
Original comment by eclecticgeek
on 30 May 2013 at 5:15
Original issue reported on code.google.com by
wbeau...@gmail.com
on 24 Mar 2011 at 2:42