string[] wrappedText; // text after being word wrapped. #endregion Fields #region Constructors public TextSymbol(TextSymDef def, string[] text, PointF location, float angle, float width) { this.def = def; this.location = location; this.rotation = angle; this.width = width; this.text = text; // For text that is wrapped and center or right aligned, the adjusted location // is the location that the text is aligned on. adjustedLocation = location; if (width > 0) { if (def.FontAlignment == TextSymDefAlignment.Right) adjustedLocation = Util.MoveDistance(adjustedLocation, width, angle); else if (def.FontAlignment == TextSymDefAlignment.Center) adjustedLocation = Util.MoveDistance(adjustedLocation, width / 2, angle); } if (width > 0) wrappedText = def.BreakLines(text, width, out wrappedLineWidths); else wrappedText = def.BreakUnwrappedLines(text, out wrappedLineWidths); // no wrapping. boundingBox = def.CalcBounds(wrappedText, wrappedLineWidths, adjustedLocation, rotation, width, out size); }
public LineTextSymbol(TextSymDef def, SymPath path, string text) { path.CheckConstructed(); this.def = def; this.path = path; this.text = text; boundingBox = def.CalcBounds(path, text); }