Package org.geotools.renderer.style
Class TTFMarkFactory
- Object
-
- TTFMarkFactory
-
- All Implemented Interfaces:
MarkFactory
public class TTFMarkFactory extends Object implements MarkFactory
This factory accepts mark paths in thettf://fontName#codeformat, where fontName is the name of a TrueType font installed in the system, or a URL to a TTF file, and the code is the character code, which may be expressed in decimal, hexadecimal (e.g.0x10) octal (e.g.045) form, as well as Unicode codes (e.g.U+F054or).- Author:
- Andrea Aime - TOPP
-
-
Field Summary
Fields Modifier and Type Field Description static TTFMarkFactoryINSTANCEThe factory is completely stateless, this single instance can be safely used across multiple threads
-
Constructor Summary
Constructors Constructor Description TTFMarkFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ShapegetShape(Graphics2D graphics, Expression symbolUrl, Feature feature)Turns the specified URL into an Shape, eventually using the Feature attributes to evaluate the expression, or returnsnullif the factory cannot evaluate this symbolUrl.ShapegetShape(ExternalMark mark)Returns a shape from an external mark definitionstatic voidmain(String[] args)
-
-
-
Field Detail
-
INSTANCE
public static TTFMarkFactory INSTANCE
The factory is completely stateless, this single instance can be safely used across multiple threads
-
-
Method Detail
-
getShape
public Shape getShape(Graphics2D graphics, Expression symbolUrl, Feature feature) throws Exception
Description copied from interface:MarkFactoryTurns the specified URL into an Shape, eventually using the Feature attributes to evaluate the expression, or returnsnullif the factory cannot evaluate this symbolUrl.The returned Shape must not exceed the [-0.5, -0.5, 0.5, 0.5] bounds (will be rescaled according to the
parameter given in graphics on the fly - Specified by:
getShapein interfaceMarkFactorysymbolUrl- the expression that will return the symbol name. Once evaluated the expression should return something likeplainNameor likeprotocol://path. See the actual implementations for details on the kind of supported name.feature- The feature that will be used to evaluate the symbolURL expression (or to extract data from it, think complex attributes, in that case a visit to the expression and some direct attribute value extraction might be needed instead)- Throws:
Exception
-
getShape
public Shape getShape(ExternalMark mark)
Returns a shape from an external mark definition
-
main
public static void main(String[] args)
-
-