/** * Creates an outline of a text shape for better readability * @param originalText * @return */ public static ShapeInfo createTextOutline(ShapeInfo originalText) { return createTextOutline(originalText, RendererSettings.getInstance().getTextOutlineWidth()); }
/** * Creates an outline of a text shape for better readability. Width is only 1 * but it is faster because instead of tracing an outline, we duplicate the * text 4x and shift each one in a different direction. Assumes text layout * is being used in the shape info. * @param originalText * @return */ public static ArrayList<ShapeInfo> createTextOutlineQuick(ShapeInfo originalText) { int thickness = RendererSettings.getInstance().getTextOutlineWidth(); return createTextOutlineQuick(originalText, thickness); }
/** * Creates text outline as a shape * * @param originalText the original text * @return text shape */ public static Shape2 createTextOutline(Shape2 originalText) { Shape2 siOutline = null; try { //Shape outline = new GeneralPath(originalText.get_Shape()); Shape outline = originalText.getShape(); siOutline = new Shape2(Shape2.SHAPE_TYPE_MODIFIER_FILL); siOutline.setShape(outline); if (originalText.getFillColor().getRed() == 255 && originalText.getFillColor().getGreen() == 255 && originalText.getFillColor().getBlue() == 255) { siOutline.setLineColor(Color.BLACK); } else { siOutline.setLineColor(Color.WHITE); } int width = RendererSettings.getInstance().getTextOutlineWidth(); siOutline.setStroke(new BasicStroke(width, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 3)); } catch (Exception exc) { ErrorLogger.LogException(_className, "createTextOutline", new RendererException("Failed inside createTextOutline", exc)); } return siOutline; }
y = y - (RendererSettings.getInstance().getTextOutlineWidth()/2); y = y - RendererSettings.getInstance().getTextOutlineWidth();
y = y - (RendererSettings.getInstance().getTextOutlineWidth()/2); y = y - RendererSettings.getInstance().getTextOutlineWidth();
int textOutlineWidth = RendererSettings.getInstance().getTextOutlineWidth(); echelonBounds.grow(textOutlineWidth, i); i = shapeSize;
int textOutlineWidth = RendererSettings.getInstance().getTextOutlineWidth(); echelonBounds.grow(textOutlineWidth, i); i = shapeSize;