public static string GetTRefText(SvgTRefElement element)
        {
            XmlElement refElement = element.ReferencedElement;

            if (refElement != null)
            {
                return(TrimText(element, refElement.InnerText));
            }
            return(string.Empty);
        }
Esempio n. 2
0
        private void RenderTRefPath(SvgTRefElement element, WpfPathTextBuilder pathBuilder, ref Point ctp)
        {
            WpfTextPlacement placement = WpfTextPlacement.Create(element, ctp, true);

            ctp = placement.Location;
            double rotate = placement.Rotation;

            if (!placement.HasPositions)
            {
                placement = null; // Render it useless.
            }

            this.RenderTextPath(element, pathBuilder, GetText(element),
                                new Point(ctp.X, ctp.Y), rotate, placement);
        }
        private void RenderTRefPath(SvgTRefElement element, WpfTextOnPathDrawing pathDrawing,
                                    ref Point ctp)
        {
            WpfTextPlacement placement = GetCurrentTextPosition(element, ctp);

            ctp = placement.Location;
            double rotate = placement.Rotation;

            if (!placement.HasPositions)
            {
                placement = null; // Render it useless.
            }

            this.RenderTextPath(element, pathDrawing, GetTRefText(element),
                                new Point(ctp.X, ctp.Y), rotate, placement);
        }
Esempio n. 4
0
        private void AddTRefElementRun(SvgTRefElement element, ref Point ctp,
                                       bool isVertical, bool isSingleLine)
        {
            _textContext.PositioningElement = element;
            _textContext.PositioningStart   = new Point(ctp.X, ctp.Y);

            WpfTextPlacement placement = WpfTextPlacement.Create(element, ctp);

            ctp = placement.Location;
            double rotate = placement.Rotation;

            if (!placement.HasPositions)
            {
                placement = null; // render it useless
            }

            _textContext.PositioningEnd = new Point(ctp.X, ctp.Y);

            if (isVertical)
            {
                if (isSingleLine)
                {
                    this.RenderSingleLineTextV(element, ref ctp, WpfTextRenderer.GetText(element), rotate, placement);
                }
                else
                {
                    this.RenderTextRunV(element, ref ctp, WpfTextRenderer.GetText(element), rotate, placement);
                }
            }
            else
            {
                if (isSingleLine)
                {
                    this.RenderSingleLineTextH(element, ref ctp, WpfTextRenderer.GetText(element), rotate, placement);
                }
                else
                {
                    this.RenderTextRunH(element, ref ctp, WpfTextRenderer.GetText(element), rotate, placement);
                }
            }
        }
        private void AddTRefElementRun(SvgTRefElement element, ref Point ctp,
                                       bool isVertical, bool isSingleLine)
        {
            WpfTextPlacement placement = WpfTextRenderer.GetCurrentTextPosition(element, ctp);

            ctp = placement.Location;
            double rotate = placement.Rotation;

            if (!placement.HasPositions)
            {
                placement = null; // render it useless
            }

            if (isVertical)
            {
                if (isSingleLine)
                {
                    this.RenderSingleLineTextV(element, ref ctp,
                                               WpfTextRenderer.GetTRefText(element), rotate, placement);
                }
                else
                {
                    this.RenderTextRunV(element, ref ctp,
                                        WpfTextRenderer.GetTRefText(element), rotate, placement);
                }
            }
            else
            {
                if (isSingleLine)
                {
                    this.RenderSingleLineTextH(element, ref ctp,
                                               WpfTextRenderer.GetTRefText(element), rotate, placement);
                }
                else
                {
                    this.RenderTextRunH(element, ref ctp,
                                        WpfTextRenderer.GetTRefText(element), rotate, placement);
                }
            }
        }
Esempio n. 6
0
        private void AddTRefElementPath(SvgTRefElement element, ref PointF ctp)
        {
            ctp = GetCurrentTextPosition(element, ctp);

            this.AddGraphicsPath(element, ref ctp, GetTRefText(element));
        }