|
Here is the Typo Servet (free).
This servlet builds GIF image from a bitmap font
file (.ffi) and user text.
A
real time demonstration is available from the Typo
web service.
Let's Go !
|
|
Typo servlet
sample results
|
|
|
|
|
|
|
|
How
to setup Typo
?
Download the package (sources
included) here
(60.8 Ko - zip file).
Files
included :
Source
files :
fontgrabber.java (Image builder)
fontinfo.java (font information)
typo.java (servlet)
fontser.java (.ffi builder)
GifEncoder.java
ImageEncoder.java
IntHashTable.java
|
Others
files :
bennyfnt.gif (Raw font file) bennyfnt.ffi (FontInfo
file)
Note : fontser.java contains the descriptor for
bennyfnt.gif
|
Build
:
Check that JSDK package is in your CLASSPATH.
Then try javac -d . *.java
Note : PATH variable in typo.java is the path to
.ffi files. It should be setup.(Depending on your servlet
engine configuration) Default is "./". (Do not forget
the slash at the end).
How
to run Typo
?
Typo servlet implements the doGet(...)
method so you can run it from an URL like :
http://mydomain/servlets/typo?font=myfont&text=mytext
You can choose the bitmap font through
the font parameter. Font file format is ffi. To
create your own ffi you need :
- a bitmap file (GIF/JPEG) with the
graphical fonts (letters should be placed in a regular
grid). You can get free fonts from D.
Guldkrans web site.
- a font descriptor : grid dimensions,
yspacing, index. Look at the example included in package
: fontser.java
- compile and run fontser.java to
create your ffi file.
You can choose the text to display
with the text parameter. As we use an URL, remember
that caracter like space have to be encoded (e.g text=hello
world ! becomes text=hello%20world%21).
|
| Typo
1.0 Servlet |
FREE
(Source Code Included)
|
|
|