[reportlab-users] ttfont checksum fails
Tim Roberts
timr at probo.com
Wed Dec 27 13:46:37 EST 2006
matt-lists at comnet.net.nz wrote:
> I'm in the middle of putting together a function in an application I maintain
> to create reports in pdf format. The application has been translated into a
> number of different languages, and so I need to generate a report using a
> font that has good non-latin character support. At the moment, I've chosen
> verdana.
> ...
> to register the font with reportlab (config_directory is a variable holding
> the path to the directory where the verdana fonts I want to use are held).
> However, on executing this code, I'm getting the following error:
>
> Traceback (most recent call last):
> ... File "/usr/lib/python2.4/site-packages/reportlab/pdfbase/ttfonts.py", line
> 309, in checksumFile
> raise TTFError('TTF file "%s": invalid checksum %s len: %d &3: %d' %
> (self.filename,hex32(checkSum),len(self._ttf_data),(len(self._ttf_data)&3)))
> reportlab.pdfbase.ttfonts.TTFError: TTF
> file "/home/matt/.superkaramba/lwp/verdana.ttf": invalid checksum 0XBBB0AFBA
> len: 149753 &3: 1
>
> It appears that the checksum is failing.
Verdana isn't part of Linux, so you must have copied it from a Windows
system. Is it possible that you copied the font to your Linux system
using FTP without using binary mode? My Windows verdana.ttf is 171,792
bytes long.
--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the reportlab-users
mailing list