ttList-module problem

Just just at xs4all.nl
Tue Apr 29 07:16:13 EDT 2003


In article <mailman.1051609184.11588.python-list at python.org>,
 "Mehta, Anish" <Anish.Mehta at enst-bretagne.fr> wrote:

> Hello !
> 
> I am having some problem in understanding this code. Firstly i am not 
> finding TTFont which is being imported with the command
> 
> from fontTools.ttLib import TTFont
> 
> I have searched in the ttLib directory but i am unable to find TTFont so 
> that i can read about it. As far as i am getting is that this module is 
> taking input and then some information about      tags( ? ) and then 
> printing out the format in the form of checksum, length and offset. 
> Please elaborate this a bit more.
> 
> def ttList(input, output, options):
>         ttf = TTFont(input)
>         reader = ttf.reader
>         tags = reader.keys()
>         tags.sort()
>         print 'Listing table info for "%s":' % input
>         format = "    %4s  %10s  %7s  %7s"
>         print format % ("tag ", "  checksum", " length", " offset")
>         print format % ("----", "----------", "-------", "-------")
>         for tag in tags:
>                 entry = reader.tables[tag]
>                 checksum = "0x" + hex(entry.checkSum)[2:].zfill(8)
>                 print format % (tag, checksum, entry.length, entry.offset)
>         print
>         ttf.close()
> 
> 
> I'll be waiting for your response.

TTFont is in ttLib/__init__.py

Just




More information about the Python-list mailing list