org.freehep.graphics2d.font
Class FontUtilities

java.lang.Object
  extended by org.freehep.graphics2d.font.FontUtilities

public class FontUtilities
extends java.lang.Object

Version:
$Id$
Author:
Mark Donszelmann

Nested Class Summary
static interface FontUtilities.ShowString
           
 
Method Summary
static java.util.List getAllAvailableFonts()
           
static java.util.Hashtable getAttributes(java.awt.Font font)
          there is a bug in the jdk 1.6 which makes Font.getAttributes() not work correctly.
static java.lang.String getEncodedString(java.lang.String string, CharTable charTable)
          Deprecated. use org.freehep.graphics2d.font.FontEncoder.getEncodedString()
static java.lang.String getEncodedString(java.lang.String string, java.lang.String tableName)
          Deprecated. use org.freehep.graphics2d.font.FontEncoder.getEncodedString()
static java.lang.String getWindowsFontName(java.lang.String fontName)
           
static void showString(java.awt.Font font, java.lang.String string, CharTable latinTable, FontUtilities.ShowString device)
          Shows a String and switches the encoding (and font) everytime the unicode characters leave the range of the curent encoding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAllAvailableFonts

public static java.util.List getAllAvailableFonts()

getWindowsFontName

public static java.lang.String getWindowsFontName(java.lang.String fontName)

getEncodedString

public static java.lang.String getEncodedString(java.lang.String string,
                                                java.lang.String tableName)
Deprecated. use org.freehep.graphics2d.font.FontEncoder.getEncodedString()


getEncodedString

public static java.lang.String getEncodedString(java.lang.String string,
                                                CharTable charTable)
Deprecated. use org.freehep.graphics2d.font.FontEncoder.getEncodedString()

Returns an unicode encoded string from an ascii encoded string, using the supplied table.


showString

public static void showString(java.awt.Font font,
                              java.lang.String string,
                              CharTable latinTable,
                              FontUtilities.ShowString device)
                       throws java.io.IOException
Shows a String and switches the encoding (and font) everytime the unicode characters leave the range of the curent encoding. Outside the range of the given latinTable, Symbol and ZapfDingbats are checked. If none of these three encodings contain the unicode character, an undefined character is used.

Throws:
java.io.IOException

getAttributes

public static java.util.Hashtable getAttributes(java.awt.Font font)
there is a bug in the jdk 1.6 which makes Font.getAttributes() not work correctly. The method does not return all values. What we dow here is using the old JDK 1.5 method.

Parameters:
font - font
Returns:
Attributes of font


Copyright © 2000-2007 FreeHEP. All Rights Reserved.