Code: Select all
public class Test {
public static void main(String[] args) {
SVGGraphics2D parent = new SVGGraphics2D(100, 100);
parent.setFontMapper(new FontMapper() {
@Override
public String mapFont(String arg0) {
return arg0;
}
});
/*
* Create a child Graphics2D. Should be the same as the parent,
* including the font mapper.
*/
SVGGraphics2D child = (SVGGraphics2D) parent.create();
/* Print out the font mapper. Seems to be different. */
System.err.println("Parent font mapper = " + parent.getFontMapper());
System.err.println("Child font mapper = " + child.getFontMapper());
}
}