[reportlab-users] ttfont checksum fails

matt-lists at comnet.net.nz matt-lists at comnet.net.nz
Wed Dec 27 20:01:29 EST 2006


I got verdana from the webcore fonts which are available for linux. I've
compared the file size against the file size when downloaded from the web,
and they are the same at 149,752 - although that's different from the file
size you have. The font works fine when used elsewhere on the system.

Do you have any other suggestions?

Cheers

Matt

On Thursday 28 December 2006 07:46, Tim Roberts wrote:

> 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.



More information about the reportlab-users mailing list