Hi all,

 

I have a question regarding the fonts that are available to the
ImageTranscoder classes.

 

Would it be correct to assume that the list of fonts returned from the
following snippet of code correctly and completely identify the fonts
that are available to a, for example, PNGTranscoder.

 

      private void listFonts() {

            // get the local graphics environment

            GraphicsEnvironment graphicsEvn =
GraphicsEnvironment.getLocalGraphicsEnvironment();

            // get all the available fonts

            String availFonts[] =
graphicsEvn.getAvailableFontFamilyNames();

            System.out.println("The following fonts are available for
use:");

            for (int i = 0; i < availFonts.length; i++) {

                  System.out.println(availFonts[i]);

            }

      }

 

I have encountered a situation in which occasionally a PNG derived from
SVG is skewing the alignment of the text (it seems to ignore the
basline-shift attribute). An examination of the fonts available using
the above code indicates that my chosen font, Arial, is not available.
The actual font incorporated in the PNG is definitely not Arial, and
seems to be some basic system font.

 

The initial SVG itself is rendered fine in the browser, but I assume
that the fonts there are being retrieved from the client. The PNG
transcode is carried out on the server, where the above code seems to
suggest that Arial is not available. Could this be the cause of the
problem?

 

Thanks very much in advance for any advice,

 

Dylan 

 

Reply via email to