Exemple #1
0
        public override ISvgNodeRenderer CreateDeepCopy()
        {
            TextLeafSvgNodeRenderer copy = new TextLeafSvgNodeRenderer();

            DeepCopyAttributesAndStyles(copy);
            return(copy);
        }
        public virtual void GetContentLengthNoValueTest()
        {
            TextLeafSvgNodeRenderer toTest = new TextLeafSvgNodeRenderer();

            toTest.SetAttribute(SvgConstants.Attributes.TEXT_CONTENT, "Hello");
            PdfFont font     = PdfFontFactory.CreateFont();
            float   actual   = toTest.GetTextContentLength(12, font);
            float   expected = 27.336f;

            NUnit.Framework.Assert.AreEqual(expected, actual, 1e-6f);
        }
Exemple #3
0
 public virtual void GetContentLengthNaNTest()
 {
     NUnit.Framework.Assert.That(() => {
         TextLeafSvgNodeRenderer toTest = new TextLeafSvgNodeRenderer();
         toTest.SetAttribute(SvgConstants.Attributes.TEXT_CONTENT, "Hello");
         toTest.SetAttribute(SvgConstants.Attributes.FONT_SIZE, "spice");
         PdfFont font   = PdfFontFactory.CreateFont();
         float actual   = toTest.GetTextContentLength(12, font);
         float expected = 27.336f;
         NUnit.Framework.Assert.AreEqual(expected, actual, 1e-6f);
     }
                                 , NUnit.Framework.Throws.InstanceOf <StyledXMLParserException>())
     ;
 }