Hershey Fonts added to VisAD

I'm pleased to inform you that a number of Hershey fonts have been added to the
latest VisAD release.  In addition to a support class, visad.util.HersheyFont,
signatures for visad.PlotText.render_font() have been added to accept a
HersheyFont and return a VisADLineArray.  

Here's an example:

        HersheyFont hf = new HersheyFont("cursive");
        VisADLineArray vala = PlotText.render_font("My string", hf,
             start, base, up, center);

A small number of font files are also supplied in the visad/util directory
(cursive, futural, futuram, meteorology, rowmans, rowmant, timesr and
timesrb).    Additional Hershey fonts are available in a ZIP file referenced
off the VisAD Home Page.  You should place any additional font files you need
into the visad/util directory, and use the ".jhf" file extension.

These fonts a "stroked-generated", meaning they are a series of line segments
like the default VisAD built-in font.  The difference is that these fonts
contain many more line segments and their rendering is much more pleasing in
appearance than the default font.  Stroke-generated fonts are useful when
overlaying text on a background image when using 2D, since they are rendered as
lines (the renderering of java.awt.Fonts fonts are done as polygons, and
therefore do not always appear "on top" of the image).

Finally, a drawString() method has been added to the subs.py library script. 
This method allows you to easily draw HersheyFonts into your Display when using
Python.  I expect the signature of this will change soon, though, to include
"height=" and "rotate=" parameters as well as the start=, up=, base= parameters
in this release.

-- 
Tom Whittaker (tomw@xxxxxxxxxxxxx)
University of Wisconsin-Madison
Space Science and Engineering Center
Phone/VoiceMail: 608/262-2759
Fax: 608/262-5974


  • 2001 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: