org.pz.platypus
Class FontDirectoryList

java.lang.Object
  extended by org.pz.platypus.FontDirectoryList

public class FontDirectoryList
extends java.lang.Object

List of directories containing font files.

Author:
alb

Field Summary
private  java.util.LinkedList<java.lang.String> fontDirs
          list of directories containing font files
private  GDD gdd
          the GDD.
 
Constructor Summary
FontDirectoryList(GDD Gdd)
          We only ever load the default list of directories.
 
Method Summary
(package private)  void addDirsInFontDirsTxtFile(java.lang.String homeDir, java.util.LinkedList<java.lang.String> dirs)
          Adds directories specified in fontdirs.txt file to the list of directories to register
 void addFontDir(java.util.LinkedList<java.lang.String> dirList, java.lang.String dirName)
          verifies that the directory name exists on this system.
 java.lang.String[] getDirs()
          Get the names of the default locations for font files and return those locations as an array of strings
 void loadDefaultFontDirs(java.util.LinkedList<java.lang.String> dirs)
          Create a list of the directories on the system that contain fonts.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fontDirs

private java.util.LinkedList<java.lang.String> fontDirs
list of directories containing font files


gdd

private GDD gdd
the GDD. Used to obtain the PLATYPUS_HOME directory

Constructor Detail

FontDirectoryList

public FontDirectoryList(GDD Gdd)
We only ever load the default list of directories. At some future point, we will allow users to specify directories that contain additional fonts.

Parameters:
Gdd - the GDD
Method Detail

loadDefaultFontDirs

public void loadDefaultFontDirs(java.util.LinkedList<java.lang.String> dirs)
Create a list of the directories on the system that contain fonts. We use the directories that are employed by iText and we add the Platypus font directory (in PLATYPUS_HOME) and the font files included with the Java JVM.

Parameters:
dirs - the linked list of directories to add fonts to

addDirsInFontDirsTxtFile

void addDirsInFontDirsTxtFile(java.lang.String homeDir,
                              java.util.LinkedList<java.lang.String> dirs)
Adds directories specified in fontdirs.txt file to the list of directories to register

Parameters:
homeDir - the PLATYPUS_HOME directory
dirs - list of directories containing fonts to register with iText

addFontDir

public void addFontDir(java.util.LinkedList<java.lang.String> dirList,
                       java.lang.String dirName)
verifies that the directory name exists on this system. If so, adds it to the directory list; otherwise, does nothing.

Parameters:
dirList - list of directories to which the new directory is added
dirName - new directory to add. If an error occurs, no directory is added.

getDirs

public java.lang.String[] getDirs()
Get the names of the default locations for font files and return those locations as an array of strings

Returns:
an array of strings, each one containing the name of a directory holding font files.


Copyright © 2008-10 Pacific Data Works LLC