Package org.locationtech.jts.awt
Class FontGlyphReader
java.lang.Object
org.locationtech.jts.awt.FontGlyphReader
Provides methods to read
Font
glyphs for strings
into Polygonal
geometry.
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
AffineTransformation
s.
- Author:
- Martin Davis
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The font name of the Java logical font Monospaced.static final String
The font name of the Java logical font SansSerif.static final String
The font name of the Java logical font SansSerif.static final String
The font name of the Java logical font Serif. -
Method Summary
Modifier and TypeMethodDescriptionstatic Geometry
read
(String text, Font font, double flatness, GeometryFactory geomFact) static Geometry
read
(String text, Font font, GeometryFactory geomFact) static Geometry
read
(String text, String fontName, int pointSize, GeometryFactory geomFact) Converts text rendered in the given font and pointsize to aGeometry
using a standard flatness factor.
-
Field Details
-
FONT_SERIF
The font name of the Java logical font Serif.- See Also:
-
FONT_SANSERIF
The font name of the Java logical font SansSerif.DEPRECATED - use FONT_SANSSERIF
- See Also:
-
FONT_SANSSERIF
The font name of the Java logical font SansSerif.- See Also:
-
FONT_MONOSPACED
The font name of the Java logical font Monospaced.- See Also:
-
-
Method Details
-
read
Converts text rendered in the given font and pointsize to aGeometry
using 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
- 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
- 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
-