[triangle-zpug] can't find font problem
Joseph Mack NA3T
jmack at wm7d.net
Mon Mar 31 14:19:26 CEST 2008
On Sun, 30 Mar 2008, David Handy wrote:
> In these examples, they are loading "arial.pil" from the current working
> directory, whatever that happens to be at the time the script is run. That
> is not production-quality code, it was simplified for demo purposes.
I see. I'd assumed it was production-quality :-(
> Typically, I put font files with my application.
OK. good to know. I'd assumed there'd be a font directory
under python path somewhere.
(I had a wierd error from freefont a while ago, which took
ages to track down. It was due to a bunch of fonts in
/usr/lib/fonts, which is where ghostscript used to look for
them. I had to remove that directory for the error to go
away. There's nothing in the freefont/freetype documentation
about looking outside its own font directories or in google
to handle the error. Why can't everyone agree on a single
directory for fonts for heaven's sake, or if they're going
to use a different directory, to ignore the places everyone
else puts their fonts. mutter, mutter)
> Any Python application more complicated than a single .py
> file I usually put into a Python package directory (a
> directory with an __init__.py file, see
> http://docs.python.org/tut/node8.html#SECTION008400000000000000000).
got it.
> I throw the fonts and other static data files in the same
> package directory as the .py files, and then use the
> technique I described in my previous email to locate the
> package directory, and load files relative to that
> directory.
will get on to it.
> I don't know if this is "canonical", but I've seen a lot
> of Python applications deployed this way. Using this
> technique, it is pretty easy to make your applications
> cross-platform compatible. Just zip up ApplicationHome and
> you've got something you can take to another machine and
> run.
Thanks. If the code looks normal to a python person that's
near enough to canonical for me.
Joe
--
Joseph Mack NA3T EME(B,D), FM05lw North Carolina
jmack (at) wm7d (dot) net - azimuthal equidistant map
generator at http://www.wm7d.net/azproj.shtml
Homepage http://www.austintek.com/ It's GNU/Linux!
More information about the TriZPUG
mailing list