Source:
public void paintStraightLabel(AffineTransform transform) throws Exception { AffineTransform oldTransform = graphics.getTransform(); try { AffineTransform newTransform = new AffineTransform(oldTransform); newTransform.concatenate(transform); graphics.setTransform(newTransform); Style2D graphic = labelItem.getTextStyle().getGraphic(); if (graphic != null) { double offsetY = 0; double offsetX = 0; final int[] margin = labelItem.getGraphicMargin(); if(margin != null) { offsetX = margin[1] - margin[3]; offsetY = margin[2] - margin[0]; } LiteShape2 tempShape = new LiteShape2(gf.createPoint(new Coordinate(labelBounds .getWidth() / 2.0 + offsetX, -1.0 * labelBounds.getHeight() / 2.0 + offsetY)), null, null, false, false); graphic = resizeGraphic(graphic); AffineTransform graphicTx = new AffineTransform(transform); LineInfo lastLine = lines.get(lines.size() - 1); graphicTx.translate(lastLine.getComponents().get(0).getX(), lastLine.getY()); graphics.setTransform(graphicTx); shapePainter.paint(graphics, tempShape, graphic, graphic.getMaxScale()); } if(labelItem.getTextStyle().getFont().getSize() == 0) return; if (lines.size() == 1 && lines.get(0).getComponents().size() == 1) { LineComponent component = lines.get(0).getComponents().get(0); LineMetrics metrics = computeLineMetricsIfNeeded(component); drawGlyphVector(component.getGlyphVector(), metrics); } else { AffineTransform lineTx = new AffineTransform(); for (LineInfo line : lines) { for (LineComponent component : line.getComponents()) { lineTx.setTransform(newTransform); lineTx.translate(component.getX(), line.getY()); graphics.setTransform(lineTx); LineMetrics metrics = computeLineMetricsIfNeeded(component); drawGlyphVector(component.getGlyphVector(), metrics); } } } } finally { graphics.setTransform(oldTransform); } }

Target:
public void paintStraightLabel(AffineTransform transform) throws Exception { AffineTransform oldTransform = graphics.getTransform(); try { AffineTransform newTransform = new AffineTransform(oldTransform); newTransform.concatenate(transform); graphics.setTransform(newTransform); Style2D graphic = labelItem.getTextStyle().getGraphic(); if (graphic != null) { double offsetY = 0; double offsetX = 0; final int[] margin = labelItem.getGraphicMargin(); if(margin != null) { offsetX = margin[1] - margin[3]; offsetY = margin[2] - margin[0]; } LiteShape2 tempShape = new LiteShape2(gf.createPoint(new Coordinate(labelBounds .getWidth() / 2.0 + offsetX, -1.0 * labelBounds.getHeight() / 2.0 + offsetY)), null, null, false, false); graphic = resizeGraphic(graphic); AffineTransform graphicTx = new AffineTransform(transform); LineInfo lastLine = lines.get(lines.size() - 1); graphicTx.translate(lastLine.getComponents().get(0).getX(), lastLine.getY()); graphics.setTransform(graphicTx); shapePainter.paint(graphics, tempShape, graphic, graphic.getMaxScale()); } if(labelItem.getTextStyle().getFont().getSize() == 0) return; if (lines.size() == 1 && lines.get(0).getComponents().size() == 1) { LineComponent component = lines.get(0).getComponents().get(0); drawGlyphVector(component); } else { AffineTransform lineTx = new AffineTransform(); for (LineInfo line : lines) { for (LineComponent component : line.getComponents()) { lineTx.setTransform(newTransform); lineTx.translate(component.getX(), line.getY()); graphics.setTransform(lineTx); drawGlyphVector(component); } } } } finally { graphics.setTransform(oldTransform); } }