Rotated Text

James Rea jim at provue.com
Wed Jun 11 09:33:40 PDT 2008


> All works well, except that the Test labels across the top take up  
> too much space. I can make them vertical, of course, but not with the  
> text rotated.
> I COULD make any array for the top, and use 26 picts for the letters,  
> rotated, and show the correct pict based on the data, but I would  
> prefer not to.
> 
> Any ideas to do this dynamically? Say, through applescript, or  
> something? There is an applescript hook into "Image Events" that can  
> rotate an image, but how do I generate an image of some text?

Here is a possible advanced technique you might investigate.

Last summer Panorama support was added for Perl, Ruby, Python and PHP.
At the time I did some research on these languages and the standard
libraries available for them. I was quite excited to discover that PHP
has a standard library, the GD extension, that can create images
dynamically, including rotated text.

Unfortunately, it turns out that Apple did not include the GD extension
in their version of PHP -- at least in Tiger. At the time, Leopard
wasn't out yet, and I haven't had a chance to check if it is now
supported. If it is included, it should be relatively easy to generate
the images you want on the fly. If it's any help, I found information on
this library starting on page 225 of the book "Programming PHP" from
O'Reilly (Chapter 9). As I recall you can find out what libraries are
installed with the phpinfo( function, see page 10 of that book.

If Apple didn't include the GD Library in Leopard it would still be
possible, though quite a bit more difficult. Since PHP is open source
you could compile it yourself with the GD Library included. I haven't
done that myself so I can't provide directions, but I know that it can
definitely be done.

Along the same vein, I'm sure that there are libraries available for
Perl, Ruby and/or Python to do the same thing. There are hundreds if not
thousands of libraries available for these languages, so I'm not
familiar with all or even most of them. There are directories available
for each language, so I would start there.

Jim Rea
President, ProVUE Development

P.S. I just checked, and if I am reading the output of the phpinfo()
function correctly it unfortunately appears that the GD library is still
not included in Leopard. Perhaps there is some licensing issue, maybe
the GD library has a GPL license. So unfortunately it will take some
extra work to get this working.
---------------------------------------------------------------------
---   Celebrating 30 years of software excellence (1978-2008)     ---
---------------------------------------------------------------------
ProVUE Development          (714) 841-7779
18685-A Main Street PMB356  http://www.provue.com/
Huntington Beach, CA 92648  Panorama: Turn information into knowledge
---------------------------------------------------------------------


More information about the Qna mailing list