[triangle-zpug] can't find font problem

Chris Calloway cbc at unc.edu
Mon Mar 31 17:58:45 CEST 2008


On 3/31/2008 8:19 AM, Joseph Mack NA3T wrote:
> I see. I'd assumed it was production-quality :-(

heh. demo code is probably never production quality. it is for demo. 
production quality requires details of your production environment. demo 
code almost always assumes you run from the demo path and have all you 
need in the demo path.

david is right about the current path. relative paths will be relative 
to your current path. you can get and set that with os.getcwd and 
os.chdir. the current path is usually where you started python.

> OK. good to know. I'd assumed there'd be a font directory 
> under python path somewhere.

the python path is for code. python uses your os for font management.

> (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)

that's what chkfontpath and fontconfig are for.

>> 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.

Canonical is as David said and then create a setup.py and use either the 
sdist option to create a source distribution or the bdist_egg option to 
create an egg. Both are zipped and ready for distribution/deployment.

http://trizpug.org/Members/cbc/distutils-online/
http://trizpug.org/Members/cbc/python-eggs-online/

-- 
Sincerely,

Chris Calloway
http://www.secoora.org
office: 332 Chapman Hall   phone: (919) 599-3530
mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599







More information about the TriZPUG mailing list