Tuesday, August 25, 2009

GIMP-Python: Adrian Likins’ Font to Brushes & Font to Image Hose Plugins

I found the two python plugins on Carol's GIMP site (now a dead link), but while editing the py files, I learned they were created by Adrian Likins. Apparently, they were for the Linux OS because when I installed them, they tossed a $HOST error (file or directory not found). I know absolutely zero about the Python language, and wasn't getting much help from anyone on the web, so I decided to find the solution myself. After reading through numerous pages of the Python Developer website, I learned (after hours of frustration, and a lead from Adrian) that the path function was conflicting because it's written for the Linux OS, and not Windows. 

My next step was in finding out what the correct Windows path function was (I didn't have a clue, so I tried them all, hahaha). None worked. I was just about to give the plugins up when something prompted me to revisit the Python Developer website and search for the WINDOWS path functions, something I had failed to do the night before. Not only did I find the correct path function, I learned why my Windows variable changes weren't working in the old string. They were deprecated! Gah! I may not know Python, but I do know "deprecated". 

Toiling around in GIMP scripts has taught me that progress comes with a price, strings and variables are eventually changed and we need to adapt to those changes. Anyway, a LONG story short, the plugins now work in GIMP 2.6.7, using Vista. Windows users are encouraged to download them at the Gimp Registry, here

One last reminder: when creating new brushes from fonts (webdings, zingbats, etc) save them LARGE in size, about 250px or so, then reduce the size in the Brush tool dialog when using them. This helps retain their crisp edges. Saving small font brush sizes will only get fuzzy when enlarged. Additional info: I emailed Tanda, who created a brilliant "Edit Brushes" Python script for GIMP, and he advised me to yet another method of resolving the path function. You don't need to make any changes to the modified scripts as they are now, this information is just an additional method of getting a Linux script to work in Windows. 

Tanda said to replace this function brushdir = "%s/.gimp-%s/brushes/" % (os.path.expandvars("$HOME"), get_gimp_version()) with brushdir = pdb.gimp_gimprc_query("brush-path-writable") I tried using the new function and it does work. Enjoy!

No comments:

Post a Comment

If you intend to comment to complain about being unable to perform certain steps with tutorials, please explain where you are in the step process and what step you are unable to get to work correctly, instead of saying something like, "I can't do this!". Your comments will help get tutorial corrections made and help give clarification to future viewers who may have trouble in the same locations. Thank you. :)