Package org.meteoinfo.jts.awt
Class FontGlyphReader
- java.lang.Object
-
- org.meteoinfo.jts.awt.FontGlyphReader
-
public class FontGlyphReader extends java.lang.ObjectProvides methods to readFontglyphs for strings intoPolygonalgeometry.It is suggested to use larger point sizes to render fonts glyphs, to reduce the effects of scale-dependent hints. The result geometry is in the base coordinate system of the font. The geometry can be further transformed as necessary using
AffineTransformations.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringFONT_MONOSPACEDThe font name of the Java logical font Monospaced.static java.lang.StringFONT_SANSERIFThe font name of the Java logical font SansSerif.static java.lang.StringFONT_SANSSERIFThe font name of the Java logical font SansSerif.static java.lang.StringFONT_SERIFThe font name of the Java logical font Serif.
-
Constructor Summary
Constructors Constructor Description FontGlyphReader()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Geometryread(java.lang.String text, java.awt.Font font, double flatness, GeometryFactory geomFact)Converts text rendered in the givenFontto aGeometrystatic Geometryread(java.lang.String text, java.awt.Font font, GeometryFactory geomFact)Converts text rendered in the givenFontto aGeometryusing a standard flatness factor.static Geometryread(java.lang.String text, java.lang.String fontName, int pointSize, GeometryFactory geomFact)Converts text rendered in the given font and pointsize to aGeometryusing a standard flatness factor.
-
-
-
Field Detail
-
FONT_SERIF
public static final java.lang.String FONT_SERIF
The font name of the Java logical font Serif.- See Also:
- Constant Field Values
-
FONT_SANSERIF
public static final java.lang.String FONT_SANSERIF
The font name of the Java logical font SansSerif.DEPRECATED - use FONT_SANSSERIF
- See Also:
- Constant Field Values
-
FONT_SANSSERIF
public static final java.lang.String FONT_SANSSERIF
The font name of the Java logical font SansSerif.- See Also:
- Constant Field Values
-
FONT_MONOSPACED
public static final java.lang.String FONT_MONOSPACED
The font name of the Java logical font Monospaced.- See Also:
- Constant Field Values
-
-
Method Detail
-
read
public static Geometry read(java.lang.String text, java.lang.String fontName, int pointSize, GeometryFactory geomFact)
Converts text rendered in the given font and pointsize to aGeometryusing a standard flatness factor.- Parameters:
text- the text to renderfontName- the name of the fontpointSize- the pointSize to render atgeomFact- the geometryFactory to use to create the result- Returns:
- a polygonal geometry representing the rendered text
-
read
public static Geometry read(java.lang.String text, java.awt.Font font, GeometryFactory geomFact)
Converts text rendered in the givenFontto aGeometryusing a standard flatness factor.- Parameters:
text- the text to renderfont- the font to render withgeomFact- the geometryFactory to use to create the result- Returns:
- a polygonal geometry representing the rendered text
-
read
public static Geometry read(java.lang.String text, java.awt.Font font, double flatness, GeometryFactory geomFact)
Converts text rendered in the givenFontto aGeometry- Parameters:
text- the text to renderfont- the font to render withflatness- the flatness factor to usegeomFact- the geometryFactory to use to create the result- Returns:
- a polygonal geometry representing the rendered text
-
-