visad.util
Class HersheyFont
- java.lang.Object
-
- visad.util.HersheyFont
-
public class HersheyFont extends java.lang.ObjectHersheyFont supports the Hershey Fonts for VisAD. Adapted from the original code by Buzbee (see source)
-
-
Constructor Summary
Constructors Constructor and Description HersheyFont()Default constructor.HersheyFont(java.lang.String fontName)Get a Hershey Font by name.HersheyFont(java.net.URL base)Get a Hershey Font by URL.HersheyFont(java.net.URL base, java.lang.String fontName)Get a Hershey Font by URL and name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanequals(java.lang.Object o)See if o is equal to thisint[]getCharacterMaxX()get the maximum X coordinate values for all charactersint[]getCharacterMinX()get the minimum X coordinate values for all charactersintgetCharacterSetMaxX()get the maximum X coordiante value for all charactersintgetCharacterSetMaxY()get the maximum Y coordiante value for all charactersintgetCharacterSetMinX()get the minimum X coordiante value for all charactersintgetCharacterSetMinY()get the minimum Y coordiante value for all charactersintgetCharactersInSet()get the minimum Y coordiante value for all characterschar[][]getCharacterVector(int i)get the vector of X and Y coordinates for the i-th characterbooleangetFixedWidth()indicate whether this is a fixed-width fontbooleangetIsCursive()indicate whether this is a cursive fontintgetMaxPoints()get the maximum number of points (segments) allowedintgetNumberOfPoints(int i)get the number of points for the i-th characterinthasCode()Get the hashcodevoidsetFixedWidth(boolean fw)set whether this font is 'fixed width' or not (not = proportional spacing) Right now, only the 'wmo' font is defaulted to fixed.java.lang.StringtoString()
-
-
-
Constructor Detail
-
HersheyFont
public HersheyFont()
Default constructor. Use the font 'futural' Supplied fonts are: futural, timesr, timesrb, cursive, futuram, rowmans, rowmant, meteorology All other fonts supplied by Bizbee are available at the VisAD web site. More info at: http://batbox.org/font.html
-
HersheyFont
public HersheyFont(java.lang.String fontName)
Get a Hershey Font by name. This constructor form will add a .jhf extension to the name given and read it as a Resourse from the visad/util directory. Supplied fonts are: futural, timesr, timesrb, cursive, futuram, rowmans, rowmant, meteorology All other fonts supplied by Bizbee are available at the VisAD web site.- Parameters:
fontName- name of the Hershey font to use
-
HersheyFont
public HersheyFont(java.net.URL base, java.lang.String fontName)Get a Hershey Font by URL and name. You must give the complete filename (e.g., futural.jhf) as well as the URL- Parameters:
base- is the base URL of the filefontName- the name of the fontfile (include .jhf extension)
-
HersheyFont
public HersheyFont(java.net.URL base)
Get a Hershey Font by URL. You must give the complete filename (e.g., futural.jhf) as part of the URL- Parameters:
base- is the URL of the file (e.g., http://www.ssec.wisc.edu/visad/futural.jhf)
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object o)
See if o is equal to this- Overrides:
equalsin classjava.lang.Object- Returns:
- true if they have the same name
-
hasCode
public int hasCode()
Get the hashcode- Returns:
- the hashcode
-
getMaxPoints
public int getMaxPoints()
get the maximum number of points (segments) allowed- Returns:
- value of max number of segments allowed.
-
getCharacterMinX
public int[] getCharacterMinX()
get the minimum X coordinate values for all characters- Returns:
- array of minimum X coordinates
-
getCharacterMaxX
public int[] getCharacterMaxX()
get the maximum X coordinate values for all characters- Returns:
- array of maximum X coordinates
-
getCharacterSetMinY
public int getCharacterSetMinY()
get the minimum Y coordiante value for all characters- Returns:
- minimum Y coordinate value for all characters in thie font
-
getCharacterSetMaxY
public int getCharacterSetMaxY()
get the maximum Y coordiante value for all characters- Returns:
- maximum Y coordinate value for all characters in thie font
-
getCharacterSetMinX
public int getCharacterSetMinX()
get the minimum X coordiante value for all characters- Returns:
- minimum X coordinate value for all characters in thie font
-
getCharacterSetMaxX
public int getCharacterSetMaxX()
get the maximum X coordiante value for all characters- Returns:
- maximum X coordinate value for all characters in thie font
-
getCharactersInSet
public int getCharactersInSet()
get the minimum Y coordiante value for all characters- Returns:
- minimum Y coordinate value for all characters in thie font
-
getNumberOfPoints
public int getNumberOfPoints(int i)
get the number of points for the i-th character- Parameters:
i- the index of the character- Returns:
- the number of data points for this character
-
getCharacterVector
public char[][] getCharacterVector(int i)
get the vector of X and Y coordinates for the i-th character- Parameters:
i- the index of the character- Returns:
- array[2][number_points] for this character
-
setFixedWidth
public void setFixedWidth(boolean fw)
set whether this font is 'fixed width' or not (not = proportional spacing) Right now, only the 'wmo' font is defaulted to fixed.
-
getFixedWidth
public boolean getFixedWidth()
indicate whether this is a fixed-width font- Returns:
- true if name indicates fixed with (wmo...)
-
getIsCursive
public boolean getIsCursive()
indicate whether this is a cursive font- Returns:
- true if name contains "cursive"
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-
DMelt 3.0 © DataMelt by jWork.ORG