protected override void Initialize(SvgElement element)
        {
            base.Initialize(element);

            _isMeasuring  = false;
            _isGroupAdded = false;
            _isTextPath   = false;
            _textWidth    = 0;
            _drawGroup    = null;

            _textElement = element as SvgTextBaseElement;
            if (_textElement == null)
            {
                throw new InvalidOperationException();
            }

            if (_textContext == null)
            {
                _textContext = new WpfTextContext(_textElement, this);
            }
            else
            {
                _textContext.SetElement(_textElement);
            }

            if (_horzRenderer == null)
            {
                _horzRenderer = new WpfHorzTextRenderer(_textElement, this);
            }
            else
            {
                _horzRenderer.Uninitialize();
                _horzRenderer.SetElement(_textElement);
            }
            if (_vertRenderer == null)
            {
                _vertRenderer = new WpfVertTextRenderer(_textElement, this);
            }
            else
            {
                _vertRenderer.Uninitialize();
                _vertRenderer.SetElement(_textElement);
            }
            if (_pathRenderer == null)
            {
                _pathRenderer = new WpfPathTextRenderer(_textElement, this);
            }
            else
            {
                _pathRenderer.Uninitialize();
                _pathRenderer.SetElement(_textElement);
            }
        }
예제 #2
0
        public WpfTextRendering(SvgElement element)
            : base(element)
        {
            _textElement = element as SvgTextBaseElement;
            if (_textElement != null)
            {
                _textContext = new WpfTextContext(_textElement, this);

                _horzRenderer = new WpfHorzTextRenderer(_textElement, this);
                _vertRenderer = new WpfVertTextRenderer(_textElement, this);
                _pathRenderer = new WpfPathTextRenderer(_textElement, this);
            }
        }
예제 #3
0
        public WpfTextRendering(SvgElement element)
            : base(element)
        {
            _textElement = element as SvgTextElement;
            if (_textElement == null)
            {
                throw new InvalidOperationException();
            }

            _textContext = new WpfTextContext(_textElement, this);

            _horzRenderer = new WpfHorzTextRenderer(_textElement, this);
            _vertRenderer = new WpfVertTextRenderer(_textElement, this);
            _pathRenderer = new WpfPathTextRenderer(_textElement, this);
        }