Glad it's working. My initial questions were going to be centered on whether or
not the fonts were specific to the app and whether the app needed to make the
system fonts available as well as the custom fonts. It sounds like you've moved
away from having the app set "java.awt.fonts", which I think is a good choice.
One thing that immediately comes to mind for apps that are handling image
output is to stay away from ImageIO for now, especially for JPEG images. I
know, sounds kooky, but there are some bugs that really make it suspect for
long-lived processes. Some of the problems are actually caused by the way Java
handles temporary files, but the use of ImageIO can exacerbate the symptoms. If
you are using it, make sure to issue:

ImageIO.setUseCache(false)

so that disk-based caching is not used. By default, this is set to true. Here
are some bugs to ponder:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4513817
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4827358

Quoting Michael McGrady <[EMAIL PROTECTED]>:

> Hello, Kris,
> 
> Thanks or responding.  I solved the problem.  Instead of relying up 
> System, I just created my own independent font application.  I use a 
> doubled HashMap to get the physical font files location from the font 
> FONT name and the font FAMILY name from a constants class (actually two 
> constants classes, because the VM would not hand the file size).  Then I 
> just use TextAttributes put into a may after the Font object is created 
> with a FileInputStream.  Works like a charm.  All my buttons are created 
> on the fly and Internationalized, so this was essential. 
> 
> If you have anything to add, given this, I would be more than 
> interested.  Always looking to make things better.
> 
> Michael McGrady
> 
> Kris Schneider wrote:
> 
> > Michael,
> >
> > If you're still looking for input, post back, I've got some follow-up 
> > questions.
> >
> > Michael McGrady wrote:
> >
> >> I use a Struts PlugIn to set System.setProperty("java.awt.fonts", 
> >> MyApp.FONTS_LOCATION) to set the dynamic option for awt fonts.  This 
> >> works.  Then I put a variety of open source fonts in the 
> >> MyApp.FONTS_LOCATION directory.  new 
> >> File(MyApp.FONTS_:LOCATION).exists() return "true".  When I set  in a 
> >> Struts custom taglib for a subclass of ImageTag as TextAttribute.NAME 
> >> with the value of a .ttf file, it also shows up as the name of the 
> >> Font object, e.g. 
> >> java.awt.Font[family=dialog,name=wds011402,style=plain,size=36].  
> >> However, as you can see, the family name always returns to a default, 
> >> and the True Type Font in my custom fonts file is not used.  Does 
> >> anyone have experience with this?  Is there a recommended different 
> >> way of dealing with setting Fonts in Struts.
> >>
> >> Michael McGrady

-- 
Kris Schneider <mailto:[EMAIL PROTECTED]>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to