com.iproject.wbmpcreator
Class CustomFont

java.lang.Object
  |
  +--com.iproject.wbmpcreator.CustomFont

public class CustomFont
extends java.lang.Object
implements java.io.Serializable

This class is used for storing User-Defined compiled fonts.

The user-defined font (UDF) is a text file later to be converted into an object understandable to WBMPcreator. This file MUST have the *.udf extension, note the small letters. After a UDF is read it is compiled and stored in file system with *.udfc extension.

The file looks like following:

 alphabet
 x_size y_size
 here is the font where each symbol consists of y_size lines, each symbol follows another.
 
Here is the sample used by the author for test purposes:
 ABC
 4 6
 --##
 -#-#
 #--#
 ####
 #--#
 #--#
 ###-
 #--#
 ###-
 #--#
 #--#
 ###-
 ####
 #---
 #---
 #---
 #---
 ####
 
You can see that the alphabet consists of 3 symbols, each symbol is 4 points wide and 6 points high. Symbols follow the header. After compiling this font you may remove the *.udf file leaving *.udfc file act as a font.

See Also:
Serialized Form

Constructor Summary
CustomFont()
           
 
Method Summary
 java.lang.String getAlphabet()
          Gets all alphabet symbols as a String
 int getElementAt(int index)
          Method to get element stored at the given position.
 int[] getPointArray()
          Gets point array of the font
 int getTotalSymbols()
          Gets length of the alphabet used.
 int getXSize()
          Gets X size of a user-defined font
 int getYSize()
          Gets Y size of a user-defined font
 boolean isIsUnicode()
          Tests whether the Unicode or normal ASCII encoding used.
 void setAlphabet(java.lang.String newAlphabet)
          Sets alphabet, i.e. a set of characters used in the font (Unicode is not supported in this version)
 void setElementAt(int index, int newElement)
          Method to set element at the given position.
 void setIsUnicode(boolean newIsUnicode)
          Sets Unicode or normal symbol representation.
 void setPointArray(int[] newPointArray)
          Explicitly sets the point array for a font.
 void setTotalSymbols(int newTotalSymbols)
          Sets lenght of an alphabet used.
 void setXSize(int newXSize)
          Sets X size of a user-defined font
 void setYSize(int newYSize)
          Sets Y size of a user-defined font
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomFont

public CustomFont()
Method Detail

setXSize

public void setXSize(int newXSize)
Sets X size of a user-defined font
Parameters:
newXSize - new value

getXSize

public int getXSize()
Gets X size of a user-defined font

setYSize

public void setYSize(int newYSize)
Sets Y size of a user-defined font
Parameters:
newYSize - new value

getYSize

public int getYSize()
Gets Y size of a user-defined font

setTotalSymbols

public void setTotalSymbols(int newTotalSymbols)
Sets lenght of an alphabet used. Used mostly implicitly and is not necessary to be used by the user.
Parameters:
newTotalSymbols - new value

getTotalSymbols

public int getTotalSymbols()
Gets length of the alphabet used.

setAlphabet

public void setAlphabet(java.lang.String newAlphabet)
Sets alphabet, i.e. a set of characters used in the font (Unicode is not supported in this version)
Parameters:
newAlphabet - new value

getAlphabet

public java.lang.String getAlphabet()
Gets all alphabet symbols as a String

setPointArray

public void setPointArray(int[] newPointArray)
Explicitly sets the point array for a font.
Parameters:
newPointArray - new value

getPointArray

public int[] getPointArray()
Gets point array of the font

setIsUnicode

public void setIsUnicode(boolean newIsUnicode)
Sets Unicode or normal symbol representation. Its realization will be available in further versions (approximately 1.30). Still does nothing.
Parameters:
newIsUnicode - new value

isIsUnicode

public boolean isIsUnicode()
Tests whether the Unicode or normal ASCII encoding used. Implemented for further use.

getElementAt

public int getElementAt(int index)
Method to get element stored at the given position.
Parameters:
index - the index of the element

setElementAt

public void setElementAt(int index,
                         int newElement)
Method to set element at the given position.
Parameters:
index - the index of the element
newElement - the new element