int expectedGraphicMargin1 = (int) computeExpectedRescaleSize(maxDisplacement, scaleMetersToPixel, uom);
int expectedGraphicMargin2 = (int) computeExpectedRescaleSize(maxDisplacement * 2, scaleMetersToPixel, uom);
StyleBuilder styleBuilder = new StyleBuilder();
TextSymbolizerImpl textSymb = (TextSymbolizerImpl) styleBuilder.createTextSymbolizer();
textSymb.setUnitOfMeasure(uom);
Font font = styleBuilder.createFont(new java.awt.Font("Verdana",java.awt.Font.PLAIN,fontSize));
textSymb.setFont(font);
PointPlacement placement = styleBuilder.createPointPlacement(0.3, 0.3, displacementX, displacementY, 10);
textSymb.setLabelPlacement(placement);
// check we can rescale properly also vendor options
textSymb.addToOptions("maxDisplacement", String.valueOf(maxDisplacement));
textSymb.addToOptions(TextSymbolizer.GRAPHIC_MARGIN_KEY, maxDisplacement + " " + maxDisplacement * 2);
visitor = new UomRescaleStyleVisitor(scaleMetersToPixel);
textSymb.accept(visitor);
TextSymbolizer rescaledTextSymb = (TextSymbolizer) visitor.getCopy();
double rescaledFontSize = rescaledTextSymb.getFont().getSize().evaluate(null, Double.class);
PointPlacement rescaledPlacement = (PointPlacement) rescaledTextSymb.getLabelPlacement();
double rescaledDisplacementXSize = rescaledPlacement.getDisplacement().getDisplacementX().evaluate(null, Double.class);