Google Answers Logo
View Question
 
Q: Web site Font preview capability ( Answered,   1 Comment )
Question  
Subject: Web site Font preview capability
Category: Computers > Internet
Asked by: malcolm2-ga
List Price: $25.00
Posted: 14 Jul 2004 03:18 PDT
Expires: 13 Aug 2004 03:18 PDT
Question ID: 373893
We would like to offer on our web site (www.boat-names.co.uk) the
ability for a customer to preview a boat name of his choice (normally
one or two words. In any one of the 18 different fonts that we
currently alfabetically display as a jpeg image. These fonts are on
our pc but NOT necessarily on his. Can this  preview facility be
achieved. If so by what means.
We have previously been advised that this is not feasable, now we are
being told that it is. Is there some new design software that now
makes possible.
Answer  
Subject: Re: Web site Font preview capability
Answered By: palitoy-ga on 14 Jul 2004 05:45 PDT
 
Hello Malcolm2-ga

What you are asking *is* feasible and requires you to be able to
create dynamic images on your web server.  The most common packages
that allow you to do this are the GD Graphics library and the
ImageMagick package.  You only need one of these packages to be able
to proceed (and there may also be other alternatives but these are the
two most well known and supported).

ImageMagick: http://www.imagemagick.org/
GD Graphics Library: http://www.boutell.com/gd/

These packages would allow you to create images on the fly that
include the words that you require in the fonts that you require; the
customer would only see *an image* with the words displayed in the
font that he picked.  As the customer only sees an image (s)he does
not need to have access to the fonts (that are stored on your web
server).

This is the easiest way to solve this problem and one I have utilised
on my web sites on a number of occasions.

How do you proceed from here?  What you need to do is to contact your
web host provider and ask them whether they have either of the two
packages available and if they do not will they install it for you. 
The GD module is provided with most installations of PHP (but it is
always best to check with them and to ask them if there is anything
else you need to know about its installation).

Once you have either of the two packages available it is simply a
matter of getting your website programmer to knock up the code to
create the dynamically generated images with the text required.  This
is a fairly simple procedure but something that is quite difficult to
discuss here due to this not being a private forum to discuss this
type of thing.

For instance to create an image in PHP code with the GD library you
would simply use something like this:

<?php
Header("Content-type: image/jpeg"); 
$image = ImageCreate(200,200);
$white = ImageColorAllocate($image,255,255,255);
$blue = ImageColorAllocate($image,0,0,255);
ImageFilledRectangle($image,0,0,200,200,$white);
for ($i=1; $i <= 5; $i++)
ImageString($image,$i,15,$i*10,'www.boat-names.co.uk',$blue);
ImageJPEG($image);
ImageDestroy($image);
?>

This file could then be opened with an html <img> tag on your site.

There is a lot of useful help and information on using these packages
at the sites mentioned above.  These links will also probably be of
help:
http://www.beginnersphp.co.uk/gdtext.php
http://www.phpfreaks.com/tutorials/105/1.php
http://www.bl.com/moshe/text/quiddities/imagefromtext.html

If you require any further information on this subject please ask and
I will do my best to help.
Comments  
Subject: Re: Web site Font preview capability
From: owain-ga on 14 Jul 2004 10:16 PDT
 
www.cooltext.com does almost exactly what you want to do, AFAIK it is
powered by GIMP.

Owain

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy