pombreda / rst2pdf

Automatically exported from code.google.com/p/rst2pdf
Other
0 stars 0 forks source link

Fonts wrong for Chinese #501

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Write a text in Chinese, using UTF-8 encoding.
2. Run "rst2pdf chinesetext.rst".
3. Run "xpdf chinesetext.pdf"

What is the expected output?

The expected output would be a page with Chinese text.

What do you see instead?

I see a page with black squares for each Hanzi.

Please answer the following questions, they are *very* important:

* Version of rst2pdf?

0.16-2

* Version of reportlab?

2.5-1.1

* Are you using wordaxe, and if true, what version?

no

* Are you using rst2pdf with Sphinx, and if true, what version?

no

Please provide any additional information below.

LibreOffice on the same box can show the real Hanzi in the text, as well as 
rst2html. Overmore, rst2html gets the formatting (bold etc.) right, while for 
rst2pdf, I need a style sheet to see Hanzi at all, and formatting is always 
"plain" only.

Original issue reported on code.google.com by d...@tonimueller.org on 17 Jul 2013 at 7:39

GoogleCodeExporter commented 9 years ago
There is a basic difference in how fonts work on LibreOffice and HTML and how 
they work in PDFs:

In PDFs the font has to be embedded on the file itself, while both LibreOffice 
and web browsers can just search your system for the best matching font and use 
that.

As for the formatting, it could be your font doesn't have the required variants?
Rst2pdf will *not* try to create italic/bold variants from the regular font, it 
requires you to provide all variants.

For example, here is a blog post where the stylesheet uses msyhbd.ttf to 
provide the bold version of characters, while wqy-zenhei.ttf is used for the 
regular one:

http://www.typemylife.com/sphinx-restructuredtext-pdf-generation-with-rst2pdf/

Hope this helps!

Original comment by roberto.alsina on 17 Jul 2013 at 7:55