[reportlab-users] registering font does not work after switching media server

Andy Robinson andy at reportlab.com
Thu Mar 25 07:18:07 EDT 2010


On 25 March 2010 11:00, Thomas Kremmel <thomasspin at gmail.com> wrote:

> Hi,

> I m developing a django app using reportlab. Till now I just used the django

> development server to serve all media files, including some ttf fonts to be

> registered by reportlab. I do it like this:

> pdfmetrics.registerFont(TTFont('Calibri', settings.MEDIA_URL +

> 'fonts/calibri.ttf'))

> That worked fine till I switched from the django development server to

> apache production server. Now I'm getting the error:


I never even realised we could load fonts from URLs! I guess we're
doing some transformation on the URLs.

Is your production MEDIA_URL relative, or on some other domain
("http://media.mydomain.com/fonts") ?

Also, out of curiosity, if the fonts are on the same box, why don't
you load them from the file system to save all the HTTP negotiation?

- Andy


More information about the reportlab-users mailing list