double cx = (double)canvasStringWidth(label, fontFamily, fontWeight, fontSize) / 2.0;
double cy = (stringHeight(label, fontFamily, fontWeight, fontSize))/2;
translate(x, y);
rotate(angle);
setFillColor(new Color(getStrokeColor()));
translate(angle > 0 ? 0 : -cx*2, angle < 0 ? 0 : -cy*2);
fillText(label, 0, 0, fontFamily, fontSize, angle > 0 ? "top" : "top");