org.icepdf.core.util
Class FontUtil

java.lang.Object
  extended by org.icepdf.core.util.FontUtil

public class FontUtil
extends java.lang.Object

Font utility contians a bunch of commonly used font utility methods.

Since:
3.1

Constructor Summary
FontUtil()
           
 
Method Summary
static int guessAWTFontStyle(java.lang.String name)
          Utility method which maps know style strings to an AWT font style constants.
static java.lang.String guessFamily(java.lang.String name)
          Utility method for guessing a font family name from its base name.
static java.lang.String normalizeString(java.lang.String name)
          Utility method for normailing strings, to lowercase and remove any spaces.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FontUtil

public FontUtil()
Method Detail

guessAWTFontStyle

public static int guessAWTFontStyle(java.lang.String name)
Utility method which maps know style strings to an AWT font style constants. The style attribute read as follows from the java.awt.font constructor:

Parameters:
name - base name of font.
Returns:
integer representing dffs

guessFamily

public static java.lang.String guessFamily(java.lang.String name)
Utility method for guessing a font family name from its base name. Font names are usually made up of a familyName followed by a style name. For example:

Parameters:
name - base name of font.
Returns:
guess of the base fonts name.

normalizeString

public static java.lang.String normalizeString(java.lang.String name)
Utility method for normailing strings, to lowercase and remove any spaces.

Parameters:
name - base name of font
Returns:
normalized copy of string.