For Programmers: Free Programming Magazines  


Home > Archive > Tcl > October 2006 > Text to Image









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Text to Image
mike.zebrowski@avistainc.com

2006-10-19, 7:01 pm

Hi,

I need to create Photo Images based on the user's inputted text, color,
font, maximum width, and maximum height.

I also need to do this without mapping anything to the screen, so
tossing everything into a text widget and using Img to capture it is
not an option.

I'm allowed to use Standard Tcl/TK, Critcl, and Img.

Any suggestions?

Thanks,
Mike Zebrowski

Eric Hassold

2006-10-19, 10:00 pm

mike.zebrowski@avistainc.com a écrit :
> Unless there is a starkit made up that supports windows, linux (x86),
> and MacOSX, TCLMagick isn't option.
>
> I need to deploy a stand-alone program to meet the customer's needs.
>
> But, thanks for the suggestion.
>


eTcl distribution is available for windows, linux (x86 and arm) and
MacOSX (PPC and intel) architectures (among others), and includes the
pixane extension. The full version also embeds TTF fonts into its VFS,
so it has really no external dependencies and deployment should be
trivial (on all platforms, eTcl is available as a single file executable
which can be run from anywhere with no installation).
http://www.evolane.com/software/etcl/index.html

(BTW, for those who cares, not yet announced 1.0-rc14 release is
available, based on Tcl/Tk 8.4.14).

Pixane extension was originally designed to generate dynamic images
containing text in CGI. For example, banners on our site are generated
with it:

http://mirror.evolane.com/themes/pl...ption=Tcl+rules

(yes, you can replace the "Tcl+rules" value with whatever you want ;-))

The cons now:
- we still didn't take time to clean package everything and release sources
- there isn't much documentation yet, except:
http://www.evolane.com/software/pixane/pixane.html
http://www.evolane.com/software/pixane/pixfont.html

but command names are pretty explicit, so you may still find it qui te
usable. If it suits your needs, but have some questions, don't hesitate
to ask and I will enjoy this opportunity to improve documentation and/or
add a repository for sample codes.

Eric

-----
Eric Hassold
Evolane - http://www.evolane.com/
George Peter Staplin

2006-10-23, 7:03 pm

mike.zebrowski@avistainc.com wrote:
> Hi,
>
> I need to create Photo Images based on the user's inputted text, color,
> font, maximum width, and maximum height.
>
> I also need to do this without mapping anything to the screen, so
> tossing everything into a text widget and using Img to capture it is
> not an option.
>
> I'm allowed to use Standard Tcl/TK, Critcl, and Img.
>
> Any suggestions?


Well standard Tk has no text primitives that can be drawn on photo
images. As you are limited, what you can do is generate some data with
widgets, and then take a screenshot based on the display. But you may
find screen artifacts, or blackness depending on the visible area,
because Tk/Img uses XGetImage which includes inferiors. You can get
around this problem potentially, with raise, and update.

I implemented my freetypeext library for Unix and Win32, because I
needed to be able to create RGBA text. I use it in combination with
megaimage, and/or megaimagetk to manipulate and/or display the
RGBA data created. megaimagetk can convert to/from photo images. I
also wrote jpegext2 and pngext2 for saving or loading RGB(A) data.

The code is available from
http://www.xmission.com/~georgeps/i...ftware/megapkg/

crvoss@up-link.net

2006-10-30, 7:32 pm

You might take a look at fly. I've used GD with success generating png
and jpeg with text all done on the fly with no desktop on the system.
See a screen shot at:
http://www.vossinteractive.com/VIA/...ageIdx=webfscrv
Done in C but should be just as capable in Tcl. There is the capability
to load graphics as background to write text to. Available for many
OS's at:
http://martin.gleeson.com/fly/installation.html
A little old but should do the job.

enjoy,
Charles

mike.zebrowski@avistainc.com wrote:
> Hi,
>
> I need to create Photo Images based on the user's inputted text, color,
> font, maximum width, and maximum height.
>
> I also need to do this without mapping anything to the screen, so
> tossing everything into a text widget and using Img to capture it is
> not an option.
>
> I'm allowed to use Standard Tcl/TK, Critcl, and Img.
>
> Any suggestions?
>
> Thanks,
> Mike Zebrowski


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com