[reportlab-users] registering font does not work after switching media server
Thomas Kremmel
thomasspin at gmail.com
Thu Mar 25 07:31:44 EDT 2010
oh you are right.. thats certainly the problem and i just realized that on
the development server I'm loading it from the file system.
My URL that I m using for the production server is absolute, it looks like
this:
http://localhost/my_project/media/fonts/<http://localhost/aeon_infrastructure/media/fonts/>
calibri.ttf
Thus I try to load it from the file system. Actually its my first time
deploying a project on an apache server and I'm kind of confused :D
Now I'm wondering where apache is looking after it when I try to get it from
the file system. Obviously apache does not find the file, since I'm getting
a file not found error:
Tried it like this:
pdfmetrics.registerFont(TTFont('Calibri',
'my_project/media/fonts/calibri.ttf'))
or
pdfmetrics.registerFont(TTFont('Calibri-Bold',
'media/fonts/calibri-bold.ttf'))
But anyway, thats more a server question, than a reportlab question ;-)
Thanks guys for the prompt help.. and thanks for this amazing library!!
2010/3/25 Andy Robinson <andy at reportlab.com>
> 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
> _______________________________________________
> reportlab-users mailing list
> reportlab-users at lists2.reportlab.com
> http://two.pairlist.net/mailman/listinfo/reportlab-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20100325/7e650c5c/attachment.htm>
More information about the reportlab-users
mailing list