|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.foray.font.config.ConfigGenerator
public class ConfigGenerator
Creates a default axsl-compliant font-configuration file from fonts in a set of directories. It is tempting to think that this class should be an axsl class. However, we need to use the FOray font parsing tools to be able to build this file.
Field Summary | |
---|---|
static String[] |
FONT_FILE_EXTENSIONS
The list of font file extensions supported by this class. |
Constructor Summary | |
---|---|
ConfigGenerator(FontServer4a fontServer)
Basic Constructor. |
Method Summary | |
---|---|
static FilenameFilter |
getDefaultFilter()
Returns the list of files that should be processed for a given directory. |
Document |
getDom()
Returns the default configuration as a DOM document. |
int |
getFailureCount()
Returns the quantity of files that could not be processed. |
int |
getSuccessCount()
Returns the quantity of files that were successfully processed. |
static void |
main(String[] args)
Command-line interface for ConfigGenerator . |
void |
processDirectory(String dirName,
FilenameFilter filter)
Process one directory, finding all files in that directory and processing them. |
void |
write(File file)
Writes the DOM created by this configuration to a given file. |
void |
write(OutputStream output)
Writes the DOM created by this configuration to a given output stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String[] FONT_FILE_EXTENSIONS
Constructor Detail |
---|
public ConfigGenerator(FontServer4a fontServer)
fontServer
- The font server.Method Detail |
---|
public Document getDom()
public void write(OutputStream output) throws org.axsl.font.FontException
output
- The output stream to which this configuration should be written.
org.axsl.font.FontException
- For errors writing the output.write(File)
public void write(File file) throws org.axsl.font.FontException
file
- The file to which this configuration should be written.
org.axsl.font.FontException
- For errors writing the output.write(OutputStream)
public void processDirectory(String dirName, FilenameFilter filter)
dirName
- The location of the directory.filter
- The filter that should be used to decide which files should be processed.public static void main(String[] args)
ConfigGenerator
.
Arguments contain the list of directories for which the configuration
should be created.
The name "system" (case is irrelevant) indicates that all known font directories on this
system should be included.
The file is created in the current directory with the name
"axsl-font-config-auto.xml".
args
- The list of directories which should be traversed looking
for fonts to configure.public int getFailureCount()
public int getSuccessCount()
public static FilenameFilter getDefaultFilter()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |