Exemple #1
0
        private void DrawEntity(Graphics graphics, ProjectedText text, CadColor?layerColor, Vector offset)
        {
            // TODO: handle rotation
            var x = (float)(text.Location.X + offset.X);
            var y = (float)(text.Location.Y - text.Height + offset.Y);

            graphics.DrawString(text.OriginalText.Value, SystemFonts.DefaultFont, ColorToBrush(text.OriginalText.Color ?? layerColor ?? autoColor), x, y);
        }
Exemple #2
0
        private static XElement ToXElement(ProjectedText text)
        {
            var xml = new XElement(SvgPlotter.Xmlns + "text",
                                   new XAttribute("x", text.Location.X),
                                   new XAttribute("y", text.Location.Y),
                                   new XAttribute("font-size", string.Format("{0}px", text.Height)),
                                   text.OriginalText.Value);

            AddRotationTransform(xml, text.Rotation, text.Location);
            AddStrokeIfNotDefault(xml, text.OriginalText.Color);
            AddFillIfNotDefault(xml, text.OriginalText.Color);
            return(xml);
        }