[reportlab-users] Verdana and TTF error

Andy Robinson reportlab-users@reportlab.com
Tue, 4 May 2004 17:32:29 +0100


> as was suggested earlier in the list I installed the VERDANA.TTF file on 
> my Linux box. The file is found, but when I try to register the font 
> like this
> 
>      pdfmetrics.registerFont(TTFont('Verdana', 'VERDANA.TTF'))
> 
> I get an error message (please find it below).
> 
> What is wrong with the font?

OK, I think this was a bug in our last version.  Somebody
had already put in some declarations about common font names
(including Verdana) to say which files to use for bold, italic 
etc, which prevented the name verdana from being registered.
Are you using 1.19?  If so, you should get a daily snapshot
or CVS copy since we removed it two months ago.  Or, if you feel brave, 
go into  reportlab/pdfbase/_fontdata.py

and look for some code like this:

standardFontAttributes = {
    #family, bold, italic defined for basic ones
    'Courier':('Courier',0,0),
    'Courier-Bold':('Courier',1,0),
    'Courier-Oblique':('Courier',0,1),
    'Courier-BoldOblique':('Courier',1,1),
    
    'Helvetica':('Helvetica',0,0),
    'Helvetica-Bold':('Helvetica',1,0),
    'Helvetica-Oblique':('Helvetica',0,1),
    'Helvetica-BoldOblique':('Helvetica',1,1),

    'Times-Roman':('Times-Roman',0,0),
    'Times-Bold':('Times-Roman',1,0),
    'Times-Italic':('Times-Roman',0,1),
    'Times-BoldItalic':('Times-Roman',1,1),

    'Symbol':('Symbol',0,0),
    'ZapfDingbats':('ZapfDingbats',0,0)

    }

Delete all the extra fonts ('verdana') except the above 
ones :-)

- Andy