public Text(object container, string text, string fontName, double fontHeight, SVGFontWeight weight, SVGFontStyle style, TextHorizAlign align) : base(container) { _textInfo = new TextInfo(text, fontName, fontHeight, weight, style, new ColorString("000000"), align); }
public TextInfo(string text, string fontFamily, double fontHeight, SVGFontWeight svgFontWeight, SVGFontStyle svgFontStyle, ColorString colorString, TextHorizAlign textHorizAlign) { M.Assert(!String.IsNullOrEmpty(text)); _text = text; _fontFamily = fontFamily; _svgFontWeight = svgFontWeight; _svgFontStyle = svgFontStyle; _fontHeight = fontHeight; _textHorizAlign = textHorizAlign; _colorString = colorString; }
public TextStyle(CSSObjectClass cssTextClass, string fontFamily, double fontHeight, SVGFontWeight svgFontWeight, SVGFontStyle svgFontStyle, TextHorizAlign textAnchor = TextHorizAlign.left, string fill = "black") : base(cssTextClass) { FontFamily = fontFamily; FontHeight = fontHeight; FontWeight = svgFontWeight; FontStyle = svgFontStyle; switch (textAnchor) { case (TextHorizAlign.left): TextAnchor = "left"; break; case (TextHorizAlign.center): TextAnchor = "middle"; break; case (TextHorizAlign.right): TextAnchor = "right"; break; } if (fill == "#FFFFFF" || fill == "FFFFFF") { Fill = "white"; } else if (fill == "#000000" || fill == "000000") { Fill = "black"; } else if (fill == "none" || fill == "white" || fill == "black" || fill == "red") { Fill = fill; } else { if (fill[0] != '#') { fill.Insert(0, "#"); } M.Assert(Regex.IsMatch(fill, @"^#[0-9a-fA-F]{6}$")); Fill = fill; // a string of the form "#AAAAAA" } }
public TextInfo(string text, string fontFamily, double fontHeight, SVGFontWeight fontWeight, SVGFontStyle fontStyle, TextHorizAlign textHorizAlign) : this(text, fontFamily, fontHeight, fontWeight, fontStyle, new ColorString("000000"), textHorizAlign) { }