Elderl23 / pyfpdf

Automatically exported from code.google.com/p/pyfpdf
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Font does not have cmap for Unicode #37

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Install pyfpdf <= 1.7.1
2. Copy DroidSansFallback.ttf to font folder
3. Start unifonts.py test

What is the expected output? What do you see instead?

Expected: PDF with DroidSans glyphs
Got: RuntimeError: Font (../fpdf/font/DroidSansFallback.ttf) does not have cmap 
for Unicode (platform 3, encoding 1, format 4, or platform 0, any encoding, 
format 4)

Please use labels and text to provide additional information.

This font contain only one cmap table with Platform=3, Encoding=10, Format=12 
which unsupported by now. 

http://partners.adobe.com/public/developer/opentype/index_cmap.html

This patch add preliminary format 12 support.

Original issue reported on code.google.com by romiq...@gmail.com on 2 Jan 2013 at 7:48

Attachments:

GoogleCodeExporter commented 8 years ago
DroidSansFalback.ttf font can be obtained here 
https://android-review.googlesource.com/#/c/5401/

Or in most linux repos (ttf-droid or something like)

Original comment by romiq...@gmail.com on 2 Jan 2013 at 7:54

GoogleCodeExporter commented 8 years ago
Great Job!

Just an small correction at line 112 of the diff: should raise("...") be 
die("...)?

Let us know when this is merged so we can test it ;-)

Original comment by reingart@gmail.com on 2 Jan 2013 at 9:31

GoogleCodeExporter commented 8 years ago
This is new version. Now with test (charmap.py) - test first 999 glyphs in file.

Can i merge this?

Original comment by romiq...@gmail.com on 8 Jan 2013 at 10:36

Attachments:

GoogleCodeExporter commented 8 years ago
Yes, you can commit, te patch looks very nice. 
thanks you very much for you collaboration

Original comment by reingart@gmail.com on 8 Jan 2013 at 4:29

GoogleCodeExporter commented 8 years ago
Fixed in rev 8f51be973de5

Original comment by romiq...@gmail.com on 8 Jan 2013 at 5:21