sk.upjs.fontmapper
Class Main

java.lang.Object
  extended by sk.upjs.fontmapper.Main

public class Main
extends java.lang.Object

Main class. Handles command line input.


Field Summary
private static boolean antialiasing_
          Use font antialiasing?
private static java.lang.String baseFileName_
          Base file name of output images (i.e.
private static org.apache.commons.cli.CommandLine cmd_
          Provides access to command lin arguments
private static int colorMode_
          Color mode to use (bitmap, grayscale or rgba).
private static char endGlyph_
          Glyphs to start and end drawing at (_endGlyph is not drawn, _startGlyph is).
private static java.lang.String fontName_
          Name of the font to use.
private static int fontSize_
          Font size in points.
private static int fontStyle_
          Font style to use.
private static org.apache.commons.cli.Options options_
          Stores command line options
private static java.awt.Dimension pageSize_
          Texture page size.
private static org.apache.commons.cli.CommandLineParser parser_
          Parses command line arguments
private static int spacing_
          Spacing between glyphs on the texture.
private static char startGlyph_
          Glyphs to start and end drawing at (_endGlyph is not drawn, _startGlyph is).
 
Constructor Summary
Main()
           
 
Method Summary
private static void addOptions_()
          Specifies command line options, their help messages and arguments.
private static void help_()
          Output help information.
private static void inputError_(java.lang.String message)
          Output a message about an input error and help information.
static void main(java.lang.String[] args)
           
private static int optionValueInt_(java.lang.String option, int def)
          Get an argument of an option as an integer.
private static java.lang.String optionValueString_(java.lang.String option, java.lang.String def)
          Get an argument of an option as a string.
private static boolean parseInput_(java.lang.String[] args)
          Reads input from command line options and arguments.
private static boolean validFileName_(java.lang.String name)
          Validate a file name to detect input errors
private static boolean verifyInput_()
          Verifies validity of read input values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

options_

private static org.apache.commons.cli.Options options_
Stores command line options


parser_

private static org.apache.commons.cli.CommandLineParser parser_
Parses command line arguments


cmd_

private static org.apache.commons.cli.CommandLine cmd_
Provides access to command lin arguments


baseFileName_

private static java.lang.String baseFileName_
Base file name of output images (i.e. filename w/o page number and extension).


fontName_

private static java.lang.String fontName_
Name of the font to use.


fontSize_

private static int fontSize_
Font size in points.


antialiasing_

private static boolean antialiasing_
Use font antialiasing?


colorMode_

private static int colorMode_
Color mode to use (bitmap, grayscale or rgba).


pageSize_

private static java.awt.Dimension pageSize_
Texture page size.


startGlyph_

private static char startGlyph_
Glyphs to start and end drawing at (_endGlyph is not drawn, _startGlyph is).


endGlyph_

private static char endGlyph_
Glyphs to start and end drawing at (_endGlyph is not drawn, _startGlyph is).


spacing_

private static int spacing_
Spacing between glyphs on the texture.


fontStyle_

private static int fontStyle_
Font style to use. (plain, italic or bold)

Constructor Detail

Main

public Main()
Method Detail

main

public static void main(java.lang.String[] args)

parseInput_

private static boolean parseInput_(java.lang.String[] args)
Reads input from command line options and arguments.


verifyInput_

private static boolean verifyInput_()
Verifies validity of read input values.


addOptions_

private static void addOptions_()
Specifies command line options, their help messages and arguments.


optionValueInt_

private static int optionValueInt_(java.lang.String option,
                                   int def)
                            throws java.lang.Exception
Get an argument of an option as an integer.

Parameters:
option - Option to read.
def - Default value to return if the option is not specified.
Returns:
Argument of the option or default value if not specified.
Throws:
java.lang.Exception - if the argument could not be parsed.

optionValueString_

private static java.lang.String optionValueString_(java.lang.String option,
                                                   java.lang.String def)
Get an argument of an option as a string.

Parameters:
option - Option to read.
def - Default value to return if the option is not specified.
Returns:
Argument of the option or default value if not specified.

help_

private static void help_()
Output help information.


inputError_

private static void inputError_(java.lang.String message)
Output a message about an input error and help information.

Parameters:
message - Message to output.

validFileName_

private static boolean validFileName_(java.lang.String name)
Validate a file name to detect input errors

Parameters:
name - File name to validate.
Returns:
true if the file name is valid.