예제 #1
0
        public static string GetText(SvgAltGlyphElement element)
        {
            XmlElement refElement = element.ReferencedElement;

            if (refElement != null)
            {
                return(TrimText(element, element.InnerText));
            }
            return(string.Empty);
        }
예제 #2
0
        private void AddAltGlyphElementRun(SvgAltGlyphElement 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);
                }
            }
        }